; LLVM IR from aap/librw :: tools/playground/camera.ll (ZN6Camera4turnEff)

; 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.rw::V3d" = type { float, float, float }
%"struct.rw::Quat" = type { float, float, float, float }
%class.Camera = type { ptr, %"struct.rw::V3d", %"struct.rw::V3d", %"struct.rw::V3d", %"struct.rw::V3d", float, float, float, float }

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN2rw9normalizeERKNS_3V3dE(ptr noundef nonnull align 4 dereferenceable(12)) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN2rw3subERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1

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

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

declare { <2 x float>, float } @_ZN2rw5crossERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Camera4turnEff(ptr noundef nonnull align 8 dereferenceable(72) %0, float noundef %1, float noundef %2) #4 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca %"struct.rw::V3d", align 4
  %8 = alloca { <2 x float>, float }, align 8
  %9 = alloca %"struct.rw::Quat", align 4
  %10 = alloca %"struct.rw::V3d", align 4
  %11 = alloca { <2 x float>, float }, align 8
  %12 = alloca %"struct.rw::V3d", align 4
  %13 = alloca { <2 x float>, float }, align 8
  %14 = alloca %"struct.rw::V3d", align 4
  %15 = alloca { <2 x float>, float }, align 8
  %16 = alloca %"struct.rw::V3d", align 4
  %17 = alloca %"struct.rw::V3d", align 4
  %18 = alloca { <2 x float>, float }, align 8
  %19 = alloca { <2 x float>, float }, align 8
  %20 = alloca %"struct.rw::Quat", align 4
  %21 = alloca %"struct.rw::V3d", align 4
  %22 = alloca { <2 x float>, float }, align 8
  %23 = alloca %"struct.rw::V3d", align 4
  %24 = alloca %"struct.rw::V3d", align 4
  %25 = alloca { <2 x float>, float }, align 8
  %26 = alloca { <2 x float>, float }, align 8
  %27 = alloca %"struct.rw::V3d", align 4
  %28 = alloca { <2 x float>, float }, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store float %1, ptr %5, align 4, !tbaa !9
  store float %2, ptr %6, align 4, !tbaa !9
  %29 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #7
  %30 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 2
  %31 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 1
  %32 = call { <2 x float>, float } @_ZN2rw3subERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %30, ptr noundef nonnull align 4 dereferenceable(12) %31)
  store { <2 x float>, float } %32, ptr %8, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 8 %8, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  %33 = load float, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #7
  %34 = call { <2 x float>, float } @_ZN2rw7makeV3dEfff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  store { <2 x float>, float } %34, ptr %11, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 8 %11, i64 12, i1 false)
  %35 = call { <2 x float>, <2 x float> } @_ZN2rw4Quat8rotationEfRKNS_3V3dE(float noundef %33, ptr noundef nonnull align 4 dereferenceable(12) %10)
  %36 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 0
  %37 = extractvalue { <2 x float>, <2 x float> } %35, 0
  store <2 x float> %37, ptr %36, align 4
  %38 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %9, i32 0, i32 1
  %39 = extractvalue { <2 x float>, <2 x float> } %35, 1
  store <2 x float> %39, ptr %38, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #7
  %40 = call { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(16) %9)
  store { <2 x float>, float } %40, ptr %13, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 8 %13, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %12, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %14) #7
  %41 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 4
  %42 = call { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12) %41, ptr noundef nonnull align 4 dereferenceable(16) %9)
  store { <2 x float>, float } %42, ptr %15, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %15, i64 12, i1 false)
  %43 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %43, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  %44 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 4
  %45 = call { <2 x float>, float } @_ZN2rw5crossERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %44)
  store { <2 x float>, float } %45, ptr %18, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 8 %18, i64 12, i1 false)
  %46 = call { <2 x float>, float } @_ZN2rw9normalizeERKNS_3V3dE(ptr noundef nonnull align 4 dereferenceable(12) %17)
  store { <2 x float>, float } %46, ptr %19, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 8 %19, i64 12, i1 false)
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %47 = load float, ptr %6, align 4, !tbaa !9
  %48 = call { <2 x float>, <2 x float> } @_ZN2rw4Quat8rotationEfRKNS_3V3dE(float noundef %47, ptr noundef nonnull align 4 dereferenceable(12) %16)
  %49 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %20, i32 0, i32 0
  %50 = extractvalue { <2 x float>, <2 x float> } %48, 0
  store <2 x float> %50, ptr %49, align 4
  %51 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %20, i32 0, i32 1
  %52 = extractvalue { <2 x float>, <2 x float> } %48, 1
  store <2 x float> %52, ptr %51, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %20, i64 16, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #7
  %53 = call { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(16) %9)
  store { <2 x float>, float } %53, ptr %22, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 8 %22, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %21, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #7
  %54 = call { <2 x float>, float } @_ZN2rw5crossERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %7)
  store { <2 x float>, float } %54, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 8 %25, i64 12, i1 false)
  %55 = call { <2 x float>, float } @_ZN2rw9normalizeERKNS_3V3dE(ptr noundef nonnull align 4 dereferenceable(12) %24)
  store { <2 x float>, float } %55, ptr %26, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 8 %26, i64 12, i1 false)
  %56 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #7
  %57 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 4
  %58 = getelementptr inbounds %"struct.rw::V3d", ptr %57, i32 0, i32 2
  %59 = load float, ptr %58, align 4, !tbaa !13
  %60 = fpext float %59 to double
  %61 = fcmp oge double %60, 0.000000e+00
  br i1 %61, label %62, label %65

62:                                               ; preds = %3
  %63 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 3
  %64 = getelementptr inbounds %"struct.rw::V3d", ptr %63, i32 0, i32 2
  store float 1.000000e+00, ptr %64, align 8, !tbaa !16
  br label %68

65:                                               ; preds = %3
  %66 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 3
  %67 = getelementptr inbounds %"struct.rw::V3d", ptr %66, i32 0, i32 2
  store float -1.000000e+00, ptr %67, align 8, !tbaa !16
  br label %68

68:                                               ; preds = %65, %62
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #7
  %69 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 1
  %70 = call { <2 x float>, float } @_ZN2rw3addERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %69, ptr noundef nonnull align 4 dereferenceable(12) %7)
  store { <2 x float>, float } %70, ptr %28, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 8 %28, i64 12, i1 false)
  %71 = getelementptr inbounds %class.Camera, ptr %29, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %71, ptr align 4 %27, i64 12, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZN2rw4Quat8rotationEfRKNS_3V3dE(float noundef, ptr noundef nonnull align 4 dereferenceable(12)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZN2rw7makeV3dEfff(float noundef, float noundef, float noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(16)) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZN2rw3addERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { 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 #5 = { 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 #6 = { inlinehint 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 #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 = !{!"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}
!12 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!13 = !{!14, !10, i64 52}
!14 = !{!"_ZTS6Camera", !6, i64 0, !15, i64 8, !15, i64 20, !15, i64 32, !15, i64 44, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68}
!15 = !{!"_ZTSN2rw3V3dE", !10, i64 0, !10, i64 4, !10, i64 8}
!16 = !{!14, !10, i64 40}


; 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.rw::V3d" = type { float, float, float }
%"struct.rw::Quat" = type { float, float, float, float }

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN2rw9normalizeERKNS_3V3dE(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN2rw3subERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1

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

declare { <2 x float>, float } @_ZN2rw5crossERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6Camera4turnEff(ptr noundef nonnull align 8 dereferenceable(72) %0, float noundef %1, float noundef %2) local_unnamed_addr #3 align 2 {
  %4 = alloca %"struct.rw::V3d", align 8
  %5 = alloca %"struct.rw::Quat", align 8
  %6 = alloca %"struct.rw::V3d", align 8
  %7 = alloca %"struct.rw::V3d", align 8
  %8 = alloca %"struct.rw::V3d", align 8
  %9 = alloca %"struct.rw::V3d", align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #6
  %10 = getelementptr inbounds i8, ptr %0, i64 20
  %11 = getelementptr inbounds i8, ptr %0, i64 8
  %12 = tail call { <2 x float>, float } @_ZN2rw3subERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %10, ptr noundef nonnull align 4 dereferenceable(12) %11)
  %.fca.0.extract44 = extractvalue { <2 x float>, float } %12, 0
  %.fca.1.extract45 = extractvalue { <2 x float>, float } %12, 1
  store <2 x float> %.fca.0.extract44, ptr %4, align 8
  %.sroa.247.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store float %.fca.1.extract45, ptr %.sroa.247.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #6
  %13 = tail call { <2 x float>, float } @_ZN2rw7makeV3dEfff(float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %.fca.0.extract40 = extractvalue { <2 x float>, float } %13, 0
  %.fca.1.extract41 = extractvalue { <2 x float>, float } %13, 1
  store <2 x float> %.fca.0.extract40, ptr %6, align 8
  %.sroa.243.0..sroa_idx = getelementptr inbounds i8, ptr %6, i64 8
  store float %.fca.1.extract41, ptr %.sroa.243.0..sroa_idx, align 8
  %14 = call { <2 x float>, <2 x float> } @_ZN2rw4Quat8rotationEfRKNS_3V3dE(float noundef %1, ptr noundef nonnull align 4 dereferenceable(12) %6)
  %15 = extractvalue { <2 x float>, <2 x float> } %14, 0
  store <2 x float> %15, ptr %5, align 8
  %16 = getelementptr inbounds i8, ptr %5, i64 8
  %17 = extractvalue { <2 x float>, <2 x float> } %14, 1
  store <2 x float> %17, ptr %16, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #6
  %18 = call { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(16) %5)
  %.fca.0.extract34 = extractvalue { <2 x float>, float } %18, 0
  %.fca.1.extract35 = extractvalue { <2 x float>, float } %18, 1
  store <2 x float> %.fca.0.extract34, ptr %4, align 8
  store float %.fca.1.extract35, ptr %.sroa.247.0..sroa_idx, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 44
  %20 = call { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12) %19, ptr noundef nonnull align 4 dereferenceable(16) %5)
  %.fca.0.extract28 = extractvalue { <2 x float>, float } %20, 0
  %.fca.1.extract29 = extractvalue { <2 x float>, float } %20, 1
  store <2 x float> %.fca.0.extract28, ptr %19, align 4
  %.sroa.433.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 52
  store float %.fca.1.extract29, ptr %.sroa.433.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #6
  %21 = call { <2 x float>, float } @_ZN2rw5crossERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %19)
  %.fca.0.extract24 = extractvalue { <2 x float>, float } %21, 0
  %.fca.1.extract25 = extractvalue { <2 x float>, float } %21, 1
  store <2 x float> %.fca.0.extract24, ptr %8, align 8
  %.sroa.227.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  store float %.fca.1.extract25, ptr %.sroa.227.0..sroa_idx, align 8
  %22 = call { <2 x float>, float } @_ZN2rw9normalizeERKNS_3V3dE(ptr noundef nonnull align 4 dereferenceable(12) %8)
  %.fca.0.extract20 = extractvalue { <2 x float>, float } %22, 0
  %.fca.1.extract21 = extractvalue { <2 x float>, float } %22, 1
  store <2 x float> %.fca.0.extract20, ptr %7, align 8
  %.sroa.223.0..sroa_idx = getelementptr inbounds i8, ptr %7, i64 8
  store float %.fca.1.extract21, ptr %.sroa.223.0..sroa_idx, align 8
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #6
  %23 = call { <2 x float>, <2 x float> } @_ZN2rw4Quat8rotationEfRKNS_3V3dE(float noundef %2, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %24 = extractvalue { <2 x float>, <2 x float> } %23, 0
  %25 = extractvalue { <2 x float>, <2 x float> } %23, 1
  store <2 x float> %24, ptr %5, align 8
  store <2 x float> %25, ptr %16, align 8
  %26 = call { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(16) %5)
  %.fca.0.extract12 = extractvalue { <2 x float>, float } %26, 0
  %.fca.1.extract13 = extractvalue { <2 x float>, float } %26, 1
  store <2 x float> %.fca.0.extract12, ptr %4, align 8
  store float %.fca.1.extract13, ptr %.sroa.247.0..sroa_idx, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #6
  %27 = call { <2 x float>, float } @_ZN2rw5crossERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %.fca.0.extract6 = extractvalue { <2 x float>, float } %27, 0
  %.fca.1.extract7 = extractvalue { <2 x float>, float } %27, 1
  store <2 x float> %.fca.0.extract6, ptr %9, align 8
  %.sroa.29.0..sroa_idx = getelementptr inbounds i8, ptr %9, i64 8
  store float %.fca.1.extract7, ptr %.sroa.29.0..sroa_idx, align 8
  %28 = call { <2 x float>, float } @_ZN2rw9normalizeERKNS_3V3dE(ptr noundef nonnull align 4 dereferenceable(12) %9)
  %.fca.0.extract2 = extractvalue { <2 x float>, float } %28, 0
  %.fca.1.extract3 = extractvalue { <2 x float>, float } %28, 1
  store <2 x float> %.fca.0.extract2, ptr %19, align 4
  store float %.fca.1.extract3, ptr %.sroa.433.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #6
  %29 = fcmp ult float %.fca.1.extract3, 0.000000e+00
  %.sink = select i1 %29, float -1.000000e+00, float 1.000000e+00
  %30 = getelementptr inbounds i8, ptr %0, i64 40
  store float %.sink, ptr %30, align 8
  %31 = call { <2 x float>, float } @_ZN2rw3addERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12) %11, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %.fca.0.extract = extractvalue { <2 x float>, float } %31, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %31, 1
  store <2 x float> %.fca.0.extract, ptr %10, align 4
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 28
  store float %.fca.1.extract, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #6
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZN2rw4Quat8rotationEfRKNS_3V3dE(float noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZN2rw7makeV3dEfff(float noundef, float noundef, float noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, float } @_ZN2rw6rotateERKNS_3V3dERKNS_4QuatE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local { <2 x float>, float } @_ZN2rw3addERKNS_3V3dES2_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #5

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass