; LLVM IR from openanolis/openssl :: demos/cipher (aesccm)

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

@libctx = external dso_local global ptr, align 8
@propq = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@stdout = external global ptr, align 8
@ccm_pt = external hidden constant [24 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@ccm_key = external hidden constant [24 x i8], align 16
@ccm_nonce = external hidden constant [7 x i8], align 1
@ccm_adata = external hidden constant [32 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@stderr = external global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local i32 @aes_ccm_encrypt() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca [1024 x i8], align 16
  %9 = alloca [16 x i8], align 16
  %10 = alloca [3 x %struct.ossl_param_st], align 16
  %11 = alloca %struct.ossl_param_st, align 8
  %12 = alloca %struct.ossl_param_st, align 8
  %13 = alloca %struct.ossl_param_st, align 8
  %14 = alloca %struct.ossl_param_st, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #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 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store i64 7, ptr %6, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 16, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1024, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 120, ptr %10) #5
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 120, i1 false)
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %16 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  %17 = load ptr, ptr @stdout, align 8, !tbaa !9
  %18 = call i32 @BIO_dump_fp(ptr noundef %17, ptr noundef @ccm_pt, i32 noundef 24)
  %19 = call ptr @EVP_CIPHER_CTX_new()
  store ptr %19, ptr %2, align 8, !tbaa !9
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %22

21:                                               ; preds = %0
  br label %86

22:                                               ; preds = %0
  %23 = load ptr, ptr @libctx, align 8, !tbaa !9
  %24 = load ptr, ptr @propq, align 8, !tbaa !9
  %25 = call ptr @EVP_CIPHER_fetch(ptr noundef %23, ptr noundef @.str.2, ptr noundef %24)
  store ptr %25, ptr %3, align 8, !tbaa !9
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %22
  br label %86

28:                                               ; preds = %22
  %29 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %10, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 40, ptr %11) #5
  call void @OSSL_PARAM_construct_size_t(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %11, ptr noundef @.str.3, ptr noundef %6)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %29, ptr align 8 %11, i64 40, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 40, ptr %11) #5
  %30 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %10, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 40, ptr %12) #5
  %31 = load i64, ptr %7, align 8, !tbaa !11
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %12, ptr noundef @.str.4, ptr noundef null, i64 noundef %31)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %30, ptr align 8 %12, i64 40, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 40, ptr %12) #5
  %32 = load ptr, ptr %2, align 8, !tbaa !9
  %33 = load ptr, ptr %3, align 8, !tbaa !9
  %34 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %10, i64 0, i64 0
  %35 = call i32 @EVP_EncryptInit_ex2(ptr noundef %32, ptr noundef %33, ptr noundef null, ptr noundef null, ptr noundef %34)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %38, label %37

37:                                               ; preds = %28
  br label %86

38:                                               ; preds = %28
  %39 = load ptr, ptr %2, align 8, !tbaa !9
  %40 = call i32 @EVP_EncryptInit_ex(ptr noundef %39, ptr noundef null, ptr noundef null, ptr noundef @ccm_key, ptr noundef @ccm_nonce)
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  br label %86

43:                                               ; preds = %38
  %44 = load ptr, ptr %2, align 8, !tbaa !9
  %45 = call i32 @EVP_EncryptUpdate(ptr noundef %44, ptr noundef null, ptr noundef %4, ptr noundef null, i32 noundef 24)
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  br label %86

48:                                               ; preds = %43
  %49 = load ptr, ptr %2, align 8, !tbaa !9
  %50 = call i32 @EVP_EncryptUpdate(ptr noundef %49, ptr noundef null, ptr noundef %4, ptr noundef @ccm_adata, i32 noundef 32)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %53, label %52

52:                                               ; preds = %48
  br label %86

53:                                               ; preds = %48
  %54 = load ptr, ptr %2, align 8, !tbaa !9
  %55 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %56 = call i32 @EVP_EncryptUpdate(ptr noundef %54, ptr noundef %55, ptr noundef %4, ptr noundef @ccm_pt, i32 noundef 24)
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %59, label %58

58:                                               ; preds = %53
  br label %86

59:                                               ; preds = %53
  %60 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  %61 = load ptr, ptr @stdout, align 8, !tbaa !9
  %62 = getelementptr inbounds [1024 x i8], ptr %8, i64 0, i64 0
  %63 = load i32, ptr %4, align 4, !tbaa !5
  %64 = call i32 @BIO_dump_fp(ptr noundef %61, ptr noundef %62, i32 noundef %63)
  %65 = load ptr, ptr %2, align 8, !tbaa !9
  %66 = call i32 @EVP_EncryptFinal_ex(ptr noundef %65, ptr noundef null, ptr noundef %5)
  %67 = icmp ne i32 %66, 0
  br i1 %67, label %69, label %68

