; LLVM IR from vectozavr/3dzavr :: engine/components/geometry/Triangle.ll (ZNK8Triangle13abgBarycCoordERK5Vec2D)

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

%class.Vec3D = type { %"struct.std::array.6" }
%"struct.std::array.6" = type { [3 x double] }
%class.Vec2D = type { %"struct.std::array.0" }
%"struct.std::array.0" = type { [2 x double] }
%class.Triangle = type { %"struct.std::array.3", %"struct.std::array.5", %class.Vec3D }
%"struct.std::array.3" = type { [3 x %class.Vec4D] }
%class.Vec4D = type { %"struct.std::array.4" }
%"struct.std::array.4" = type { [4 x double] }
%"struct.std::array.5" = type { [3 x %class.Vec3D] }

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8Triangle13abgBarycCoordERK5Vec2D(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8 %0, ptr noundef nonnull align 8 dereferenceable(192) %1, ptr noundef nonnull align 8 dereferenceable(16) %2) #3 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %class.Vec2D, align 8
  %8 = alloca %class.Vec2D, align 8
  %9 = alloca %class.Vec2D, align 8
  %10 = alloca %class.Vec2D, align 8
  %11 = alloca %class.Vec2D, align 8
  %12 = alloca %class.Vec2D, align 8
  %13 = alloca %class.Vec2D, align 8
  %14 = alloca %class.Vec2D, align 8
  %15 = alloca i8, align 1
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  %20 = getelementptr inbounds %class.Triangle, ptr %19, i32 0, i32 0
  %21 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %20, i64 noundef 1) #6
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(32) %21)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #6
  %22 = getelementptr inbounds %class.Triangle, ptr %19, i32 0, i32 0
  %23 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %22, i64 noundef 0) #6
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(32) %23)
  call void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind writable sret(%class.Vec2D) align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #6
  %24 = getelementptr inbounds %class.Triangle, ptr %19, i32 0, i32 0
  %25 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %24, i64 noundef 2) #6
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(32) %25)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  %26 = getelementptr inbounds %class.Triangle, ptr %19, i32 0, i32 0
  %27 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %26, i64 noundef 0) #6
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(32) %27)
  call void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind writable sret(%class.Vec2D) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %12)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #6
  %29 = getelementptr inbounds %class.Triangle, ptr %19, i32 0, i32 0
  %30 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %29, i64 noundef 0) #6
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(32) %30)
  call void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind writable sret(%class.Vec2D) align 8 %13, ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #6
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %32 = load double, ptr %31, align 8, !tbaa !9
  %33 = call noundef double @_ZSt3absd(double noundef %32)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = call noundef double @_ZSt3absd(double noundef %35)
  %37 = fcmp olt double %33, %36
  %38 = zext i1 %37 to i8
  store i8 %38, ptr %15, align 1, !tbaa !11
  %39 = load i8, ptr %15, align 1, !tbaa !11, !range !13, !noundef !14
  %40 = trunc i8 %39 to i1
  br i1 %40, label %41, label %42

41:                                               ; preds = %3
  call void @_ZSt4swapI5Vec2DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %10)
  br label %42

42:                                               ; preds = %41, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %50 = load double, ptr %49, align 8, !tbaa !9
  %51 = fmul double %48, %50
  %52 = fneg double %51
  %53 = call double @llvm.fmuladd.f64(double %44, double %46, double %52)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = fmul double %59, %61
  %63 = fneg double %62
  %64 = call double @llvm.fmuladd.f64(double %55, double %57, double %63)
  %65 = fdiv double %53, %64
  store double %65, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
  %67 = load double, ptr %66, align 8, !tbaa !9
  %68 = load double, ptr %16, align 8, !tbaa !9
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %70 = load double, ptr %69, align 8, !tbaa !9
  %71 = fneg double %68
  %72 = call double @llvm.fmuladd.f64(double %71, double %70, double %67)
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %74 = load double, ptr %73, align 8, !tbaa !9
  %75 = fdiv double %72, %74
  store double %75, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %76 = load double, ptr %16, align 8, !tbaa !9
  %77 = fsub double 1.000000e+00, %76
  %78 = load double, ptr %17, align 8, !tbaa !9
  %79 = fsub double %77, %78
  store double %79, ptr %18, align 8, !tbaa !9
  %80 = load i8, ptr %15, align 1, !tbaa !11, !range !13, !noundef !14
  %81 = trunc i8 %80 to i1
  br i1 %81, label %82, label %83

82:                                               ; preds = %42
  call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 8 dereferenceable(8) %17) #6
  br label %83

83:                                               ; preds = %82, %42
  %84 = load double, ptr %18, align 8, !tbaa !9
  %85 = load double, ptr %16, align 8, !tbaa !9
  %86 = load double, ptr %17, align 8, !tbaa !9
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %84, double noundef %85, double noundef %86)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #6
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind noalias writable sret(%class.Vec2D) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4swapI5Vec2DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16)) #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { 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 #4 = { inlinehint 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}


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

