; LLVM IR from lzyrapx/Competitive-Programming :: ACdream/1094（几何+求外心）.ll (Z2Ia5PointS_S_)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5PointC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 align 2

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16), double, double) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local { double, double } @_Z2Ia5PointS_S_(double %0, double %1, double %2, double %3, double %4, double %5) #4 {
  %7 = alloca %struct.Point, align 8
  %8 = alloca %struct.Point, align 8
  %9 = alloca %struct.Point, align 8
  %10 = alloca %struct.Point, align 8
  %11 = alloca double, align 8
  %12 = alloca %struct.Point, align 8
  %13 = alloca double, align 8
  %14 = alloca %struct.Point, align 8
  %15 = alloca double, align 8
  %16 = alloca %struct.Point, align 8
  %17 = alloca double, align 8
  %18 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 0
  store double %0, ptr %18, align 8
  %19 = getelementptr inbounds { double, double }, ptr %8, i32 0, i32 1
  store double %1, ptr %19, align 8
  %20 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 0
  store double %2, ptr %20, align 8
  %21 = getelementptr inbounds { double, double }, ptr %9, i32 0, i32 1
  store double %3, ptr %21, align 8
  %22 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 0
  store double %4, ptr %22, align 8
  %23 = getelementptr inbounds { double, double }, ptr %10, i32 0, i32 1
  store double %5, ptr %23, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %12, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !5
  %24 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 0
  %25 = load double, ptr %24, align 8
  %26 = getelementptr inbounds { double, double }, ptr %12, i32 0, i32 1
  %27 = load double, ptr %26, align 8
  %28 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %9, double %25, double %27)
  %29 = fneg double %28
  store double %29, ptr %11, align 8, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %14, ptr align 8 %8, i64 16, i1 false), !tbaa.struct !5
  %30 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %31 = load double, ptr %30, align 8
  %32 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %33 = load double, ptr %32, align 8
  %34 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %10, double %31, double %33)
  store double %34, ptr %13, align 8, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %16, ptr align 8 %9, i64 16, i1 false), !tbaa.struct !5
  %35 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %36 = load double, ptr %35, align 8
  %37 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %38 = load double, ptr %37, align 8
  %39 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %8, double %36, double %38)
  store double %39, ptr %15, align 8, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %40 = load double, ptr %11, align 8, !tbaa !6
  %41 = load double, ptr %13, align 8, !tbaa !6
  %42 = fadd double %40, %41
  %43 = load double, ptr %15, align 8, !tbaa !6
  %44 = fadd double %42, %43
  store double %44, ptr %17, align 8, !tbaa !6
  %45 = load double, ptr %11, align 8, !tbaa !6
  %46 = getelementptr inbounds %struct.Point, ptr %8, i32 0, i32 0
  %47 = load double, ptr %46, align 8, !tbaa !10
  %48 = load double, ptr %13, align 8, !tbaa !6
  %49 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 0
  %50 = load double, ptr %49, align 8, !tbaa !10
  %51 = fmul double %48, %50
  %52 = call double @llvm.fmuladd.f64(double %45, double %47, double %51)
  %53 = load double, ptr %15, align 8, !tbaa !6
  %54 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 0
  %55 = load double, ptr %54, align 8, !tbaa !10
  %56 = call double @llvm.fmuladd.f64(double %53, double %55, double %52)
  %57 = load double, ptr %17, align 8, !tbaa !6
  %58 = fdiv double %56, %57
  %59 = load double, ptr %11, align 8, !tbaa !6
  %60 = getelementptr inbounds %struct.Point, ptr %8, i32 0, i32 1
  %61 = load double, ptr %60, align 8, !tbaa !12
  %62 = load double, ptr %13, align 8, !tbaa !6
  %63 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 1
  %64 = load double, ptr %63, align 8, !tbaa !12
  %65 = fmul double %62, %64
  %66 = call double @llvm.fmuladd.f64(double %59, double %61, double %65)
  %67 = load double, ptr %15, align 8, !tbaa !6
  %68 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 1
  %69 = load double, ptr %68, align 8, !tbaa !12
  %70 = call double @llvm.fmuladd.f64(double %67, double %69, double %66)
  %71 = load double, ptr %17, align 8, !tbaa !6
  %72 = fdiv double %70, %71
  call void @_ZN5PointC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %58, double noundef %72)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %73 = load { double, double }, ptr %7, align 8
  ret { double, double } %73
}

attributes #0 = { 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" }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress 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 #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 = !{i64 0, i64 8, !6, i64 8, i64 8, !6}
!6 = !{!7, !7, i64 0}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 0}
!11 = !{!"_ZTS5Point", !7, i64 0, !7, i64 8}
!12 = !{!11, !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.Point = type { double, double }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5PointC2Edd(ptr noundef nonnull align 8 dereferenceable(16), double noundef, double noundef) unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16), double, double) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local { double, double } @_Z2Ia5PointS_S_(double %0, double %1, double %2, double %3, double %4, double %5) local_unnamed_addr #0 {
  %7 = alloca %struct.Point, align 8
  %8 = alloca %struct.Point, align 8
  %9 = alloca %struct.Point, align 8
  %10 = alloca %struct.Point, align 8
  store double %0, ptr %8, align 8
  %11 = getelementptr inbounds i8, ptr %8, i64 8
  store double %1, ptr %11, align 8
  store double %2, ptr %9, align 8
  %12 = getelementptr inbounds i8, ptr %9, i64 8
  store double %3, ptr %12, align 8
  store double %4, ptr %10, align 8
  %13 = getelementptr inbounds i8, ptr %10, i64 8
  store double %5, ptr %13, align 8
  %14 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %9, double %4, double %5)
  %15 = fneg double %14
  %16 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %10, double %0, double %1)
  %.sroa.0.0.copyload = load double, ptr %9, align 8, !tbaa !5
  %.sroa.2.0.copyload = load double, ptr %12, align 8, !tbaa !5
  %17 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %8, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %18 = fsub double %16, %14
  %19 = fadd double %18, %17
  %20 = load double, ptr %8, align 8, !tbaa !9
  %21 = load double, ptr %9, align 8, !tbaa !9
  %22 = fmul double %16, %21
  %23 = call double @llvm.fmuladd.f64(double %15, double %20, double %22)
  %24 = load double, ptr %10, align 8, !tbaa !9
  %25 = call double @llvm.fmuladd.f64(double %17, double %24, double %23)
  %26 = fdiv double %25, %19
  %27 = load double, ptr %11, align 8, !tbaa !11
  %28 = load double, ptr %12, align 8, !tbaa !11
  %29 = fmul double %16, %28
  %30 = call double @llvm.fmuladd.f64(double %15, double %27, double %29)
  %31 = load double, ptr %13, align 8, !tbaa !11
  %32 = call double @llvm.fmuladd.f64(double %17, double %31, double %30)
  %33 = fdiv double %32, %19
  call void @_ZN5PointC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %26, double noundef %33)
  %.fca.0.load = load double, ptr %7, align 8
  %.fca.0.insert = insertvalue { double, double } poison, double %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %7, i64 8
  %.fca.1.load = load double, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { double, double } %.fca.0.insert, double %.fca.1.load, 1
  ret { double, double } %.fca.1.insert
}

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


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