; LLVM IR from ARMmbed/mbed-crypto :: library (pkcs5)

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

@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@password_test_data = external hidden constant [6 x [32 x i8]], align 16
@plen_test_data = external hidden constant [6 x i64], align 16
@salt_test_data = external hidden constant [6 x [40 x i8]], align 16
@slen_test_data = external hidden constant [6 x i64], align 16
@it_cnt_test_data = external hidden constant [6 x i32], align 16
@key_len_test_data = external hidden constant [6 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@result_key_test_data = external hidden constant <{ <{ [20 x i8], [12 x i8] }>, <{ [20 x i8], [12 x i8] }>, <{ [20 x i8], [12 x i8] }>, [32 x i8], <{ [16 x i8], [16 x i8] }>, [32 x i8] }>, align 16

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #1

declare ptr @mbedtls_md_info_from_type(i32 noundef) #2

declare void @mbedtls_md_init(ptr noundef) #2

declare i32 @mbedtls_md_setup(ptr noundef, ptr noundef, i32 noundef) #2

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

declare void @mbedtls_md_free(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @mbedtls_pkcs5_self_test(i32 noundef %0) #3 {
  %2 = alloca i32, align 4
  %3 = alloca %struct.mbedtls_md_context_t, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca [64 x i8], align 16
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #4
  call void @mbedtls_md_init(ptr noundef %3)
  %8 = call ptr @mbedtls_md_info_from_type(i32 noundef 4)
  store ptr %8, ptr %4, align 8, !tbaa !9
  %9 = load ptr, ptr %4, align 8, !tbaa !9
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %1
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %90

12:                                               ; preds = %1
  %13 = load ptr, ptr %4, align 8, !tbaa !9
  %14 = call i32 @mbedtls_md_setup(ptr noundef %3, ptr noundef %13, i32 noundef 1)
  store i32 %14, ptr %5, align 4, !tbaa !5
  %15 = icmp ne i32 %14, 0
  br i1 %15, label %16, label %17

16:                                               ; preds = %12
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %90

17:                                               ; preds = %12
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %81, %17
  %19 = load i32, ptr %6, align 4, !tbaa !5
  %20 = icmp slt i32 %19, 6
  br i1 %20, label %21, label %84

21:                                               ; preds = %18
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %27

24:                                               ; preds = %21
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %25)
  br label %27

27:                                               ; preds = %24, %21
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [6 x [32 x i8]], ptr @password_test_data, i64 0, i64 %29
  %31 = getelementptr inbounds [32 x i8], ptr %30, i64 0, i64 0
  %32 = load i32, ptr %6, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [6 x i64], ptr @plen_test_data, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !11
  %36 = load i32, ptr %6, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [6 x [40 x i8]], ptr @salt_test_data, i64 0, i64 %37
  %39 = getelementptr inbounds [40 x i8], ptr %38, i64 0, i64 0
  %40 = load i32, ptr %6, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [6 x i64], ptr @slen_test_data, i64 0, i64 %41
  %43 = load i64, ptr %42, align 8, !tbaa !11
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [6 x i32], ptr @it_cnt_test_data, i64 0, i64 %45
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [6 x i32], ptr @key_len_test_data, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %53 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef %3, ptr noundef %31, i64 noundef %35, ptr noundef %39, i64 noundef %43, i32 noundef %47, i32 noundef %51, ptr noundef %52)
  store i32 %53, ptr %5, align 4, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %69, label %56

56:                                               ; preds = %27
  %57 = load i32, ptr %6, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [6 x [32 x i8]], ptr @result_key_test_data, i64 0, i64 %58
  %60 = getelementptr inbounds [32 x i8], ptr %59, i64 0, i64 0
  %61 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [6 x i32], ptr @key_len_test_data, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = zext i32 %65 to i64
  %67 = call i32 @memcmp(ptr noundef %60, ptr noundef %61, i64 noundef %66) #5
  %68 = icmp ne i32 %67, 0
  br i1 %68, label %69, label %75

69:                                               ; preds = %56, %27
  %70 = load i32, ptr %2, align 4, !tbaa !5
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %74

72:                                               ; preds = %69
  %73 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  br label %74

74:                                               ; preds = %72, %69
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %90

75:                                               ; preds = %56
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = icmp ne i32 %76, 0
  br i1 %77, label %78, label %80

