; LLVM IR from BigdogManLuo/DSPLibrary :: DSPTools/dq_32_Transformation (transform)

; 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.Phase3 = type { double, double, double }

; Function Attrs: nounwind uwtable
define dso_local void @linePhaseTransformation(ptr dead_on_unwind noalias writable sret(%struct.Phase3) align 8 %0, ptr noundef byval(%struct.Phase3) align 8 %1) #0 {
  %3 = alloca float, align 4
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  %6 = getelementptr inbounds %struct.Phase3, ptr %1, i32 0, i32 0
  %7 = load double, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.Phase3, ptr %1, i32 0, i32 2
  %9 = load double, ptr %8, align 8, !tbaa !10
  %10 = fsub double %7, %9
  %11 = fmul double %10, 3.333000e-01
  %12 = fptrunc double %11 to float
  store float %12, ptr %3, align 4, !tbaa !11
  %13 = getelementptr inbounds %struct.Phase3, ptr %1, i32 0, i32 1
  %14 = load double, ptr %13, align 8, !tbaa !13
  %15 = getelementptr inbounds %struct.Phase3, ptr %1, i32 0, i32 0
  %16 = load double, ptr %15, align 8, !tbaa !5
  %17 = fsub double %14, %16
  %18 = fmul double %17, 3.333000e-01
  %19 = fptrunc double %18 to float
  store float %19, ptr %4, align 4, !tbaa !11
  %20 = getelementptr inbounds %struct.Phase3, ptr %1, i32 0, i32 2
  %21 = load double, ptr %20, align 8, !tbaa !10
  %22 = getelementptr inbounds %struct.Phase3, ptr %1, i32 0, i32 1
  %23 = load double, ptr %22, align 8, !tbaa !13
  %24 = fsub double %21, %23
  %25 = fmul double %24, 3.333000e-01
  %26 = fptrunc double %25 to float
  store float %26, ptr %5, align 4, !tbaa !11
  %27 = load float, ptr %3, align 4, !tbaa !11
  %28 = fpext float %27 to double
  %29 = getelementptr inbounds %struct.Phase3, ptr %0, i32 0, i32 0
  store double %28, ptr %29, align 8, !tbaa !5
  %30 = load float, ptr %4, align 4, !tbaa !11
  %31 = fpext float %30 to double
  %32 = getelementptr inbounds %struct.Phase3, ptr %0, i32 0, i32 1
  store double %31, ptr %32, align 8, !tbaa !13
  %33 = load float, ptr %5, align 4, !tbaa !11
  %34 = fpext float %33 to double
  %35 = getelementptr inbounds %struct.Phase3, ptr %0, i32 0, i32 2
  store double %34, ptr %35, align 8, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

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

; 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"="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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !7, i64 0}
!6 = !{!"Phase3", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 16}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !8, i64 0}
!13 = !{!6, !7, i64 8}


; 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.Phase3 = type { double, double, double }

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @linePhaseTransformation(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.Phase3) align 8 %0, ptr nocapture noundef readonly byval(%struct.Phase3) align 8 %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 16
  %4 = load double, ptr %3, align 8, !tbaa !5
  %5 = load <2 x double>, ptr %1, align 8, !tbaa !10
  %6 = insertelement <2 x double> poison, double %4, i64 0
  %7 = shufflevector <2 x double> %6, <2 x double> %5, <2 x i32> <i32 0, i32 2>
  %8 = fsub <2 x double> %5, %7
  %9 = fmul <2 x double> %8, <double 3.333000e-01, double 3.333000e-01>
  %10 = fptrunc <2 x double> %9 to <2 x float>
  %11 = extractelement <2 x double> %5, i64 1
  %12 = fsub double %4, %11
  %13 = fmul double %12, 3.333000e-01
  %14 = fptrunc double %13 to float
  %15 = fpext <2 x float> %10 to <2 x double>
  store <2 x double> %15, ptr %0, align 8, !tbaa !10
  %16 = fpext float %14 to double
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  store double %16, ptr %17, align 8, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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" }

!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, !7, i64 16}
!6 = !{!"Phase3", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!7, !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass