; LLVM IR from jgaeddert/liquid-dsp :: src/channel/tests (tvmpch_copy_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.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @xautotest_tvmpch_copy() #0 {
  %1 = alloca ptr, align 8
  %2 = alloca i32, align 4
  %3 = alloca { float, float }, align 4
  %4 = alloca { float, float }, align 4
  %5 = alloca { float, float }, align 4
  %6 = alloca { float, float }, align 4
  %7 = alloca ptr, align 8
  %8 = alloca { float, float }, align 4
  %9 = alloca { float, float }, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #3
  %10 = call ptr @tvmpch_cccf_create(i32 noundef 31, float noundef 0x3FB99999A0000000, float noundef 0x3FA99999A0000000)
  store ptr %10, ptr %1, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %31, %0
  %12 = load i32, ptr %2, align 4, !tbaa !9
  %13 = icmp ult i32 %12, 120
  br i1 %13, label %14, label %34

14:                                               ; preds = %11
  %15 = call float (...) @randnf()
  %16 = call float (...) @randnf()
  %17 = fmul float 0.000000e+00, %16
  %18 = fmul float 1.000000e+00, %16
  %19 = fadd float %15, %17
  %20 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %21 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  store float %19, ptr %20, align 4
  store float %18, ptr %21, align 4
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  %23 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %24 = load float, ptr %23, align 4
  %25 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %26 = load float, ptr %25, align 4
  %27 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %28 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 1
  store float %24, ptr %27, align 4
  store float %26, ptr %28, align 4
  %29 = load <2 x float>, ptr %6, align 4
  %30 = call i32 @tvmpch_cccf_execute_one(ptr noundef %22, <2 x float> noundef %29, ptr noundef %4)
  br label %31

31:                                               ; preds = %14
  %32 = load i32, ptr %2, align 4, !tbaa !9
  %33 = add i32 %32, 1
  store i32 %33, ptr %2, align 4, !tbaa !9
  br label %11, !llvm.loop !11

34:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %35 = load ptr, ptr %1, align 8, !tbaa !5
  %36 = call ptr @tvmpch_cccf_copy(ptr noundef %35)
  store ptr %36, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %86, %34
  %38 = load i32, ptr %2, align 4, !tbaa !9
  %39 = icmp ult i32 %38, 120
  br i1 %39, label %40, label %89

40:                                               ; preds = %37
  %41 = call float (...) @randnf()
  %42 = call float (...) @randnf()
  %43 = fmul float 0.000000e+00, %42
  %44 = fmul float 1.000000e+00, %42
  %45 = fadd float %41, %43
  %46 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %47 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  store float %45, ptr %46, align 4
  store float %44, ptr %47, align 4
  %48 = load ptr, ptr %1, align 8, !tbaa !5
  %49 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %50 = load float, ptr %49, align 4
  %51 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %52 = load float, ptr %51, align 4
  %53 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %54 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %50, ptr %53, align 4
  store float %52, ptr %54, align 4
  %55 = load <2 x float>, ptr %8, align 4
  %56 = call i32 @tvmpch_cccf_execute_one(ptr noundef %48, <2 x float> noundef %55, ptr noundef %4)
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %59 = load float, ptr %58, align 4
  %60 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %61 = load float, ptr %60, align 4
  %62 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %63 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  store float %59, ptr %62, align 4
  store float %61, ptr %63, align 4
  %64 = load <2 x float>, ptr %9, align 4
  %65 = call i32 @tvmpch_cccf_execute_one(ptr noundef %57, <2 x float> noundef %64, ptr noundef %5)
  %66 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %67 = load float, ptr %66, align 4
  %68 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %69 = load float, ptr %68, align 4
  %70 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %71 = load float, ptr %70, align 4
  %72 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %73 = load float, ptr %72, align 4
  %74 = fcmp une float %67, %71
  %75 = fcmp une float %69, %73
  %76 = or i1 %74, %75
  br i1 %76, label %77, label %84

77:                                               ; preds = %40
  %78 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %79 = load float, ptr %78, align 4
  %80 = fpext float %79 to double
  %81 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %82 = load float, ptr %81, align 4
  %83 = fpext float %82 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 53, ptr noundef @.str.1, double noundef %80, ptr noundef @.str.2, ptr noundef @.str.3, double noundef %83)
  br label %85

84:                                               ; preds = %40
  call void (...) @liquid_autotest_passed()
  br label %85

85:                                               ; preds = %84, %77
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %2, align 4, !tbaa !9
  %88 = add i32 %87, 1
  store i32 %88, ptr %2, align 4, !tbaa !9
  br label %37, !llvm.loop !13

89:                                               ; preds = %37
  %90 = load ptr, ptr %1, align 8, !tbaa !5
  %91 = call i32 @tvmpch_cccf_destroy(ptr noundef %90)
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = call i32 @tvmpch_cccf_destroy(ptr noundef %92)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #3
  ret void
}

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