78:                                               ; preds = %75
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.3)
  br label %80

80:                                               ; preds = %78, %75
  br label %81

81:                                               ; preds = %80
  %82 = load i32, ptr %6, align 4, !tbaa !5
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %6, align 4, !tbaa !5
  br label %18, !llvm.loop !13

84:                                               ; preds = %18
  %85 = load i32, ptr %2, align 4, !tbaa !5
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %89

87:                                               ; preds = %84
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.4)
  br label %89

89:                                               ; preds = %87, %84
  br label %90

90:                                               ; preds = %89, %74, %16, %11
  call void @mbedtls_md_free(ptr noundef %3)
  %91 = load i32, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #4
  ret i32 %91
}

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind willreturn memory(read) "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 = { "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 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 #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


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

@.str.1 = external hidden unnamed_addr constant [22 x i8], align 1
@password_test_data = external hidden constant [6 x [32 x i8]], align 16
@plen_test_data = external hidden local_unnamed_addr constant [6 x i64], align 16
@salt_test_data = external hidden constant [6 x [40 x i8]], align 16
@slen_test_data = external hidden local_unnamed_addr constant [6 x i64], align 16
@it_cnt_test_data = external hidden local_unnamed_addr constant [6 x i32], align 16
@key_len_test_data = external hidden local_unnamed_addr constant [6 x i32], align 16
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@result_key_test_data = external hidden constant <{ <{ [20 x i8], [12 x i8] }>, <{ [20 x i8], [12 x i8] }>, <{ [20 x i8], [12 x i8] }>, [32 x i8], <{ [16 x i8], [16 x i8] }>, [32 x i8] }>, align 16

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

declare ptr @mbedtls_md_info_from_type(i32 noundef) local_unnamed_addr #1

declare void @mbedtls_md_init(ptr noundef) local_unnamed_addr #1

declare i32 @mbedtls_md_setup(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare void @mbedtls_md_free(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @mbedtls_pkcs5_self_test(i32 noundef %0) local_unnamed_addr #2 {
  %2 = alloca %struct.mbedtls_md_context_t, align 8
  %3 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #5
  call void @mbedtls_md_init(ptr noundef nonnull %2) #5
  %4 = call ptr @mbedtls_md_info_from_type(i32 noundef 4) #5
  %5 = icmp eq ptr %4, null
  br i1 %5, label %.critedge, label %6

6:                                                ; preds = %1
  %7 = call i32 @mbedtls_md_setup(ptr noundef nonnull %2, ptr noundef nonnull %4, i32 noundef 1) #5
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %.preheader, label %.critedge

.preheader:                                       ; preds = %6
  %.not23 = icmp eq i32 %0, 0
  br i1 %.not23, label %.preheader.split.us.preheader, label %.preheader.split.preheader

.preheader.split.preheader:                       ; preds = %.preheader
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
  %9 = load i64, ptr @plen_test_data, align 16, !tbaa !5
  %10 = load i64, ptr @slen_test_data, align 16, !tbaa !5
  %11 = load i32, ptr @it_cnt_test_data, align 16, !tbaa !9
  %12 = load i32, ptr @key_len_test_data, align 16, !tbaa !9
  %13 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull @password_test_data, i64 noundef %9, ptr noundef nonnull @salt_test_data, i64 noundef %10, i32 noundef %11, i32 noundef %12, ptr noundef nonnull %3)
  %.not24 = icmp eq i32 %13, 0
  br i1 %.not24, label %56, label %.critedge.sink.split

.preheader.split.us.preheader:                    ; preds = %.preheader
  %14 = load i64, ptr @plen_test_data, align 16, !tbaa !5
  %15 = load i64, ptr @slen_test_data, align 16, !tbaa !5
  %16 = load i32, ptr @it_cnt_test_data, align 16, !tbaa !9
  %17 = load i32, ptr @key_len_test_data, align 16, !tbaa !9
  %18 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull @password_test_data, i64 noundef %14, ptr noundef nonnull @salt_test_data, i64 noundef %15, i32 noundef %16, i32 noundef %17, ptr noundef nonnull %3)
  %.not24.us = icmp eq i32 %18, 0
  br i1 %.not24.us, label %19, label %.critedge

19:                                               ; preds = %.preheader.split.us.preheader
  %20 = zext i32 %17 to i64
  %bcmp.us = call i32 @bcmp(ptr nonnull @result_key_test_data, ptr nonnull %3, i64 %20)
  %.not25.us = icmp eq i32 %bcmp.us, 0
  br i1 %.not25.us, label %.preheader.split.us.1, label %.critedge

.preheader.split.us.1:                            ; preds = %19
  %21 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 8), align 8, !tbaa !5
  %22 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 8), align 8, !tbaa !5
  %23 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 4), align 4, !tbaa !9
  %24 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 4), align 4, !tbaa !9
  %25 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 32), i64 noundef %21, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 40), i64 noundef %22, i32 noundef %23, i32 noundef %24, ptr noundef nonnull %3)
  %.not24.us.1 = icmp eq i32 %25, 0
  br i1 %.not24.us.1, label %26, label %.critedge

26:                                               ; preds = %.preheader.split.us.1
  %27 = zext i32 %24 to i64
  %bcmp.us.1 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 32), ptr nonnull %3, i64 %27)
  %.not25.us.1 = icmp eq i32 %bcmp.us.1, 0
  br i1 %.not25.us.1, label %.preheader.split.us.2, label %.critedge

.preheader.split.us.2:                            ; preds = %26
  %28 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 16), align 16, !tbaa !5
  %29 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 16), align 16, !tbaa !5
  %30 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 8), align 8, !tbaa !9
  %31 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 8), align 8, !tbaa !9
  %32 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 64), i64 noundef %28, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 80), i64 noundef %29, i32 noundef %30, i32 noundef %31, ptr noundef nonnull %3)
  %.not24.us.2 = icmp eq i32 %32, 0
  br i1 %.not24.us.2, label %33, label %.critedge

33:                                               ; preds = %.preheader.split.us.2
  %34 = zext i32 %31 to i64
  %bcmp.us.2 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 64), ptr nonnull %3, i64 %34)
  %.not25.us.2 = icmp eq i32 %bcmp.us.2, 0
  br i1 %.not25.us.2, label %.preheader.split.us.3, label %.critedge

.preheader.split.us.3:                            ; preds = %33
  %35 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 24), align 8, !tbaa !5
  %36 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 24), align 8, !tbaa !5
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 12), align 4, !tbaa !9
  %38 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 12), align 4, !tbaa !9
  %39 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 96), i64 noundef %35, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 120), i64 noundef %36, i32 noundef %37, i32 noundef %38, ptr noundef nonnull %3)
  %.not24.us.3 = icmp eq i32 %39, 0
  br i1 %.not24.us.3, label %40, label %.critedge

40:                                               ; preds = %.preheader.split.us.3
  %41 = zext i32 %38 to i64
  %bcmp.us.3 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 96), ptr nonnull %3, i64 %41)
  %.not25.us.3 = icmp eq i32 %bcmp.us.3, 0
  br i1 %.not25.us.3, label %.preheader.split.us.4, label %.critedge

.preheader.split.us.4:                            ; preds = %40
  %42 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 32), align 16, !tbaa !5
  %43 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 32), align 16, !tbaa !5
  %44 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 16), align 16, !tbaa !9
  %45 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 16), align 16, !tbaa !9
  %46 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 128), i64 noundef %42, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 160), i64 noundef %43, i32 noundef %44, i32 noundef %45, ptr noundef nonnull %3)
  %.not24.us.4 = icmp eq i32 %46, 0
  br i1 %.not24.us.4, label %47, label %.critedge

47:                                               ; preds = %.preheader.split.us.4
  %48 = zext i32 %45 to i64
  %bcmp.us.4 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 128), ptr nonnull %3, i64 %48)
  %.not25.us.4 = icmp eq i32 %bcmp.us.4, 0
  br i1 %.not25.us.4, label %.preheader.split.us.5, label %.critedge

.preheader.split.us.5:                            ; preds = %47
  %49 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 40), align 8, !tbaa !5
  %50 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 40), align 8, !tbaa !5
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 20), align 4, !tbaa !9
  %52 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 20), align 4, !tbaa !9
  %53 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 160), i64 noundef %49, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 200), i64 noundef %50, i32 noundef %51, i32 noundef %52, ptr noundef nonnull %3)
  %.not24.us.5 = icmp eq i32 %53, 0
  br i1 %.not24.us.5, label %54, label %.critedge

