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

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

@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1

; 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 @_ZN3glm6detail5tquatIfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, <2 x float>, <2 x float>) #3

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @_Z4LerpRKN3glm6detail5tquatIfEES4_f(ptr noundef nonnull align 4 dereferenceable(16) %0, ptr noundef nonnull align 4 dereferenceable(16) %1, float noundef %2) #3 {
  %4 = alloca %"struct.glm::detail::tquat", align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca %"struct.glm::detail::tvec4", align 4
  %9 = alloca %"struct.glm::detail::tquat", align 4
  %10 = alloca %"struct.glm::detail::tvec4", align 4
  %11 = alloca %"struct.glm::detail::tquat", align 4
  %12 = alloca %"struct.glm::detail::tvec4", align 4
  %13 = alloca %"struct.glm::detail::tvec4", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #6
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %14, i64 16, i1 false), !tbaa.struct !11
  %15 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %16 = load <2 x float>, ptr %15, align 4
  %17 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %18 = load <2 x float>, ptr %17, align 4
  call void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %8, <2 x float> %16, <2 x float> %18)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #6
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %19, i64 16, i1 false), !tbaa.struct !11
  %20 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %11, i32 0, i32 0
  %21 = load <2 x float>, ptr %20, align 4
  %22 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %11, i32 0, i32 1
  %23 = load <2 x float>, ptr %22, align 4
  call void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %10, <2 x float> %21, <2 x float> %23)
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #6
  call void @_ZN3glm3mixIfEENS_6detail5tvec4IT_EERKS4_S6_RKS3_(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %12, ptr noundef nonnull align 4 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %24 = load float, ptr %7, align 4, !tbaa !9
  %25 = fpext float %24 to double
  %26 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %27 = getelementptr inbounds %struct.anon.1, ptr %26, i32 0, i32 3
  %28 = load float, ptr %27, align 4, !tbaa !12
  %29 = fpext float %28 to double
  %30 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %31 = getelementptr inbounds %struct.anon.1, ptr %30, i32 0, i32 0
  %32 = load float, ptr %31, align 4, !tbaa !12
  %33 = fpext float %32 to double
  %34 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %35 = getelementptr inbounds %struct.anon.1, ptr %34, i32 0, i32 1
  %36 = load float, ptr %35, align 4, !tbaa !12
  %37 = fpext float %36 to double
  %38 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %39 = getelementptr inbounds %struct.anon.1, ptr %38, i32 0, i32 2
  %40 = load float, ptr %39, align 4, !tbaa !12
  %41 = fpext float %40 to double
  %42 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, double noundef %25, double noundef %29, double noundef %33, double noundef %37, double noundef %41)
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #6
  call void @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind writable sret(%"struct.glm::detail::tvec4") align 4 %13, ptr noundef nonnull align 4 dereferenceable(16) %12)
  %43 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(16) %13)
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #6
  %44 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %45 = getelementptr inbounds %struct.anon.1, ptr %44, i32 0, i32 3
  %46 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %47 = getelementptr inbounds %struct.anon.1, ptr %46, i32 0, i32 0
  %48 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %49 = getelementptr inbounds %struct.anon.1, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds %"struct.glm::detail::tvec4", ptr %12, i32 0, i32 0
  %51 = getelementptr inbounds %struct.anon.1, ptr %50, i32 0, i32 2
  call void @_ZN3glm6detail5tquatIfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %45, ptr noundef nonnull align 4 dereferenceable(4) %47, ptr noundef nonnull align 4 dereferenceable(4) %49, ptr noundef nonnull align 4 dereferenceable(4) %51)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #6
  %52 = load { <2 x float>, <2 x float> }, ptr %4, align 4
  ret { <2 x float>, <2 x float> } %52
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm3mixIfEENS_6detail5tvec4IT_EERKS4_S6_RKS3_(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16)) #5

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

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 = { "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"="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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #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 = !{!"float", !7, i64 0}
!11 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!12 = !{!7, !7, i64 0}


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

@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1

; 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 @_ZN3glm6detail5tquatIfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) unnamed_addr #1 align 2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, <2 x float>, <2 x float>) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @_Z4LerpRKN3glm6detail5tquatIfEES4_f(ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %0, ptr nocapture noundef nonnull readonly align 4 dereferenceable(16) %1, float noundef %2) local_unnamed_addr #3 {
  %4 = alloca %"struct.glm::detail::tquat", align 8
  %5 = alloca float, align 4
  %6 = alloca %"struct.glm::detail::tvec4", align 4
  %7 = alloca %"struct.glm::detail::tvec4", align 4
  %8 = alloca %"struct.glm::detail::tvec4", align 4
  %9 = alloca %"struct.glm::detail::tvec4", align 4
  store float %2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #5
  %.sroa.01.0.copyload = load <2 x float>, ptr %0, align 4
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 8
  %.sroa.22.0.copyload = load <2 x float>, ptr %.sroa.22.0..sroa_idx, align 4
  call void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %6, <2 x float> %.sroa.01.0.copyload, <2 x float> %.sroa.22.0.copyload)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #5
  %.sroa.0.0.copyload = load <2 x float>, ptr %1, align 4
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %1, i64 8
  %.sroa.2.0.copyload = load <2 x float>, ptr %.sroa.2.0..sroa_idx, align 4
  call void @_Z9VectorizeN3glm6detail5tquatIfEE(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %7, <2 x float> %.sroa.0.0.copyload, <2 x float> %.sroa.2.0.copyload)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  call void @_ZN3glm3mixIfEENS_6detail5tvec4IT_EERKS4_S6_RKS3_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %8, ptr noundef nonnull align 4 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %10 = load float, ptr %5, align 4, !tbaa !5
  %11 = fpext float %10 to double
  %12 = getelementptr inbounds i8, ptr %8, i64 12
  %13 = load float, ptr %12, align 4, !tbaa !9
  %14 = fpext float %13 to double
  %15 = load float, ptr %8, align 4, !tbaa !9
  %16 = fpext float %15 to double
  %17 = getelementptr inbounds i8, ptr %8, i64 4
  %18 = load float, ptr %17, align 4, !tbaa !9
  %19 = fpext float %18 to double
  %20 = getelementptr inbounds i8, ptr %8, i64 8
  %21 = load float, ptr %20, align 4, !tbaa !9
  %22 = fpext float %21 to double
  %23 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, double noundef %11, double noundef %14, double noundef %16, double noundef %19, double noundef %22)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  call void @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind nonnull writable sret(%"struct.glm::detail::tvec4") align 4 %9, ptr noundef nonnull align 4 dereferenceable(16) %8)
  %24 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN3glm6detail5tvec4IfEaSERKS2_(ptr noundef nonnull align 4 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(16) %9)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @_ZN3glm6detail5tquatIfEC2ERKfS4_S4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %20)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #5
  %.fca.0.load = load <2 x float>, ptr %4, align 8
  %.fca.0.insert = insertvalue { <2 x float>, <2 x float> } poison, <2 x float> %.fca.0.load, 0
  %.fca.1.gep = getelementptr inbounds i8, ptr %4, i64 8
  %.fca.1.load = load <2 x float>, ptr %.fca.1.gep, align 8
  %.fca.1.insert = insertvalue { <2 x float>, <2 x float> } %.fca.0.insert, <2 x float> %.fca.1.load, 1
  ret { <2 x float>, <2 x float> } %.fca.1.insert
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm3mixIfEENS_6detail5tvec4IT_EERKS4_S6_RKS3_(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3glm9normalizeIfEENS_6detail5tvec4IT_EERKS4_(ptr dead_on_unwind noalias writable sret(%"struct.glm::detail::tvec4") align 4, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4

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

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 = { nofree nounwind "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"="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 #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 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}


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