; LLVM IR from lzyrapx/Competitive-Programming :: ACdream/1094（几何+求外心）.ll (Z1I5PointS_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 } @_Z1I5PointS_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)
  store double %28, 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
  %29 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 0
  %30 = load double, ptr %29, align 8
  %31 = getelementptr inbounds { double, double }, ptr %14, i32 0, i32 1
  %32 = load double, ptr %31, align 8
  %33 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %10, double %30, double %32)
  store double %33, 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
  %34 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 0
  %35 = load double, ptr %34, align 8
  %36 = getelementptr inbounds { double, double }, ptr %16, i32 0, i32 1
  %37 = load double, ptr %36, align 8
  %38 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %8, double %35, double %37)
  store double %38, ptr %15, align 8, !tbaa !6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %39 = load double, ptr %11, align 8, !tbaa !6
  %40 = load double, ptr %13, align 8, !tbaa !6
  %41 = fadd double %39, %40
  %42 = load double, ptr %15, align 8, !tbaa !6
  %43 = fadd double %41, %42
  store double %43, ptr %17, align 8, !tbaa !6
  %44 = load double, ptr %11, align 8, !tbaa !6
  %45 = getelementptr inbounds %struct.Point, ptr %8, i32 0, i32 0
  %46 = load double, ptr %45, align 8, !tbaa !10
  %47 = load double, ptr %13, align 8, !tbaa !6
  %48 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 0
  %49 = load double, ptr %48, align 8, !tbaa !10
  %50 = fmul double %47, %49
  %51 = call double @llvm.fmuladd.f64(double %44, double %46, double %50)
  %52 = load double, ptr %15, align 8, !tbaa !6
  %53 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 0
  %54 = load double, ptr %53, align 8, !tbaa !10
  %55 = call double @llvm.fmuladd.f64(double %52, double %54, double %51)
  %56 = load double, ptr %17, align 8, !tbaa !6
  %57 = fdiv double %55, %56
  %58 = load double, ptr %11, align 8, !tbaa !6
  %59 = getelementptr inbounds %struct.Point, ptr %8, i32 0, i32 1
  %60 = load double, ptr %59, align 8, !tbaa !12
  %61 = load double, ptr %13, align 8, !tbaa !6
  %62 = getelementptr inbounds %struct.Point, ptr %9, i32 0, i32 1
  %63 = load double, ptr %62, align 8, !tbaa !12
  %64 = fmul double %61, %63
  %65 = call double @llvm.fmuladd.f64(double %58, double %60, double %64)
  %66 = load double, ptr %15, align 8, !tbaa !6
  %67 = getelementptr inbounds %struct.Point, ptr %10, i32 0, i32 1
  %68 = load double, ptr %67, align 8, !tbaa !12
  %69 = call double @llvm.fmuladd.f64(double %66, double %68, double %65)
  %70 = load double, ptr %17, align 8, !tbaa !6
  %71 = fdiv double %69, %70
  call void @_ZN5PointC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %57, double noundef %71)
  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
  %72 = load { double, double }, ptr %7, align 8
  ret { double, double } %72
}

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 } @_Z1I5PointS_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 = 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
  %16 = call noundef double @_ZN5Point3disES_(ptr noundef nonnull align 8 dereferenceable(16) %8, double %.sroa.0.0.copyload, double %.sroa.2.0.copyload)
  %17 = fadd double %14, %15
  %18 = fadd double %17, %16
  %19 = load double, ptr %8, align 8, !tbaa !9
  %20 = load double, ptr %9, align 8, !tbaa !9
  %21 = fmul double %15, %20
  %22 = call double @llvm.fmuladd.f64(double %14, double %19, double %21)
  %23 = load double, ptr %10, align 8, !tbaa !9
  %24 = call double @llvm.fmuladd.f64(double %16, double %23, double %22)
  %25 = fdiv double %24, %18
  %26 = load double, ptr %11, align 8, !tbaa !11
  %27 = load double, ptr %12, align 8, !tbaa !11
  %28 = fmul double %15, %27
  %29 = call double @llvm.fmuladd.f64(double %14, double %26, double %28)
  %30 = load double, ptr %13, align 8, !tbaa !11
  %31 = call double @llvm.fmuladd.f64(double %16, double %30, double %29)
  %32 = fdiv double %31, %18
  call void @_ZN5PointC2Edd(ptr noundef nonnull align 8 dereferenceable(16) %7, double noundef %25, double noundef %32)
  %.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