; LLVM IR from hadryansalles/Luz :: deps/imgui/ImGuizmo.ll (ZN8ImGuizmo5CrossERKNS_5vec_tES2_)

; 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.ImGuizmo::vec_t" = type { float, float, float, float }

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local { <2 x float>, <2 x float> } @_ZN8ImGuizmo5CrossERKNS_5vec_tES2_(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) %1) #1 {
  %3 = alloca %"struct.ImGuizmo::vec_t", align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %6, i32 0, i32 1
  %8 = load float, ptr %7, align 4, !tbaa !9
  %9 = load ptr, ptr %5, align 8, !tbaa !5
  %10 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %9, i32 0, i32 2
  %11 = load float, ptr %10, align 4, !tbaa !12
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  %13 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %12, i32 0, i32 2
  %14 = load float, ptr %13, align 4, !tbaa !12
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %15, i32 0, i32 1
  %17 = load float, ptr %16, align 4, !tbaa !9
  %18 = fmul float %14, %17
  %19 = fneg float %18
  %20 = call float @llvm.fmuladd.f32(float %8, float %11, float %19)
  %21 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %3, i32 0, i32 0
  store float %20, ptr %21, align 4, !tbaa !13
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %22, i32 0, i32 2
  %24 = load float, ptr %23, align 4, !tbaa !12
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %25, i32 0, i32 0
  %27 = load float, ptr %26, align 4, !tbaa !13
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %28, i32 0, i32 0
  %30 = load float, ptr %29, align 4, !tbaa !13
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %31, i32 0, i32 2
  %33 = load float, ptr %32, align 4, !tbaa !12
  %34 = fmul float %30, %33
  %35 = fneg float %34
  %36 = call float @llvm.fmuladd.f32(float %24, float %27, float %35)
  %37 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %3, i32 0, i32 1
  store float %36, ptr %37, align 4, !tbaa !9
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %38, i32 0, i32 0
  %40 = load float, ptr %39, align 4, !tbaa !13
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %41, i32 0, i32 1
  %43 = load float, ptr %42, align 4, !tbaa !9
  %44 = load ptr, ptr %4, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %44, i32 0, i32 1
  %46 = load float, ptr %45, align 4, !tbaa !9
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %47, i32 0, i32 0
  %49 = load float, ptr %48, align 4, !tbaa !13
  %50 = fmul float %46, %49
  %51 = fneg float %50
  %52 = call float @llvm.fmuladd.f32(float %40, float %43, float %51)
  %53 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %3, i32 0, i32 2
  store float %52, ptr %53, align 4, !tbaa !12
  %54 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %3, i32 0, i32 3
  store float 0.000000e+00, ptr %54, align 4, !tbaa !14
  %55 = load { <2 x float>, <2 x float> }, ptr %3, align 4
  ret { <2 x float>, <2 x float> } %55
}

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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 4}
!10 = !{!"_ZTSN8ImGuizmo5vec_tE", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!11 = !{!"float", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !11, i64 0}
!14 = !{!10, !11, i64 12}


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

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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local { <2 x float>, <2 x float> } @_ZN8ImGuizmo5CrossERKNS_5vec_tES2_(ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load float, ptr %3, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load float, ptr %5, align 4, !tbaa !5
  %7 = fneg float %6
  %8 = load <2 x float>, ptr %1, align 4, !tbaa !10
  %9 = extractelement <2 x float> %8, i64 1
  %10 = fmul float %9, %7
  %11 = load <2 x float>, ptr %0, align 4, !tbaa !10
  %12 = extractelement <2 x float> %11, i64 1
  %13 = tail call float @llvm.fmuladd.f32(float %12, float %4, float %10)
  %.sroa.0.0.vec.insert = insertelement <2 x float> poison, float %13, i64 0
  %14 = fneg <2 x float> %11
  %15 = insertelement <2 x float> poison, float %4, i64 0
  %16 = shufflevector <2 x float> %15, <2 x float> %8, <2 x i32> <i32 0, i32 2>
  %17 = fmul <2 x float> %16, %14
  %18 = insertelement <2 x float> poison, float %6, i64 0
  %19 = shufflevector <2 x float> %18, <2 x float> %11, <2 x i32> <i32 0, i32 2>
  %20 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %19, <2 x float> %8, <2 x float> %17)
  %21 = shufflevector <2 x float> %.sroa.0.0.vec.insert, <2 x float> %20, <2 x i32> <i32 0, i32 2>
  %22 = shufflevector <2 x float> <float poison, float 0.000000e+00>, <2 x float> %20, <2 x i32> <i32 3, i32 1>
  %.fca.0.insert = insertvalue { <2 x float>, <2 x float> } poison, <2 x float> %21, 0
  %.fca.1.insert = insertvalue { <2 x float>, <2 x float> } %.fca.0.insert, <2 x float> %22, 1
  ret { <2 x float>, <2 x float> } %.fca.1.insert
}

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

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


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