; LLVM IR from lzyrapx/Competitive-Programming :: 51Nod/1265（计算几何）（四点共面）.ll (Z5xmult6point3S_)

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5xmult6point3S_(ptr dead_on_unwind noalias writable sret(%struct.point3) align 8 %0, ptr noundef byval(%struct.point3) align 8 %1, ptr noundef byval(%struct.point3) align 8 %2) #1 {
  %4 = getelementptr inbounds %struct.point3, ptr %1, i32 0, i32 1
  %5 = load double, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.point3, ptr %2, i32 0, i32 2
  %7 = load double, ptr %6, align 8, !tbaa !10
  %8 = getelementptr inbounds %struct.point3, ptr %2, i32 0, i32 1
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.point3, ptr %1, i32 0, i32 2
  %11 = load double, ptr %10, align 8, !tbaa !10
  %12 = fmul double %9, %11
  %13 = fneg double %12
  %14 = call double @llvm.fmuladd.f64(double %5, double %7, double %13)
  %15 = getelementptr inbounds %struct.point3, ptr %0, i32 0, i32 0
  store double %14, ptr %15, align 8, !tbaa !11
  %16 = getelementptr inbounds %struct.point3, ptr %1, i32 0, i32 2
  %17 = load double, ptr %16, align 8, !tbaa !10
  %18 = getelementptr inbounds %struct.point3, ptr %2, i32 0, i32 0
  %19 = load double, ptr %18, align 8, !tbaa !11
  %20 = getelementptr inbounds %struct.point3, ptr %1, i32 0, i32 0
  %21 = load double, ptr %20, align 8, !tbaa !11
  %22 = getelementptr inbounds %struct.point3, ptr %2, i32 0, i32 2
  %23 = load double, ptr %22, align 8, !tbaa !10
  %24 = fmul double %21, %23
  %25 = fneg double %24
  %26 = call double @llvm.fmuladd.f64(double %17, double %19, double %25)
  %27 = getelementptr inbounds %struct.point3, ptr %0, i32 0, i32 1
  store double %26, ptr %27, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.point3, ptr %1, i32 0, i32 0
  %29 = load double, ptr %28, align 8, !tbaa !11
  %30 = getelementptr inbounds %struct.point3, ptr %2, i32 0, i32 1
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.point3, ptr %1, i32 0, i32 1
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.point3, ptr %2, i32 0, i32 0
  %35 = load double, ptr %34, align 8, !tbaa !11
  %36 = fmul double %33, %35
  %37 = fneg double %36
  %38 = call double @llvm.fmuladd.f64(double %29, double %31, double %37)
  %39 = getelementptr inbounds %struct.point3, ptr %0, i32 0, i32 2
  store double %38, ptr %39, align 8, !tbaa !10
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress 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" }

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

%struct.point3 = type { double, double, double }

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_Z5xmult6point3S_(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.point3) align 8 %0, ptr nocapture noundef readonly byval(%struct.point3) align 8 %1, ptr nocapture noundef readonly byval(%struct.point3) align 8 %2) local_unnamed_addr #1 {
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = getelementptr inbounds i8, ptr %2, i64 16
  %6 = load double, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %2, i64 8
  %8 = load double, ptr %7, align 8, !tbaa !10
  %9 = load double, ptr %2, align 8, !tbaa !11
  %10 = load double, ptr %1, align 8, !tbaa !11
  %11 = load <2 x double>, ptr %4, align 8, !tbaa !12
  %12 = insertelement <2 x double> poison, double %8, i64 0
  %13 = insertelement <2 x double> %12, double %10, i64 1
  %14 = fneg <2 x double> %13
  %15 = shufflevector <2 x double> %11, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %16 = insertelement <2 x double> %15, double %6, i64 1
  %17 = fmul <2 x double> %16, %14
  %18 = insertelement <2 x double> poison, double %6, i64 0
  %19 = insertelement <2 x double> %18, double %9, i64 1
  %20 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %11, <2 x double> %19, <2 x double> %17)
  store <2 x double> %20, ptr %0, align 8, !tbaa !12
  %21 = extractelement <2 x double> %11, i64 0
  %22 = fneg double %21
  %23 = fmul double %9, %22
  %24 = tail call double @llvm.fmuladd.f64(double %10, double %8, double %23)
  %25 = getelementptr inbounds i8, ptr %0, i64 16
  store double %24, ptr %25, align 8, !tbaa !5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }

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


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