; LLVM IR from paroj/gltut :: Tut 08 Getting Oriented/Interpolation.ll (Z9VectorizeN3glm6detail5tquatIfEE)

; 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.glm::detail::tvec4" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float, float }
%"struct.glm::detail::tquat" = type { float, float, float, float }
%struct.anon.1 = type { float, float, float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4 %0, <2 x float> %1, <2 x float> %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.glm::detail::tquat", align 4
  store ptr %0, ptr %4, align 8
  %6 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 0
  store <2 x float> %1, ptr %6, align 4
  %7 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %5, i32 0, i32 1
  store <2 x float> %2, ptr %7, align 4
  call void @_ZN3glm6detail5tvec4IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %0)
  %8 = getelementptr inbounds %"struct.glm::detail::tquat", ptr %5, i32 0, i32 0
  %9 = load float, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %0, i32 0, i32 0
  %11 = getelementptr inbounds %struct.anon.1, ptr %10, i32 0, i32 0
  store float %9, ptr %11, align 4, !tbaa !10
  %12 = getelementptr inbounds %"struct.glm::detail::tquat", ptr %5, i32 0, i32 1
  %13 = load float, ptr %12, align 4, !tbaa !11
  %14 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %0, i32 0, i32 0
  %15 = getelementptr inbounds %struct.anon.1, ptr %14, i32 0, i32 1
  store float %13, ptr %15, align 4, !tbaa !10
  %16 = getelementptr inbounds %"struct.glm::detail::tquat", ptr %5, i32 0, i32 2
  %17 = load float, ptr %16, align 4, !tbaa !12
  %18 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %0, i32 0, i32 0
  %19 = getelementptr inbounds %struct.anon.1, ptr %18, i32 0, i32 2
  store float %17, ptr %19, align 4, !tbaa !10
  %20 = getelementptr inbounds %"struct.glm::detail::tquat", ptr %5, i32 0, i32 3
  %21 = load float, ptr %20, align 4, !tbaa !13
  %22 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %0, i32 0, i32 0
  %23 = getelementptr inbounds %struct.anon.1, ptr %22, i32 0, i32 3
  store float %21, ptr %23, align 4, !tbaa !10
  ret void
}

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="64" "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 = { 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" }

!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 = !{!"_ZTSN3glm6detail5tquatIfEE", !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 = !{!8, !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !7, 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"

%"struct.glm::detail::tvec4" = type { %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { float, float, float, float }

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind noalias nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %0, <2 x float> %1, <2 x float> %2) local_unnamed_addr #0 {
  tail call void @_ZN3glm6detail5tvec4IfEC2Ev(ptr noundef nonnull align 4 dereferenceable(16) %0)
  %4 = shufflevector <2 x float> %1, <2 x float> %2, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  store <4 x float> %4, ptr %0, align 4, !tbaa !5
  ret void
}

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

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="64" "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 = { 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" }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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