68:                                               ; preds = %59
  br label %86

69:                                               ; preds = %59
  %70 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %10, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #5
  %71 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %72 = load i64, ptr %7, align 8, !tbaa !11
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %13, ptr noundef @.str.4, ptr noundef %71, i64 noundef %72)
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %70, ptr align 8 %13, i64 40, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #5
  %73 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %10, i64 0, i64 1
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %14)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %73, ptr align 8 %14, i64 40, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  %74 = load ptr, ptr %2, align 8, !tbaa !9
  %75 = getelementptr inbounds [3 x %struct.ossl_param_st], ptr %10, i64 0, i64 0
  %76 = call i32 @EVP_CIPHER_CTX_get_params(ptr noundef %74, ptr noundef %75)
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %79, label %78

78:                                               ; preds = %69
  br label %86

79:                                               ; preds = %69
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %81 = load ptr, ptr @stdout, align 8, !tbaa !9
  %82 = getelementptr inbounds [16 x i8], ptr %9, i64 0, i64 0
  %83 = load i64, ptr %7, align 8, !tbaa !11
  %84 = trunc i64 %83 to i32
  %85 = call i32 @BIO_dump_fp(ptr noundef %81, ptr noundef %82, i32 noundef %84)
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %79, %78, %68, %58, %52, %47, %42, %37, %27, %21
  %87 = load i32, ptr %1, align 4, !tbaa !5
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %91, label %89

89:                                               ; preds = %86
  %90 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %90)
  br label %91

91:                                               ; preds = %89, %86
  %92 = load ptr, ptr %3, align 8, !tbaa !9
  call void @EVP_CIPHER_free(ptr noundef %92)
  %93 = load ptr, ptr %2, align 8, !tbaa !9
  call void @EVP_CIPHER_CTX_free(ptr noundef %93)
  %94 = load i32, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 120, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret i32 %94
}

; 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

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

declare ptr @EVP_CIPHER_CTX_new() #3

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

declare void @OSSL_PARAM_construct_size_t(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr 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

; 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_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) #3

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

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

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

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

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

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

declare void @ERR_print_errors_fp(ptr noundef) #3

declare void @EVP_CIPHER_free(ptr noundef) #3