54:                                               ; preds = %.preheader.split.us.5
  %55 = zext i32 %52 to i64
  %bcmp.us.5 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 160), ptr nonnull %3, i64 %55)
  %.not25.us.5 = icmp ne i32 %bcmp.us.5, 0
  %spec.select = zext i1 %.not25.us.5 to i32
  br label %.critedge

56:                                               ; preds = %.preheader.split.preheader
  %57 = zext i32 %12 to i64
  %bcmp = call i32 @bcmp(ptr nonnull @result_key_test_data, ptr nonnull %3, i64 %57)
  %.not25 = icmp eq i32 %bcmp, 0
  br i1 %.not25, label %.preheader.split.1, label %.critedge.sink.split

.preheader.split.1:                               ; preds = %56
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1)
  %60 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 8), align 8, !tbaa !5
  %61 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 8), align 8, !tbaa !5
  %62 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 4), align 4, !tbaa !9
  %63 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 4), align 4, !tbaa !9
  %64 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 32), i64 noundef %60, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 40), i64 noundef %61, i32 noundef %62, i32 noundef %63, ptr noundef nonnull %3)
  %.not24.1 = icmp eq i32 %64, 0
  br i1 %.not24.1, label %65, label %.critedge.sink.split

65:                                               ; preds = %.preheader.split.1
  %66 = zext i32 %63 to i64
  %bcmp.1 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 32), ptr nonnull %3, i64 %66)
  %.not25.1 = icmp eq i32 %bcmp.1, 0
  br i1 %.not25.1, label %.preheader.split.2, label %.critedge.sink.split

.preheader.split.2:                               ; preds = %65
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2)
  %69 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 16), align 16, !tbaa !5
  %70 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 16), align 16, !tbaa !5
  %71 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 8), align 8, !tbaa !9
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 8), align 8, !tbaa !9
  %73 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 64), i64 noundef %69, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 80), i64 noundef %70, i32 noundef %71, i32 noundef %72, ptr noundef nonnull %3)
  %.not24.2 = icmp eq i32 %73, 0
  br i1 %.not24.2, label %74, label %.critedge.sink.split

74:                                               ; preds = %.preheader.split.2
  %75 = zext i32 %72 to i64
  %bcmp.2 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 64), ptr nonnull %3, i64 %75)
  %.not25.2 = icmp eq i32 %bcmp.2, 0
  br i1 %.not25.2, label %.preheader.split.3, label %.critedge.sink.split

.preheader.split.3:                               ; preds = %74
  %76 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 3)
  %78 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 24), align 8, !tbaa !5
  %79 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 24), align 8, !tbaa !5
  %80 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 12), align 4, !tbaa !9
  %81 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 12), align 4, !tbaa !9
  %82 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 96), i64 noundef %78, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 120), i64 noundef %79, i32 noundef %80, i32 noundef %81, ptr noundef nonnull %3)
  %.not24.3 = icmp eq i32 %82, 0
  br i1 %.not24.3, label %83, label %.critedge.sink.split

83:                                               ; preds = %.preheader.split.3
  %84 = zext i32 %81 to i64
  %bcmp.3 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 96), ptr nonnull %3, i64 %84)
  %.not25.3 = icmp eq i32 %bcmp.3, 0
  br i1 %.not25.3, label %.preheader.split.4, label %.critedge.sink.split

.preheader.split.4:                               ; preds = %83
  %85 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 4)
  %87 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 32), align 16, !tbaa !5
  %88 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 32), align 16, !tbaa !5
  %89 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 16), align 16, !tbaa !9
  %90 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 16), align 16, !tbaa !9
  %91 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 128), i64 noundef %87, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 160), i64 noundef %88, i32 noundef %89, i32 noundef %90, ptr noundef nonnull %3)
  %.not24.4 = icmp eq i32 %91, 0
  br i1 %.not24.4, label %92, label %.critedge.sink.split

92:                                               ; preds = %.preheader.split.4
  %93 = zext i32 %90 to i64
  %bcmp.4 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 128), ptr nonnull %3, i64 %93)
  %.not25.4 = icmp eq i32 %bcmp.4, 0
  br i1 %.not25.4, label %.preheader.split.5, label %.critedge.sink.split