%class.Vec3D = type { %"struct.std::array.6" }
%"struct.std::array.6" = type { [3 x double] }
%class.Vec2D = type { %"struct.std::array.0" }
%"struct.std::array.0" = type { [2 x double] }

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK8Triangle13abgBarycCoordERK5Vec2D(ptr dead_on_unwind noalias writable sret(%class.Vec3D) align 8 %0, ptr noundef nonnull align 8 dereferenceable(192) %1, ptr noundef nonnull align 8 dereferenceable(16) %2) local_unnamed_addr #3 align 2 {
  %4 = alloca %class.Vec2D, align 8
  %5 = alloca %class.Vec2D, align 8
  %6 = alloca %class.Vec2D, align 8
  %7 = alloca %class.Vec2D, align 8
  %8 = alloca %class.Vec2D, align 8
  %9 = alloca %class.Vec2D, align 8
  %10 = alloca %class.Vec2D, align 8
  %11 = alloca %class.Vec2D, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  %14 = tail call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 1) #7
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(32) %14)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  %15 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 0) #7
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(32) %15)
  call void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vec2D) align 8 %4, ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  %16 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 2) #7
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(32) %16)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  %17 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 0) #7
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(32) %17)
  call void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vec2D) align 8 %7, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %18 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNKSt5arrayI5Vec4DLm3EEixEm(ptr noundef nonnull align 8 dereferenceable(96) %1, i64 noundef 0) #7
  call void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(32) %18)
  call void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vec2D) align 8 %10, ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  %19 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %20 = load double, ptr %19, align 8, !tbaa !5
  %21 = call noundef double @_ZSt3absd(double noundef %20)
  %22 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %23 = load double, ptr %22, align 8, !tbaa !5
  %24 = call noundef double @_ZSt3absd(double noundef %23)
  %25 = fcmp olt double %21, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %3
  call void @_ZSt4swapI5Vec2DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %7)
  br label %27

27:                                               ; preds = %26, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %29 = load double, ptr %28, align 8, !tbaa !5
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %33 = load double, ptr %32, align 8, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %35 = load double, ptr %34, align 8, !tbaa !5
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %37 = load double, ptr %36, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %39 = load double, ptr %38, align 8, !tbaa !5
  %40 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %41 = load double, ptr %40, align 8, !tbaa !5
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %43 = load double, ptr %42, align 8, !tbaa !5
  %44 = insertelement <2 x double> poison, double %33, i64 0
  %45 = insertelement <2 x double> %44, double %41, i64 1
  %46 = fneg <2 x double> %45
  %47 = insertelement <2 x double> poison, double %35, i64 0
  %48 = insertelement <2 x double> %47, double %43, i64 1
  %49 = fmul <2 x double> %48, %46
  %50 = insertelement <2 x double> poison, double %29, i64 0
  %51 = insertelement <2 x double> %50, double %37, i64 1
  %52 = insertelement <2 x double> poison, double %31, i64 0
  %53 = insertelement <2 x double> %52, double %39, i64 1
  %54 = call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %51, <2 x double> %53, <2 x double> %49)
  %55 = extractelement <2 x double> %54, i64 0
  %56 = extractelement <2 x double> %54, i64 1
  %57 = fdiv double %55, %56
  store double %57, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %59 = load double, ptr %58, align 8, !tbaa !5
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %4)
  %61 = load double, ptr %60, align 8, !tbaa !5
  %62 = fneg double %57
  %63 = call double @llvm.fmuladd.f64(double %62, double %61, double %59)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16) %7)
  %65 = load double, ptr %64, align 8, !tbaa !5
  %66 = fdiv double %63, %65
  store double %66, ptr %13, align 8, !tbaa !5
  br i1 %25, label %67, label %68

67:                                               ; preds = %27
  call void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %.pre = load double, ptr %12, align 8, !tbaa !5
  %.pre4 = load double, ptr %13, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %67, %27
  %69 = phi double [ %.pre4, %67 ], [ %66, %27 ]
  %70 = phi double [ %.pre, %67 ], [ %57, %27 ]
  %71 = fsub double 1.000000e+00, %57
  %72 = fsub double %71, %66
  call void @_ZN5Vec3DC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %0, double noundef %72, double noundef %70, double noundef %69)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Vec2DC2ERK5Vec4D(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK5Vec2DmiERKS_(ptr dead_on_unwind noalias writable sret(%class.Vec2D) align 8, ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1yEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4swapI5Vec2DENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS4_ESt18is_move_assignableIS4_EEE5valueEvE4typeERS4_SD_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNK5Vec2D1xEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIdENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

; 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>) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 = { 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 #4 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { 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, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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