declare void @EVP_CIPHER_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: 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 = !{!"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 }

@libctx = external dso_local local_unnamed_addr global ptr, align 8
@propq = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [18 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [12 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@ccm_pt = external hidden constant [24 x i8], align 16
@.str.2 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [4 x i8], align 1
@ccm_key = external hidden constant [24 x i8], align 16
@ccm_nonce = external hidden constant [7 x i8], align 1
@ccm_adata = external hidden constant [32 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @aes_ccm_encrypt() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca [1024 x i8], align 16
  %5 = alloca [16 x i8], align 16
  %6 = alloca [3 x %struct.ossl_param_st], align 16
  %7 = alloca %struct.ossl_param_st, align 8
  %8 = alloca %struct.ossl_param_st, align 8
  %9 = alloca %struct.ossl_param_st, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 7, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %6) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(120) %6, i8 0, i64 120, i1 false)
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %11 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  %12 = load ptr, ptr @stdout, align 8, !tbaa !9
  %13 = tail call i32 @BIO_dump_fp(ptr noundef %12, ptr noundef nonnull @ccm_pt, i32 noundef 24) #6
  %14 = tail call ptr @EVP_CIPHER_CTX_new() #6
  %15 = icmp eq ptr %14, null
  br i1 %15, label %44, label %16

16:                                               ; preds = %0
  %17 = load ptr, ptr @libctx, align 8, !tbaa !9
  %18 = load ptr, ptr @propq, align 8, !tbaa !9
  %19 = tail call ptr @EVP_CIPHER_fetch(ptr noundef %17, ptr noundef nonnull @.str.2, ptr noundef %18) #6
  %20 = icmp eq ptr %19, null
  br i1 %20, label %44, label %21

21:                                               ; preds = %16
  call void @OSSL_PARAM_construct_size_t(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %6, ptr noundef nonnull @.str.3, ptr noundef nonnull %3) #6
  %22 = getelementptr inbounds i8, ptr %6, i64 40
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #6
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %7, ptr noundef nonnull @.str.4, ptr noundef null, i64 noundef 16) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %22, ptr noundef nonnull align 8 dereferenceable(40) %7, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #6
  %23 = call i32 @EVP_EncryptInit_ex2(ptr noundef nonnull %14, ptr noundef nonnull %19, ptr noundef null, ptr noundef null, ptr noundef nonnull %6) #6
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %44, label %24

24:                                               ; preds = %21
  %25 = call i32 @EVP_EncryptInit_ex(ptr noundef nonnull %14, ptr noundef null, ptr noundef null, ptr noundef nonnull @ccm_key, ptr noundef nonnull @ccm_nonce) #6
  %.not17 = icmp eq i32 %25, 0
  br i1 %.not17, label %44, label %26

26:                                               ; preds = %24
  %27 = call i32 @EVP_EncryptUpdate(ptr noundef nonnull %14, ptr noundef null, ptr noundef nonnull %1, ptr noundef null, i32 noundef 24) #6
  %.not18 = icmp eq i32 %27, 0
  br i1 %.not18, label %44, label %28

28:                                               ; preds = %26
  %29 = call i32 @EVP_EncryptUpdate(ptr noundef nonnull %14, ptr noundef null, ptr noundef nonnull %1, ptr noundef nonnull @ccm_adata, i32 noundef 32) #6
  %.not19 = icmp eq i32 %29, 0
  br i1 %.not19, label %44, label %30

30:                                               ; preds = %28
  %31 = call i32 @EVP_EncryptUpdate(ptr noundef nonnull %14, ptr noundef nonnull %4, ptr noundef nonnull %1, ptr noundef nonnull @ccm_pt, i32 noundef 24) #6
  %.not20 = icmp eq i32 %31, 0
  br i1 %.not20, label %44, label %32

32:                                               ; preds = %30
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %34 = load ptr, ptr @stdout, align 8, !tbaa !9
  %35 = load i32, ptr %1, align 4, !tbaa !12
  %36 = call i32 @BIO_dump_fp(ptr noundef %34, ptr noundef nonnull %4, i32 noundef %35) #6
  %37 = call i32 @EVP_EncryptFinal_ex(ptr noundef nonnull %14, ptr noundef null, ptr noundef nonnull %2) #6
  %.not21 = icmp eq i32 %37, 0
  br i1 %.not21, label %44, label %38

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #6
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %8, ptr noundef nonnull @.str.4, ptr noundef nonnull %5, i64 noundef 16) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %6, ptr noundef nonnull align 8 dereferenceable(40) %8, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #6
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %9) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %22, ptr noundef nonnull align 8 dereferenceable(40) %9, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #6
  %39 = call i32 @EVP_CIPHER_CTX_get_params(ptr noundef nonnull %14, ptr noundef nonnull %6) #6
  %.not22 = icmp eq i32 %39, 0
  br i1 %.not22, label %44, label %40

40:                                               ; preds = %38
  %41 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %42 = load ptr, ptr @stdout, align 8, !tbaa !9
  %43 = call i32 @BIO_dump_fp(ptr noundef %42, ptr noundef nonnull %5, i32 noundef 16) #6
  br label %46

44:                                               ; preds = %0, %16, %38, %32, %30, %28, %26, %24, %21
  %.014.ph = phi ptr [ %19, %21 ], [ %19, %24 ], [ %19, %26 ], [ %19, %28 ], [ %19, %30 ], [ %19, %32 ], [ %19, %38 ], [ null, %16 ], [ null, %0 ]
  %45 = load ptr, ptr @stderr, align 8, !tbaa !9
  call void @ERR_print_errors_fp(ptr noundef %45) #6
  br label %46

46:                                               ; preds = %40, %44
  %.029 = phi i32 [ 0, %44 ], [ 1, %40 ]
  %.01427 = phi ptr [ %.014.ph, %44 ], [ %19, %40 ]
  call void @EVP_CIPHER_free(ptr noundef %.01427) #6
  call void @EVP_CIPHER_CTX_free(ptr noundef %14) #6
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 %.029
}

; 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

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

declare i32 @BIO_dump_fp(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare ptr @EVP_CIPHER_CTX_new() local_unnamed_addr #4

declare ptr @EVP_CIPHER_fetch(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @OSSL_PARAM_construct_size_t(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef) local_unnamed_addr #4

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

; 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_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #4

declare i32 @EVP_EncryptInit_ex2(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @EVP_EncryptUpdate(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i32 @EVP_EncryptFinal_ex(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

declare i32 @EVP_CIPHER_CTX_get_params(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @ERR_print_errors_fp(ptr noundef) local_unnamed_addr #4

declare void @EVP_CIPHER_free(ptr noundef) local_unnamed_addr #4

declare void @EVP_CIPHER_CTX_free(ptr noundef) local_unnamed_addr #4

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