; LLVM IR from jgaeddert/liquid-dsp :: src/framing/tests (framesync64_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"

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

declare float @randnf(...) #1

; 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 void @framesync64_channel(ptr noundef %0, float noundef %1, float noundef %2, float noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca i32, align 4
  %13 = alloca { double, double }, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !9
  store float %2, ptr %7, align 4, !tbaa !9
  store float %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %14 = load float, ptr %6, align 4, !tbaa !9
  %15 = fdiv float %14, 2.000000e+01
  %16 = call float @powf(float noundef 1.000000e+01, float noundef %15) #5
  store float %16, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %17 = load float, ptr %6, align 4, !tbaa !9
  %18 = load float, ptr %7, align 4, !tbaa !9
  %19 = fsub float %17, %18
  %20 = call float @log10f(float noundef 2.000000e+00) #5
  %21 = call float @llvm.fmuladd.f32(float 1.000000e+01, float %20, float %19)
  store float %21, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %22 = load float, ptr %10, align 4, !tbaa !9
  %23 = fdiv float %22, 2.000000e+01
  %24 = call float @powf(float noundef 1.000000e+01, float noundef %23) #5
  store float %24, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %25

25:                                               ; preds = %99, %4
  %26 = load i32, ptr %12, align 4, !tbaa !11
  %27 = icmp ult i32 %26, 1440
  br i1 %27, label %28, label %102

28:                                               ; preds = %25
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = load i32, ptr %12, align 4, !tbaa !11
  %31 = zext i32 %30 to i64
  %32 = getelementptr inbounds { float, float }, ptr %29, i64 %31
  %33 = getelementptr inbounds { float, float }, ptr %32, i32 0, i32 0
  %34 = load float, ptr %33, align 4
  %35 = getelementptr inbounds { float, float }, ptr %32, i32 0, i32 1
  %36 = load float, ptr %35, align 4
  %37 = fpext float %34 to double
  %38 = fpext float %36 to double
  %39 = load float, ptr %8, align 4, !tbaa !9
  %40 = fmul float 0.000000e+00, %39
  %41 = fmul float 1.000000e+00, %39
  %42 = load i32, ptr %12, align 4, !tbaa !11
  %43 = uitofp i32 %42 to float
  %44 = fmul float %40, %43
  %45 = fmul float %41, %43
  %46 = fpext float %44 to double
  %47 = fpext float %45 to double
  %48 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %49 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  store double %46, ptr %48, align 8
  store double %47, ptr %49, align 8
  %50 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 0
  %51 = load double, ptr %50, align 8
  %52 = getelementptr inbounds { double, double }, ptr %13, i32 0, i32 1
  %53 = load double, ptr %52, align 8
  %54 = call { double, double } @cexp(double noundef %51, double noundef %53) #5
  %55 = extractvalue { double, double } %54, 0
  %56 = extractvalue { double, double } %54, 1
  %57 = fmul double %37, %55
  %58 = fmul double %38, %56
  %59 = fmul double %37, %56
  %60 = fmul double %38, %55
  %61 = fsub double %57, %58
  %62 = fadd double %59, %60
  %63 = fcmp uno double %61, %61
  br i1 %63, label %64, label %70, !prof !13

64:                                               ; preds = %28
  %65 = fcmp uno double %62, %62
  br i1 %65, label %66, label %70, !prof !13

66:                                               ; preds = %64
  %67 = call { double, double } @__muldc3(double noundef %37, double noundef %38, double noundef %55, double noundef %56) #5
  %68 = extractvalue { double, double } %67, 0
  %69 = extractvalue { double, double } %67, 1
  br label %70

70:                                               ; preds = %66, %64, %28
  %71 = phi double [ %61, %28 ], [ %61, %64 ], [ %68, %66 ]
  %72 = phi double [ %62, %28 ], [ %62, %64 ], [ %69, %66 ]
  %73 = load float, ptr %9, align 4, !tbaa !9
  %74 = fpext float %73 to double
  %75 = fmul double %71, %74
  %76 = fmul double %72, %74
  %77 = load float, ptr %11, align 4, !tbaa !9
  %78 = call float (...) @randnf()
  %79 = call float (...) @randnf()
  %80 = fmul float 0.000000e+00, %79
  %81 = fmul float 1.000000e+00, %79
  %82 = fadd float %78, %80
  %83 = fmul float %77, %82
  %84 = fmul float %77, %81
  %85 = fpext float %83 to double
  %86 = fpext float %84 to double
  %87 = fmul double %85, 0x3FE6A09E667F3BCD
  %88 = fmul double %86, 0x3FE6A09E667F3BCD
  %89 = fadd double %75, %87
  %90 = fadd double %76, %88
  %91 = fptrunc double %89 to float
  %92 = fptrunc double %90 to float
  %93 = load ptr, ptr %5, align 8, !tbaa !5
  %94 = load i32, ptr %12, align 4, !tbaa !11
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds { float, float }, ptr %93, i64 %95
  %97 = getelementptr inbounds { float, float }, ptr %96, i32 0, i32 0
  %98 = getelementptr inbounds { float, float }, ptr %96, i32 0, i32 1
  store float %91, ptr %97, align 4
  store float %92, ptr %98, align 4
  br label %99

99:                                               ; preds = %70
  %100 = load i32, ptr %12, align 4, !tbaa !11
  %101 = add i32 %100, 1
  store i32 %101, ptr %12, align 4, !tbaa !11
  br label %25, !llvm.loop !14

102:                                              ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

; Function Attrs: nounwind
declare float @powf(float noundef, float noundef) #3

; Function Attrs: nounwind
declare float @log10f(float noundef) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #4

; Function Attrs: nounwind
declare { double, double } @cexp(double noundef, double noundef) #3

declare { double, double } @__muldc3(double, double, double, double)

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 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 = { 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 nosync nounwind speculatable willreturn memory(none) }
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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"branch_weights", i32 1, i32 1048575}
!14 = distinct !{!14, !15}
!15 = !{!"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"

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

; Function Attrs: nounwind uwtable
define dso_local void @framesync64_channel(ptr nocapture noundef %0, float noundef %1, float noundef %2, float noundef %3) local_unnamed_addr #1 {
  %5 = fdiv float %1, 2.000000e+01
  %6 = tail call float @powf(float noundef 1.000000e+01, float noundef %5) #4
  %7 = fsub float %1, %2
  %8 = fadd float %7, 0x4008151840000000
  %9 = fdiv float %8, 2.000000e+01
  %10 = tail call float @powf(float noundef 1.000000e+01, float noundef %9) #4
  %11 = fmul float %3, 0.000000e+00
  %12 = fpext float %6 to double
  %13 = insertelement <2 x double> poison, double %12, i64 0
  %14 = shufflevector <2 x double> %13, <2 x double> poison, <2 x i32> zeroinitializer
  %15 = insertelement <2 x float> poison, float %10, i64 0
  %16 = shufflevector <2 x float> %15, <2 x float> poison, <2 x i32> zeroinitializer
  br label %17

17:                                               ; preds = %4, %56
  %indvars.iv = phi i64 [ 0, %4 ], [ %indvars.iv.next, %56 ]
  %18 = getelementptr inbounds { float, float }, ptr %0, i64 %indvars.iv
  %19 = load float, ptr %18, align 4
  %20 = getelementptr inbounds i8, ptr %18, i64 4
  %21 = load float, ptr %20, align 4
  %22 = fpext float %19 to double
  %23 = fpext float %21 to double
  %24 = trunc nuw nsw i64 %indvars.iv to i32
  %25 = uitofp nneg i32 %24 to float
  %26 = fmul float %11, %25
  %27 = fmul float %25, %3
  %28 = fpext float %26 to double
  %29 = fpext float %27 to double
  %30 = tail call { double, double } @cexp(double noundef %28, double noundef %29) #4
  %31 = extractvalue { double, double } %30, 0
  %32 = extractvalue { double, double } %30, 1
  %33 = insertelement <2 x double> poison, double %31, i64 0
  %34 = insertelement <2 x double> %33, double %32, i64 1
  %35 = insertelement <2 x double> poison, double %22, i64 0
  %36 = shufflevector <2 x double> %35, <2 x double> poison, <2 x i32> zeroinitializer
  %37 = fmul <2 x double> %34, %36
  %38 = insertelement <2 x double> poison, double %23, i64 0
  %39 = shufflevector <2 x double> %38, <2 x double> poison, <2 x i32> zeroinitializer
  %40 = fmul <2 x double> %34, %39
  %41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> <i32 1, i32 0>
  %42 = fsub <2 x double> %37, %41
  %43 = fadd <2 x double> %37, %41
  %44 = shufflevector <2 x double> %42, <2 x double> %43, <2 x i32> <i32 0, i32 3>
  %45 = extractelement <2 x double> %42, i64 0
  %46 = fcmp uno double %45, 0.000000e+00
  br i1 %46, label %47, label %56, !prof !5

47:                                               ; preds = %17
  %48 = extractelement <2 x double> %43, i64 1
  %49 = fcmp uno double %48, 0.000000e+00
  br i1 %49, label %50, label %56, !prof !5

50:                                               ; preds = %47
  %51 = tail call { double, double } @__muldc3(double noundef %22, double noundef %23, double noundef %31, double noundef %32) #4
  %52 = extractvalue { double, double } %51, 0
  %53 = extractvalue { double, double } %51, 1
  %54 = insertelement <2 x double> poison, double %52, i64 0
  %55 = insertelement <2 x double> %54, double %53, i64 1
  br label %56

56:                                               ; preds = %50, %47, %17
  %57 = phi <2 x double> [ %44, %17 ], [ %44, %47 ], [ %55, %50 ]
  %58 = fmul <2 x double> %57, %14
  %59 = tail call float (...) @randnf() #4
  %60 = tail call float (...) @randnf() #4
  %61 = fmul float %60, 0.000000e+00
  %62 = fadd float %59, %61
  %63 = insertelement <2 x float> poison, float %62, i64 0
  %64 = insertelement <2 x float> %63, float %60, i64 1
  %65 = fmul <2 x float> %16, %64
  %66 = fpext <2 x float> %65 to <2 x double>
  %67 = fmul <2 x double> %66, <double 0x3FE6A09E667F3BCD, double 0x3FE6A09E667F3BCD>
  %68 = fadd <2 x double> %58, %67
  %69 = fptrunc <2 x double> %68 to <2 x float>
  store <2 x float> %69, ptr %18, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 1440
  br i1 %exitcond.not, label %70, label %17, !llvm.loop !6

70:                                               ; preds = %56
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @powf(float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: nounwind
declare { double, double } @cexp(double noundef, double noundef) local_unnamed_addr #3

declare { double, double } @__muldc3(double, double, double, double) local_unnamed_addr

attributes #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 = { 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 #2 = { mustprogress nofree nounwind willreturn memory(write) "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 }

!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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}


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