; LLVM IR from openssl/openssl :: demos/kdf (scrypt)

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

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [34 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.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 [5 x i8], align 1
@password = external hidden global [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@scrypt_salt = external hidden global [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@scrypt_n = external hidden global i32, align 4
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@scrypt_r = external hidden global i32, align 4
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@scrypt_p = external hidden global i32, align 4
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1
@expected_output = external hidden constant [64 x i8], align 16
@.str.10 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1

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

23:                                               ; preds = %2
  %24 = load ptr, ptr @stderr, align 8, !tbaa !9
  %25 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef @.str) #5
  br label %71

26:                                               ; preds = %2
  %27 = load ptr, ptr %12, align 8, !tbaa !9
  %28 = call ptr @EVP_KDF_fetch(ptr noundef %27, ptr noundef @.str.1, ptr noundef null)
  store ptr %28, ptr %7, align 8, !tbaa !9
  %29 = load ptr, ptr %7, align 8, !tbaa !9
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %34

31:                                               ; preds = %26
  %32 = load ptr, ptr @stderr, align 8, !tbaa !9
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.2) #5
  br label %71

34:                                               ; preds = %26
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = call ptr @EVP_KDF_CTX_new(ptr noundef %35)
  store ptr %36, ptr %8, align 8, !tbaa !9
  %37 = load ptr, ptr %8, align 8, !tbaa !9
  %38 = icmp eq ptr %37, null
  br i1 %38, label %39, label %42

39:                                               ; preds = %34
  %40 = load ptr, ptr @stderr, align 8, !tbaa !9
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef @.str.3) #5
  br label %71

42:                                               ; preds = %34
  %43 = load ptr, ptr %11, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.ossl_param_st, ptr %43, i32 1
  store ptr %44, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %13) #5
  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 @password, i64 noundef 8)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %43, ptr align 8 %13, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %13) #5
  %45 = load ptr, ptr %11, align 8, !tbaa !9
  %46 = getelementptr inbounds %struct.ossl_param_st, ptr %45, i32 1
  store ptr %46, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #5
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %14, ptr noundef @.str.5, ptr noundef @scrypt_salt, i64 noundef 4)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %45, ptr align 8 %14, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  %47 = load ptr, ptr %11, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.ossl_param_st, ptr %47, i32 1
  store ptr %48, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #5
  call void @OSSL_PARAM_construct_uint(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %15, ptr noundef @.str.6, ptr noundef @scrypt_n)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %47, ptr align 8 %15, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #5
  %49 = load ptr, ptr %11, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.ossl_param_st, ptr %49, i32 1
  store ptr %50, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #5
  call void @OSSL_PARAM_construct_uint(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %16, ptr noundef @.str.7, ptr noundef @scrypt_r)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %49, ptr align 8 %16, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #5
  %51 = load ptr, ptr %11, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.ossl_param_st, ptr %51, i32 1
  store ptr %52, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %17) #5
  call void @OSSL_PARAM_construct_uint(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %17, ptr noundef @.str.8, ptr noundef @scrypt_p)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %51, ptr align 8 %17, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %17) #5
  %53 = load ptr, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %18) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8 %18)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %53, ptr align 8 %18, i64 40, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 40, ptr %18) #5
  %54 = load ptr, ptr %8, align 8, !tbaa !9
  %55 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %56 = getelementptr inbounds [6 x %struct.ossl_param_st], ptr %10, i64 0, i64 0
  %57 = call i32 @EVP_KDF_derive(ptr noundef %54, ptr noundef %55, i64 noundef 64, ptr noundef %56)
  %58 = icmp ne i32 %57, 1
  br i1 %58, label %59, label %62

59:                                               ; preds = %42
  %60 = load ptr, ptr @stderr, align 8, !tbaa !9
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef @.str.9) #5
  br label %71

62:                                               ; preds = %42
  %63 = getelementptr inbounds [64 x i8], ptr %9, i64 0, i64 0
  %64 = call i32 @CRYPTO_memcmp(ptr noundef @expected_output, ptr noundef %63, i64 noundef 64)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %69

66:                                               ; preds = %62
  %67 = load ptr, ptr @stderr, align 8, !tbaa !9
  %68 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef @.str.10) #5
  br label %71

69:                                               ; preds = %62
  %70 = call i32 (ptr, ...) @printf(ptr noundef @.str.11)
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %69, %66, %59, %39, %31, %23
  %72 = load ptr, ptr %8, align 8, !tbaa !9
  call void @EVP_KDF_CTX_free(ptr noundef %72)
  %73 = load ptr, ptr %7, align 8, !tbaa !9
  call void @EVP_KDF_free(ptr noundef %73)
  %74 = load ptr, ptr %12, align 8, !tbaa !9
  call void @OSSL_LIB_CTX_free(ptr noundef %74)
  %75 = load i32, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  ret i32 %75
}

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

declare ptr @OSSL_LIB_CTX_new() #2

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

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

declare ptr @EVP_KDF_CTX_new(ptr noundef) #2

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) #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) #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_uint(ptr dead_on_unwind writable sret(%struct.ossl_param_st) align 8, ptr noundef, ptr noundef) #2

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

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

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

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

declare void @EVP_KDF_CTX_free(ptr noundef) #2

declare void @EVP_KDF_free(ptr noundef) #2

declare void @OSSL_LIB_CTX_free(ptr 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 = { 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 = { 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 = !{i64 0, i64 8, !9, i64 8, i64 4, !5, i64 16, i64 8, !9, i64 24, i64 8, !12, i64 32, i64 8, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !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 }

@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 [7 x i8], align 1
@.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 [5 x i8], align 1
@password = external hidden global [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [5 x i8], align 1
@scrypt_salt = external hidden global [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 x i8], align 1
@scrypt_n = external hidden global i32, align 4
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@scrypt_r = external hidden global i32, align 4
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@scrypt_p = external hidden global i32, align 4
@.str.9 = external hidden unnamed_addr constant [25 x i8], align 1
@expected_output = external hidden constant [64 x i8], align 16
@.str.10 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca [64 x i8], align 16
  %4 = alloca [6 x %struct.ossl_param_st], align 16
  %5 = alloca %struct.ossl_param_st, align 8
  %6 = alloca %struct.ossl_param_st, align 8
  %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 64, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 240, ptr nonnull %4) #5
  %10 = tail call ptr @OSSL_LIB_CTX_new() #5
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %15

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

15:                                               ; preds = %2
  %16 = tail call ptr @EVP_KDF_fetch(ptr noundef nonnull %10, ptr noundef nonnull @.str.1, ptr noundef null) #5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %21

18:                                               ; preds = %15
  %19 = load ptr, ptr @stderr, align 8, !tbaa !5
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef nonnull @.str.2) #6
  br label %44

21:                                               ; preds = %15
  %22 = tail call ptr @EVP_KDF_CTX_new(ptr noundef nonnull %16) #5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %27

24:                                               ; preds = %21
  %25 = load ptr, ptr @stderr, align 8, !tbaa !5
  %26 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.3) #6
  br label %44

27:                                               ; preds = %21
  %28 = getelementptr inbounds i8, ptr %4, i64 40
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %4, ptr noundef nonnull @.str.4, ptr noundef nonnull @password, i64 noundef 8) #5
  %29 = getelementptr inbounds i8, ptr %4, i64 80
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #5
  call void @OSSL_PARAM_construct_octet_string(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %5, ptr noundef nonnull @.str.5, ptr noundef nonnull @scrypt_salt, i64 noundef 4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %28, ptr noundef nonnull align 8 dereferenceable(40) %5, i64 40, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #5
  %30 = getelementptr inbounds i8, ptr %4, i64 120
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #5
  call void @OSSL_PARAM_construct_uint(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %6, ptr noundef nonnull @.str.6, ptr noundef nonnull @scrypt_n) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %29, ptr noundef nonnull align 8 dereferenceable(40) %6, i64 40, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #5
  %31 = getelementptr inbounds i8, ptr %4, i64 160
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #5
  call void @OSSL_PARAM_construct_uint(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %7, ptr noundef nonnull @.str.7, ptr noundef nonnull @scrypt_r) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %30, ptr noundef nonnull align 8 dereferenceable(40) %7, i64 40, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #5
  %32 = getelementptr inbounds i8, ptr %4, i64 200
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #5
  call void @OSSL_PARAM_construct_uint(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %8, ptr noundef nonnull @.str.8, ptr noundef nonnull @scrypt_p) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(40) %31, ptr noundef nonnull align 8 dereferenceable(40) %8, i64 40, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %9) #5
  call void @OSSL_PARAM_construct_end(ptr dead_on_unwind nonnull writable sret(%struct.ossl_param_st) align 8 %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %32, ptr noundef nonnull align 8 dereferenceable(40) %9, i64 40, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %9) #5
  %33 = call i32 @EVP_KDF_derive(ptr noundef nonnull %22, ptr noundef nonnull %3, i64 noundef 64, ptr noundef nonnull %4) #5
  %.not = icmp eq i32 %33, 1
  br i1 %.not, label %37, label %34

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

37:                                               ; preds = %27
  %38 = call i32 @CRYPTO_memcmp(ptr noundef nonnull @expected_output, ptr noundef nonnull %3, i64 noundef 64) #5
  %.not21 = icmp eq i32 %38, 0
  br i1 %.not21, label %42, label %39

39:                                               ; preds = %37
  %40 = load ptr, ptr @stderr, align 8, !tbaa !5
  %41 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %40, ptr noundef nonnull @.str.10) #6
  br label %44

42:                                               ; preds = %37
  %43 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11)
  br label %44

44:                                               ; preds = %42, %39, %34, %24, %18, %12
  %.016 = phi i32 [ 1, %12 ], [ 1, %18 ], [ 1, %24 ], [ 1, %34 ], [ 1, %39 ], [ 0, %42 ]
  %.015 = phi ptr [ null, %12 ], [ null, %18 ], [ %16, %24 ], [ %16, %34 ], [ %16, %39 ], [ %16, %42 ]
  %.0 = phi ptr [ null, %12 ], [ null, %18 ], [ null, %24 ], [ %22, %34 ], [ %22, %39 ], [ %22, %42 ]
  call void @EVP_KDF_CTX_free(ptr noundef %.0) #5
  call void @EVP_KDF_free(ptr noundef %.015) #5
  call void @OSSL_LIB_CTX_free(ptr noundef %10) #5
  call void @llvm.lifetime.end.p0(i64 240, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #5
  ret i32 %.016
}

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

declare ptr @OSSL_LIB_CTX_new() local_unnamed_addr #2

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

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

declare ptr @EVP_KDF_CTX_new(ptr noundef) local_unnamed_addr #2

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

; 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

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

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

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

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

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

declare void @EVP_KDF_CTX_free(ptr noundef) local_unnamed_addr #2

declare void @EVP_KDF_free(ptr noundef) local_unnamed_addr #2

declare void @OSSL_LIB_CTX_free(ptr 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i64 0, i64 8, !5, i64 8, i64 4, !10, i64 16, i64 8, !5, i64 24, i64 8, !12, i64 32, i64 8, !12}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}


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