declare ptr @tvmpch_cccf_create(i32 noundef, float noundef, float noundef) #2

declare float @randnf(...) #2

declare i32 @tvmpch_cccf_execute_one(ptr noundef, <2 x float> noundef, ptr noundef) #2

declare ptr @tvmpch_cccf_copy(ptr noundef) #2

declare void @liquid_autotest_failed_expr(ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, double noundef) #2

declare void @liquid_autotest_passed(...) #2

declare i32 @tvmpch_cccf_destroy(ptr noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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 }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @xautotest_tvmpch_copy() local_unnamed_addr #0 {
  %1 = alloca { float, float }, align 4
  %2 = alloca { float, float }, align 4
  %3 = tail call ptr @tvmpch_cccf_create(i32 noundef 31, float noundef 0x3FB99999A0000000, float noundef 0x3FA99999A0000000) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #3
  br label %4

4:                                                ; preds = %0, %4
  %.019 = phi i32 [ 0, %0 ], [ %10, %4 ]
  %5 = call float (...) @randnf() #3
  %6 = call float (...) @randnf() #3
  %7 = fmul float %6, 0.000000e+00
  %8 = fadd float %5, %7
  %.sroa.05.0.vec.insert = insertelement <2 x float> poison, float %8, i64 0
  %.sroa.05.4.vec.insert = insertelement <2 x float> %.sroa.05.0.vec.insert, float %6, i64 1
  %9 = call i32 @tvmpch_cccf_execute_one(ptr noundef %3, <2 x float> noundef %.sroa.05.4.vec.insert, ptr noundef nonnull %1) #3
  %10 = add nuw nsw i32 %.019, 1
  %exitcond.not = icmp eq i32 %10, 120
  br i1 %exitcond.not, label %11, label %4, !llvm.loop !5

11:                                               ; preds = %4
  %12 = call ptr @tvmpch_cccf_copy(ptr noundef %3) #3
  %13 = getelementptr inbounds i8, ptr %1, i64 4
  %14 = getelementptr inbounds i8, ptr %2, i64 4
  br label %15

15:                                               ; preds = %11, %33
  %.120 = phi i32 [ 0, %11 ], [ %34, %33 ]
  %16 = call float (...) @randnf() #3
  %17 = call float (...) @randnf() #3
  %18 = fmul float %17, 0.000000e+00
  %19 = fadd float %16, %18
  %.sroa.02.0.vec.insert = insertelement <2 x float> poison, float %19, i64 0
  %.sroa.02.4.vec.insert = insertelement <2 x float> %.sroa.02.0.vec.insert, float %17, i64 1
  %20 = call i32 @tvmpch_cccf_execute_one(ptr noundef %3, <2 x float> noundef %.sroa.02.4.vec.insert, ptr noundef nonnull %1) #3
  %21 = call i32 @tvmpch_cccf_execute_one(ptr noundef %12, <2 x float> noundef %.sroa.02.4.vec.insert, ptr noundef nonnull %2) #3
  %22 = load float, ptr %1, align 4
  %23 = load float, ptr %13, align 4
  %24 = load float, ptr %2, align 4
  %25 = load float, ptr %14, align 4
  %26 = fcmp une float %22, %24
  %27 = fcmp une float %23, %25
  %28 = or i1 %26, %27
  br i1 %28, label %29, label %32

29:                                               ; preds = %15
  %30 = fpext float %22 to double
  %31 = fpext float %24 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 53, ptr noundef nonnull @.str.1, double noundef %30, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, double noundef %31) #3
  br label %33

32:                                               ; preds = %15
  call void (...) @liquid_autotest_passed() #3
  br label %33

33:                                               ; preds = %29, %32
  %34 = add nuw nsw i32 %.120, 1
  %exitcond21.not = icmp eq i32 %34, 120
  br i1 %exitcond21.not, label %35, label %15, !llvm.loop !7

35:                                               ; preds = %33
  %36 = call i32 @tvmpch_cccf_destroy(ptr noundef %3) #3
  %37 = call i32 @tvmpch_cccf_destroy(ptr noundef %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #3
  ret void
}

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

declare ptr @tvmpch_cccf_create(i32 noundef, float noundef, float noundef) local_unnamed_addr #2

declare float @randnf(...) local_unnamed_addr #2

declare i32 @tvmpch_cccf_execute_one(ptr noundef, <2 x float> noundef, ptr noundef) local_unnamed_addr #2

declare ptr @tvmpch_cccf_copy(ptr noundef) local_unnamed_addr #2

declare void @liquid_autotest_failed_expr(ptr noundef, i32 noundef, ptr noundef, double noundef, ptr noundef, ptr noundef, double noundef) local_unnamed_addr #2

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

declare i32 @tvmpch_cccf_destroy(ptr noundef) local_unnamed_addr #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass