; LLVM IR from jgaeddert/liquid-dsp :: src/channel/tests (channel_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 [96 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_channel_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 @channel_cccf_create()
  store ptr %10, ptr %1, align 8, !tbaa !5
  %11 = load ptr, ptr %1, align 8, !tbaa !5
  %12 = call i32 @channel_cccf_add_awgn(ptr noundef %11, float noundef -1.000000e+02, float noundef 2.000000e+01)
  %13 = load ptr, ptr %1, align 8, !tbaa !5
  %14 = call i32 @channel_cccf_add_carrier_offset(ptr noundef %13, float noundef 0x3EE4F8B580000000, float noundef 0x3FF3333340000000)
  %15 = load ptr, ptr %1, align 8, !tbaa !5
  %16 = call i32 @channel_cccf_add_multipath(ptr noundef %15, ptr noundef null, i32 noundef 21)
  %17 = load ptr, ptr %1, align 8, !tbaa !5
  %18 = call i32 @channel_cccf_add_shadowing(ptr noundef %17, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000)
  %19 = load ptr, ptr %1, align 8, !tbaa !5
  %20 = call i32 @channel_cccf_print(ptr noundef %19)
  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 %21

21:                                               ; preds = %41, %0
  %22 = load i32, ptr %2, align 4, !tbaa !9
  %23 = icmp ult i32 %22, 120
  br i1 %23, label %24, label %44

24:                                               ; preds = %21
  %25 = call float (...) @randnf()
  %26 = call float (...) @randnf()
  %27 = fmul float 0.000000e+00, %26
  %28 = fmul float 1.000000e+00, %26
  %29 = fadd float %25, %27
  %30 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %31 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  store float %29, ptr %30, align 4
  store float %28, ptr %31, align 4
  %32 = load ptr, ptr %1, align 8, !tbaa !5
  %33 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %34 = load float, ptr %33, align 4
  %35 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %36 = load float, ptr %35, align 4
  %37 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 0
  %38 = getelementptr inbounds { float, float }, ptr %6, i32 0, i32 1
  store float %34, ptr %37, align 4
  store float %36, ptr %38, align 4
  %39 = load <2 x float>, ptr %6, align 4
  %40 = call i32 @channel_cccf_execute(ptr noundef %32, <2 x float> noundef %39, ptr noundef %4)
  br label %41

41:                                               ; preds = %24
  %42 = load i32, ptr %2, align 4, !tbaa !9
  %43 = add i32 %42, 1
  store i32 %43, ptr %2, align 4, !tbaa !9
  br label %21, !llvm.loop !11

44:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %45 = load ptr, ptr %1, align 8, !tbaa !5
  %46 = call ptr @channel_cccf_copy(ptr noundef %45)
  store ptr %46, ptr %7, align 8, !tbaa !5
  store i32 0, ptr %2, align 4, !tbaa !9
  br label %47

47:                                               ; preds = %96, %44
  %48 = load i32, ptr %2, align 4, !tbaa !9
  %49 = icmp ult i32 %48, 120
  br i1 %49, label %50, label %99

50:                                               ; preds = %47
  %51 = call float (...) @randnf()
  %52 = call float (...) @randnf()
  %53 = fmul float 0.000000e+00, %52
  %54 = fmul float 1.000000e+00, %52
  %55 = fadd float %51, %53
  %56 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %57 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  store float %55, ptr %56, align 4
  store float %54, ptr %57, align 4
  %58 = load ptr, ptr %1, align 8, !tbaa !5
  %59 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %60 = load float, ptr %59, align 4
  %61 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %62 = load float, ptr %61, align 4
  %63 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 0
  %64 = getelementptr inbounds { float, float }, ptr %8, i32 0, i32 1
  store float %60, ptr %63, align 4
  store float %62, ptr %64, align 4
  %65 = load <2 x float>, ptr %8, align 4
  %66 = call i32 @channel_cccf_execute(ptr noundef %58, <2 x float> noundef %65, ptr noundef %4)
  %67 = load ptr, ptr %7, align 8, !tbaa !5
  %68 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 0
  %69 = load float, ptr %68, align 4
  %70 = getelementptr inbounds { float, float }, ptr %3, i32 0, i32 1
  %71 = load float, ptr %70, align 4
  %72 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 0
  %73 = getelementptr inbounds { float, float }, ptr %9, i32 0, i32 1
  store float %69, ptr %72, align 4
  store float %71, ptr %73, align 4
  %74 = load <2 x float>, ptr %9, align 4
  %75 = call i32 @channel_cccf_execute(ptr noundef %67, <2 x float> noundef %74, ptr noundef %5)
  %76 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %77 = load float, ptr %76, align 4
  %78 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 1
  %79 = load float, ptr %78, align 4
  %80 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %81 = load float, ptr %80, align 4
  %82 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 1
  %83 = load float, ptr %82, align 4
  %84 = fcmp une float %77, %81
  %85 = fcmp une float %79, %83
  %86 = or i1 %84, %85
  br i1 %86, label %87, label %94

87:                                               ; preds = %50
  %88 = getelementptr inbounds { float, float }, ptr %4, i32 0, i32 0
  %89 = load float, ptr %88, align 4
  %90 = fpext float %89 to double
  %91 = getelementptr inbounds { float, float }, ptr %5, i32 0, i32 0
  %92 = load float, ptr %91, align 4
  %93 = fpext float %92 to double
  call void @liquid_autotest_failed_expr(ptr noundef @.str, i32 noundef 58, ptr noundef @.str.1, double noundef %90, ptr noundef @.str.2, ptr noundef @.str.3, double noundef %93)
  br label %95

94:                                               ; preds = %50
  call void (...) @liquid_autotest_passed()
  br label %95

95:                                               ; preds = %94, %87
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %2, align 4, !tbaa !9
  %98 = add i32 %97, 1
  store i32 %98, ptr %2, align 4, !tbaa !9
  br label %47, !llvm.loop !13

99:                                               ; preds = %47
  %100 = load ptr, ptr %1, align 8, !tbaa !5
  %101 = call i32 @channel_cccf_destroy(ptr noundef %100)
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = call i32 @channel_cccf_destroy(ptr noundef %102)
  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 @channel_cccf_create() #2

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

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

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

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

declare i32 @channel_cccf_print(ptr noundef) #2

declare float @randnf(...) #2

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

declare ptr @channel_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 @channel_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 [96 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_channel_copy() local_unnamed_addr #0 {
  %1 = alloca { float, float }, align 4
  %2 = alloca { float, float }, align 4
  %3 = tail call ptr @channel_cccf_create() #3
  %4 = tail call i32 @channel_cccf_add_awgn(ptr noundef %3, float noundef -1.000000e+02, float noundef 2.000000e+01) #3
  %5 = tail call i32 @channel_cccf_add_carrier_offset(ptr noundef %3, float noundef 0x3EE4F8B580000000, float noundef 0x3FF3333340000000) #3
  %6 = tail call i32 @channel_cccf_add_multipath(ptr noundef %3, ptr noundef null, i32 noundef 21) #3
  %7 = tail call i32 @channel_cccf_add_shadowing(ptr noundef %3, float noundef 1.000000e+00, float noundef 0x3FB99999A0000000) #3
  %8 = tail call i32 @channel_cccf_print(ptr noundef %3) #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 %9

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

16:                                               ; preds = %9
  %17 = call ptr @channel_cccf_copy(ptr noundef %3) #3
  %18 = getelementptr inbounds i8, ptr %1, i64 4
  %19 = getelementptr inbounds i8, ptr %2, i64 4
  br label %20

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

34:                                               ; preds = %20
  %35 = fpext float %27 to double
  %36 = fpext float %29 to double
  call void @liquid_autotest_failed_expr(ptr noundef nonnull @.str, i32 noundef 58, ptr noundef nonnull @.str.1, double noundef %35, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, double noundef %36) #3
  br label %38

37:                                               ; preds = %20
  call void (...) @liquid_autotest_passed() #3
  br label %38

38:                                               ; preds = %34, %37
  %39 = add nuw nsw i32 %.125, 1
  %exitcond26.not = icmp eq i32 %39, 120
  br i1 %exitcond26.not, label %40, label %20, !llvm.loop !7

40:                                               ; preds = %38
  %41 = call i32 @channel_cccf_destroy(ptr noundef %3) #3
  %42 = call i32 @channel_cccf_destroy(ptr noundef %17) #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 @channel_cccf_create() local_unnamed_addr #2

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

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

declare i32 @channel_cccf_add_multipath(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

declare i32 @channel_cccf_print(ptr noundef) local_unnamed_addr #2

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

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

declare ptr @channel_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 @channel_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