; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/168 Division 1/Problem C/C.ll (Z12circumcenter5pointS_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 { x86_fp80, x86_fp80 }

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

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z12circumcenter5pointS_S_(ptr dead_on_unwind noalias writable sret(%struct.point) align 16 %0, ptr noundef byval(%struct.point) align 16 %1, ptr noundef byval(%struct.point) align 16 %2, ptr noundef byval(%struct.point) align 16 %3) #2 {
  %5 = alloca x86_fp80, align 16
  %6 = alloca x86_fp80, align 16
  %7 = alloca x86_fp80, align 16
  %8 = alloca x86_fp80, align 16
  %9 = alloca x86_fp80, align 16
  %10 = alloca x86_fp80, align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #3
  %11 = getelementptr inbounds %struct.point, ptr %2, i32 0, i32 0
  %12 = load x86_fp80, ptr %11, align 16, !tbaa !5
  %13 = getelementptr inbounds %struct.point, ptr %1, i32 0, i32 0
  %14 = load x86_fp80, ptr %13, align 16, !tbaa !5
  %15 = fsub x86_fp80 %12, %14
  store x86_fp80 %15, ptr %5, align 16, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #3
  %16 = getelementptr inbounds %struct.point, ptr %2, i32 0, i32 1
  %17 = load x86_fp80, ptr %16, align 16, !tbaa !11
  %18 = getelementptr inbounds %struct.point, ptr %1, i32 0, i32 1
  %19 = load x86_fp80, ptr %18, align 16, !tbaa !11
  %20 = fsub x86_fp80 %17, %19
  store x86_fp80 %20, ptr %6, align 16, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #3
  %21 = getelementptr inbounds %struct.point, ptr %3, i32 0, i32 0
  %22 = load x86_fp80, ptr %21, align 16, !tbaa !5
  %23 = getelementptr inbounds %struct.point, ptr %1, i32 0, i32 0
  %24 = load x86_fp80, ptr %23, align 16, !tbaa !5
  %25 = fsub x86_fp80 %22, %24
  store x86_fp80 %25, ptr %7, align 16, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #3
  %26 = getelementptr inbounds %struct.point, ptr %3, i32 0, i32 1
  %27 = load x86_fp80, ptr %26, align 16, !tbaa !11
  %28 = getelementptr inbounds %struct.point, ptr %1, i32 0, i32 1
  %29 = load x86_fp80, ptr %28, align 16, !tbaa !11
  %30 = fsub x86_fp80 %27, %29
  store x86_fp80 %30, ptr %8, align 16, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #3
  %31 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %32 = load x86_fp80, ptr %5, align 16, !tbaa !10
  %33 = load x86_fp80, ptr %5, align 16, !tbaa !10
  %34 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %35 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %36 = fmul x86_fp80 %34, %35
  %37 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %32, x86_fp80 %33, x86_fp80 %36)
  %38 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %39 = load x86_fp80, ptr %7, align 16, !tbaa !10
  %40 = load x86_fp80, ptr %7, align 16, !tbaa !10
  %41 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %42 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %43 = fmul x86_fp80 %41, %42
  %44 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %39, x86_fp80 %40, x86_fp80 %43)
  %45 = fmul x86_fp80 %38, %44
  %46 = fneg x86_fp80 %45
  %47 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %31, x86_fp80 %37, x86_fp80 %46)
  %48 = fdiv x86_fp80 %47, 0xK40008000000000000000
  %49 = load x86_fp80, ptr %5, align 16, !tbaa !10
  %50 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %51 = load x86_fp80, ptr %7, align 16, !tbaa !10
  %52 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %53 = fmul x86_fp80 %51, %52
  %54 = fneg x86_fp80 %53
  %55 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %49, x86_fp80 %50, x86_fp80 %54)
  %56 = fdiv x86_fp80 %48, %55
  store x86_fp80 %56, ptr %9, align 16, !tbaa !10
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #3
  %57 = load x86_fp80, ptr %7, align 16, !tbaa !10
  %58 = load x86_fp80, ptr %5, align 16, !tbaa !10
  %59 = load x86_fp80, ptr %5, align 16, !tbaa !10
  %60 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %61 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %62 = fmul x86_fp80 %60, %61
  %63 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %58, x86_fp80 %59, x86_fp80 %62)
  %64 = load x86_fp80, ptr %5, align 16, !tbaa !10
  %65 = load x86_fp80, ptr %7, align 16, !tbaa !10
  %66 = load x86_fp80, ptr %7, align 16, !tbaa !10
  %67 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %68 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %69 = fmul x86_fp80 %67, %68
  %70 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %65, x86_fp80 %66, x86_fp80 %69)
  %71 = fmul x86_fp80 %64, %70
  %72 = fneg x86_fp80 %71
  %73 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %57, x86_fp80 %63, x86_fp80 %72)
  %74 = fneg x86_fp80 %73
  %75 = fdiv x86_fp80 %74, 0xK40008000000000000000
  %76 = load x86_fp80, ptr %5, align 16, !tbaa !10
  %77 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %78 = load x86_fp80, ptr %7, align 16, !tbaa !10
  %79 = load x86_fp80, ptr %6, align 16, !tbaa !10
  %80 = fmul x86_fp80 %78, %79
  %81 = fneg x86_fp80 %80
  %82 = call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %76, x86_fp80 %77, x86_fp80 %81)
  %83 = fdiv x86_fp80 %75, %82
  store x86_fp80 %83, ptr %10, align 16, !tbaa !10
  %84 = getelementptr inbounds %struct.point, ptr %0, i32 0, i32 0
  %85 = getelementptr inbounds %struct.point, ptr %1, i32 0, i32 0
  %86 = load x86_fp80, ptr %85, align 16, !tbaa !5
  %87 = load x86_fp80, ptr %9, align 16, !tbaa !10
  %88 = fadd x86_fp80 %86, %87
  store x86_fp80 %88, ptr %84, align 16, !tbaa !5
  %89 = getelementptr inbounds %struct.point, ptr %0, i32 0, i32 1
  %90 = getelementptr inbounds %struct.point, ptr %1, i32 0, i32 1
  %91 = load x86_fp80, ptr %90, align 16, !tbaa !11
  %92 = load x86_fp80, ptr %10, align 16, !tbaa !10
  %93 = fadd x86_fp80 %91, %92
  store x86_fp80 %93, ptr %89, align 16, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #3
  ret void
}

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


