; LLVM IR from jgaeddert/liquid-dsp :: src/framing/tests (dsssframe64_autotest)

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

@.str = external hidden unnamed_addr constant [95 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [62 x i8], align 1
@liquid_autotest_verbose = external global i32, align 4

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

declare ptr @dsssframe64gen_create(...) #1

declare i32 @dsssframe64gen_get_frame_len(ptr noundef) #1

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #2

declare i32 @dsssframe64gen_execute(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @liquid_autotest_passed(...) #1

declare i32 @dsssframe64gen_destroy(ptr noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

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

declare ptr @dsssframe64gen_copy(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_dsssframe64gen_copy() #4 {
  %1 = alloca ptr, align 8
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [8 x i8], align 1
  %7 = alloca [64 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #6
  %8 = call ptr (...) @dsssframe64gen_create()
  store ptr %8, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %9 = load ptr, ptr %1, align 8, !tbaa !5
  %10 = call ptr @dsssframe64gen_copy(ptr noundef %9)
  store ptr %10, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = call i32 @dsssframe64gen_get_frame_len(ptr noundef %11)
  store i32 %12, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %13 = load i32, ptr %3, align 4, !tbaa !9
  %14 = zext i32 %13 to i64
  %15 = mul i64 %14, 8
  %16 = call noalias ptr @malloc(i64 noundef %15) #7
  store ptr %16, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = zext i32 %17 to i64
  %19 = mul i64 %18, 8
  %20 = call noalias ptr @malloc(i64 noundef %19) #7
  store ptr %20, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 1 %6, i8 0, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 64, ptr %7) #6
  call void @llvm.memset.p0.i64(ptr align 16 %7, i8 0, i64 64, i1 false)
  %21 = load ptr, ptr %1, align 8, !tbaa !5
  %22 = getelementptr inbounds [8 x i8], ptr %6, i64 0, i64 0
  %23 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call i32 @dsssframe64gen_execute(ptr noundef %21, ptr noundef %22, ptr noundef %23, ptr noundef %24)
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds [8 x i8], ptr %6, i64 0, i64 0
  %28 = getelementptr inbounds [64 x i8], ptr %7, i64 0, i64 0
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = call i32 @dsssframe64gen_execute(ptr noundef %26, ptr noundef %27, ptr noundef %28, ptr noundef %29)
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = load i32, ptr %3, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = mul i64 %34, 8
  %36 = trunc i64 %35 to i32
  %37 = call i32 @liquid_autotest_same_data(ptr noundef %31, ptr noundef %32, i32 noundef %36)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %54, label %39

39:                                               ; preds = %0
  call void @liquid_autotest_failed_msg(ptr noundef @.str, i32 noundef 123, ptr noundef @.str.27)
  %40 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !9
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %53

42:                                               ; preds = %39
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  %44 = load i32, ptr %3, align 4, !tbaa !9
  %45 = zext i32 %44 to i64
  %46 = mul i64 %45, 8
  %47 = trunc i64 %46 to i32
  call void @liquid_autotest_print_array(ptr noundef %43, i32 noundef %47)
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = zext i32 %49 to i64
  %51 = mul i64 %50, 8
  %52 = trunc i64 %51 to i32
  call void @liquid_autotest_print_array(ptr noundef %48, i32 noundef %52)
  br label %53

53:                                               ; preds = %42, %39
  br label %55

54:                                               ; preds = %0
  call void (...) @liquid_autotest_passed()
  br label %55

55:                                               ; preds = %54, %53
  %56 = load ptr, ptr %1, align 8, !tbaa !5
  %57 = call i32 @dsssframe64gen_destroy(ptr noundef %56)
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = call i32 @dsssframe64gen_destroy(ptr noundef %58)
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  call void @free(ptr noundef %60) #6
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %61) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void
}

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

declare i32 @liquid_autotest_same_data(ptr noundef, ptr noundef, i32 noundef) #1

declare void @liquid_autotest_failed_msg(ptr noundef, i32 noundef, ptr noundef) #1

declare void @liquid_autotest_print_array(ptr noundef, i32 noundef) #1

attributes #0 = { 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 allocsize(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 = { 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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind allocsize(0) }

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


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

@.str = external hidden unnamed_addr constant [95 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [62 x i8], align 1
@liquid_autotest_verbose = external local_unnamed_addr global i32, align 4

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

declare ptr @dsssframe64gen_create(...) local_unnamed_addr #1

declare i32 @dsssframe64gen_get_frame_len(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

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

declare void @liquid_autotest_passed(...) local_unnamed_addr #1

declare i32 @dsssframe64gen_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

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

declare ptr @dsssframe64gen_copy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @autotest_dsssframe64gen_copy() local_unnamed_addr #4 {
  %1 = alloca [8 x i8], align 8
  %2 = alloca [64 x i8], align 16
  %3 = tail call ptr (...) @dsssframe64gen_create() #6
  %4 = tail call ptr @dsssframe64gen_copy(ptr noundef %3) #6
  %5 = tail call i32 @dsssframe64gen_get_frame_len(ptr noundef %3) #6
  %6 = zext i32 %5 to i64
  %7 = shl nuw nsw i64 %6, 3
  %8 = tail call noalias ptr @malloc(i64 noundef %7) #7
  %9 = tail call noalias ptr @malloc(i64 noundef %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  store i64 0, ptr %1, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(64) %2, i8 0, i64 64, i1 false)
  %10 = call i32 @dsssframe64gen_execute(ptr noundef %3, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef %8) #6
  %11 = call i32 @dsssframe64gen_execute(ptr noundef %4, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef %9) #6
  %12 = trunc i64 %7 to i32
  %13 = call i32 @liquid_autotest_same_data(ptr noundef %8, ptr noundef %9, i32 noundef %12) #6
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %17

14:                                               ; preds = %0
  call void @liquid_autotest_failed_msg(ptr noundef nonnull @.str, i32 noundef 123, ptr noundef nonnull @.str.27) #6
  %15 = load i32, ptr @liquid_autotest_verbose, align 4, !tbaa !5
  %.not18 = icmp eq i32 %15, 0
  br i1 %.not18, label %18, label %16

16:                                               ; preds = %14
  call void @liquid_autotest_print_array(ptr noundef %8, i32 noundef %12) #6
  call void @liquid_autotest_print_array(ptr noundef %9, i32 noundef %12) #6
  br label %18

17:                                               ; preds = %0
  call void (...) @liquid_autotest_passed() #6
  br label %18

18:                                               ; preds = %14, %16, %17
  %19 = call i32 @dsssframe64gen_destroy(ptr noundef %3) #6
  %20 = call i32 @dsssframe64gen_destroy(ptr noundef %4) #6
  call void @free(ptr noundef %8) #6
  call void @free(ptr noundef %9) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret void
}

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

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

declare void @liquid_autotest_failed_msg(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare void @liquid_autotest_print_array(ptr noundef, i32 noundef) local_unnamed_addr #1

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

!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"}


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