.preheader.split.5:                               ; preds = %92
  %94 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 5)
  %96 = load i64, ptr getelementptr inbounds (i8, ptr @plen_test_data, i64 40), align 8, !tbaa !5
  %97 = load i64, ptr getelementptr inbounds (i8, ptr @slen_test_data, i64 40), align 8, !tbaa !5
  %98 = load i32, ptr getelementptr inbounds (i8, ptr @it_cnt_test_data, i64 20), align 4, !tbaa !9
  %99 = load i32, ptr getelementptr inbounds (i8, ptr @key_len_test_data, i64 20), align 4, !tbaa !9
  %100 = call i32 @mbedtls_pkcs5_pbkdf2_hmac(ptr noundef nonnull %2, ptr noundef nonnull getelementptr inbounds (i8, ptr @password_test_data, i64 160), i64 noundef %96, ptr noundef nonnull getelementptr inbounds (i8, ptr @salt_test_data, i64 200), i64 noundef %97, i32 noundef %98, i32 noundef %99, ptr noundef nonnull %3)
  %.not24.5 = icmp eq i32 %100, 0
  br i1 %.not24.5, label %101, label %.critedge.sink.split

101:                                              ; preds = %.preheader.split.5
  %102 = zext i32 %99 to i64
  %bcmp.5 = call i32 @bcmp(ptr nonnull getelementptr inbounds (i8, ptr @result_key_test_data, i64 160), ptr nonnull %3, i64 %102)
  %.not25.5 = icmp eq i32 %bcmp.5, 0
  br i1 %.not25.5, label %103, label %.critedge.sink.split

103:                                              ; preds = %101
  %104 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3)
  br label %.critedge.sink.split

.critedge.sink.split:                             ; preds = %.preheader.split.preheader, %56, %.preheader.split.1, %65, %.preheader.split.2, %74, %.preheader.split.3, %83, %.preheader.split.4, %92, %.preheader.split.5, %101, %103
  %.str.2.sink = phi ptr [ @.str.4, %103 ], [ @.str.2, %101 ], [ @.str.2, %.preheader.split.5 ], [ @.str.2, %92 ], [ @.str.2, %.preheader.split.4 ], [ @.str.2, %83 ], [ @.str.2, %.preheader.split.3 ], [ @.str.2, %74 ], [ @.str.2, %.preheader.split.2 ], [ @.str.2, %65 ], [ @.str.2, %.preheader.split.1 ], [ @.str.2, %56 ], [ @.str.2, %.preheader.split.preheader ]
  %.1.ph = phi i32 [ 0, %103 ], [ 1, %101 ], [ 1, %.preheader.split.5 ], [ 1, %92 ], [ 1, %.preheader.split.4 ], [ 1, %83 ], [ 1, %.preheader.split.3 ], [ 1, %74 ], [ 1, %.preheader.split.2 ], [ 1, %65 ], [ 1, %.preheader.split.1 ], [ 1, %56 ], [ 1, %.preheader.split.preheader ]
  %105 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %.str.2.sink)
  br label %.critedge

.critedge:                                        ; preds = %54, %.critedge.sink.split, %19, %.preheader.split.us.preheader, %.preheader.split.us.1, %26, %.preheader.split.us.2, %33, %.preheader.split.us.3, %40, %.preheader.split.us.4, %47, %.preheader.split.us.5, %6, %1
  %.1 = phi i32 [ 1, %1 ], [ 1, %6 ], [ 1, %.preheader.split.us.5 ], [ 1, %47 ], [ 1, %.preheader.split.us.4 ], [ 1, %40 ], [ 1, %.preheader.split.us.3 ], [ 1, %33 ], [ 1, %.preheader.split.us.2 ], [ 1, %26 ], [ 1, %.preheader.split.us.1 ], [ 1, %.preheader.split.us.preheader ], [ 1, %19 ], [ %spec.select, %54 ], [ %.1.ph, %.critedge.sink.split ]
  call void @mbedtls_md_free(ptr noundef nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #5
  ret i32 %.1
}

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

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { 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 #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 = { nofree nounwind willreturn memory(argmem: read) }
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, !10, i64 0}
!10 = !{!"int", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,SROAPass,SimplifyCFGPass