; 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 { x86_fp80, x86_fp80 }

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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_Z12circumcenter5pointS_S_(ptr dead_on_unwind noalias nocapture writable writeonly sret(%struct.point) align 16 %0, ptr nocapture noundef readonly byval(%struct.point) align 16 %1, ptr nocapture noundef readonly byval(%struct.point) align 16 %2, ptr nocapture noundef readonly byval(%struct.point) align 16 %3) local_unnamed_addr #1 {
  %5 = load x86_fp80, ptr %2, align 16, !tbaa !5
  %6 = load x86_fp80, ptr %1, align 16, !tbaa !5
  %7 = fsub x86_fp80 %5, %6
  %8 = getelementptr inbounds i8, ptr %2, i64 16
  %9 = load x86_fp80, ptr %8, align 16, !tbaa !10
  %10 = getelementptr inbounds i8, ptr %1, i64 16
  %11 = load x86_fp80, ptr %10, align 16, !tbaa !10
  %12 = fsub x86_fp80 %9, %11
  %13 = load x86_fp80, ptr %3, align 16, !tbaa !5
  %14 = fsub x86_fp80 %13, %6
  %15 = getelementptr inbounds i8, ptr %3, i64 16
  %16 = load x86_fp80, ptr %15, align 16, !tbaa !10
  %17 = fsub x86_fp80 %16, %11
  %18 = fmul x86_fp80 %12, %12
  %19 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %7, x86_fp80 %7, x86_fp80 %18)
  %20 = fmul x86_fp80 %17, %17
  %21 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %14, x86_fp80 %14, x86_fp80 %20)
  %22 = fneg x86_fp80 %12
  %23 = fmul x86_fp80 %21, %22
  %24 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %17, x86_fp80 %19, x86_fp80 %23)
  %25 = fmul x86_fp80 %24, 0xK3FFE8000000000000000
  %26 = fneg x86_fp80 %14
  %27 = fmul x86_fp80 %12, %26
  %28 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %7, x86_fp80 %17, x86_fp80 %27)
  %29 = fdiv x86_fp80 %25, %28
  %30 = fneg x86_fp80 %7
  %31 = fmul x86_fp80 %21, %30
  %32 = tail call x86_fp80 @llvm.fmuladd.f80(x86_fp80 %14, x86_fp80 %19, x86_fp80 %31)
  %33 = fmul x86_fp80 %32, 0xK3FFE8000000000000000
  %34 = fdiv x86_fp80 %33, %28
  %35 = fadd x86_fp80 %6, %29
  store x86_fp80 %35, ptr %0, align 16, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  %37 = fsub x86_fp80 %11, %34
  store x86_fp80 %37, ptr %36, align 16, !tbaa !10
  ret void
}

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" }

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


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