; LLVM IR from yangfengzzz/DigitalVox4 :: vox.render/controls/orbit_control.ll (ZN3vox7control12OrbitControl18handleMouseMovePanEdd)

; 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.vox::Vector.0" = type { float, float }
%"class.vox::control::OrbitControl" = type { %"class.vox::Script", float, %"class.vox::Point", %"class.vox::Vector", float, float, float, float, i8, float, i8, float, i8, float, float, i8, float, i8, float, float, float, float, i8, float, ptr, %"class.vox::Point", %"class.vox::Vector", %"class.vox::control::Spherical", %"class.vox::control::Spherical", %"class.vox::control::Spherical", float, float, %"class.vox::Vector", i8, %"class.vox::Vector", i32, %"class.vox::Vector.0", %"class.vox::Vector.0", %"class.vox::Vector.0", %"class.vox::Vector.0", %"class.vox::Vector.0", %"class.vox::Vector.0", %"class.vox::Vector.0", %"class.vox::Vector.0", %"class.vox::Vector.0", i8, i8, i32, i32 }
%"class.vox::Script" = type { %"class.vox::Component.base", i8, i64, i64, i64 }
%"class.vox::Component.base" = type <{ ptr, ptr, i8, i8, i8 }>
%"class.vox::Point" = type { float, float, float }
%"class.vox::control::Spherical" = type { float, float, float }
%"class.vox::Vector" = type { 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox7control12OrbitControl3panEff(ptr noundef nonnull align 8 dereferenceable(352), float noundef, float noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox6VectorIfLm2EEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3voxmiIfEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind noalias writable sret(%"class.vox::Vector.0") align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox7control12OrbitControl18handleMouseMovePanEdd(ptr noundef nonnull align 8 dereferenceable(352) %0, double noundef %1, double noundef %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  %7 = alloca %"class.vox::Vector.0", align 4
  %8 = alloca %"class.vox::Vector.0", align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store double %1, ptr %5, align 8, !tbaa !9
  store double %2, ptr %6, align 8, !tbaa !9
  %9 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %10 = load double, ptr %5, align 8, !tbaa !9
  %11 = fptrunc double %10 to float
  %12 = load double, ptr %6, align 8, !tbaa !9
  %13 = fptrunc double %12 to float
  call void @_ZN3vox6VectorIfLm2EEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %7, float noundef %11, float noundef %13)
  %14 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 40
  %15 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %14, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %16 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 40
  %17 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 39
  call void @_ZN3voxmiIfEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind writable sret(%"class.vox::Vector.0") align 4 %8, ptr noundef nonnull align 4 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(8) %17)
  %18 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 41
  %19 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  %20 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 41
  %21 = getelementptr inbounds %"class.vox::Vector.0", ptr %20, i32 0, i32 0
  %22 = load float, ptr %21, align 4, !tbaa !11
  %23 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 41
  %24 = getelementptr inbounds %"class.vox::Vector.0", ptr %23, i32 0, i32 1
  %25 = load float, ptr %24, align 4, !tbaa !24
  call void @_ZN3vox7control12OrbitControl3panEff(ptr noundef nonnull align 8 dereferenceable(352) %9, float noundef %22, float noundef %25)
  %26 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 40
  %27 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %9, i32 0, i32 39
  %28 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %27, ptr noundef nonnull align 4 dereferenceable(8) %26)
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !17, i64 308}
!12 = !{!"_ZTSN3vox7control12OrbitControlE", !13, i64 0, !17, i64 48, !18, i64 52, !19, i64 64, !17, i64 76, !17, i64 80, !17, i64 84, !17, i64 88, !15, i64 92, !17, i64 96, !15, i64 100, !17, i64 104, !15, i64 108, !17, i64 112, !17, i64 116, !15, i64 120, !17, i64 124, !15, i64 128, !17, i64 132, !17, i64 136, !17, i64 140, !17, i64 144, !15, i64 148, !17, i64 152, !6, i64 160, !18, i64 168, !19, i64 180, !20, i64 192, !20, i64 204, !20, i64 216, !17, i64 228, !17, i64 232, !19, i64 236, !15, i64 248, !19, i64 252, !21, i64 264, !22, i64 268, !22, i64 276, !22, i64 284, !22, i64 292, !22, i64 300, !22, i64 308, !22, i64 316, !22, i64 324, !22, i64 332, !15, i64 340, !15, i64 341, !23, i64 344, !23, i64 348}
!13 = !{!"_ZTSN3vox6ScriptE", !14, i64 0, !15, i64 19, !16, i64 24, !16, i64 32, !16, i64 40}
!14 = !{!"_ZTSN3vox9ComponentE", !6, i64 8, !15, i64 16, !15, i64 17, !15, i64 18}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTSN3vox5PointIfLm3EEE", !17, i64 0, !17, i64 4, !17, i64 8}
!19 = !{!"_ZTSN3vox6VectorIfLm3EEE", !17, i64 0, !17, i64 4, !17, i64 8}
!20 = !{!"_ZTSN3vox7control9SphericalE", !17, i64 0, !17, i64 4, !17, i64 8}
!21 = !{!"_ZTSN3vox7control12OrbitControl5STATE4EnumE", !7, i64 0}
!22 = !{!"_ZTSN3vox6VectorIfLm2EEE", !17, i64 0, !17, i64 4}
!23 = !{!"int", !7, i64 0}
!24 = !{!12, !17, i64 312}


; 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.vox::Vector.0" = type { 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox7control12OrbitControl3panEff(ptr noundef nonnull align 8 dereferenceable(352), float noundef, float noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3vox6VectorIfLm2EEC2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3voxmiIfEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind noalias writable sret(%"class.vox::Vector.0") align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox7control12OrbitControl18handleMouseMovePanEdd(ptr noundef nonnull align 8 dereferenceable(352) %0, double noundef %1, double noundef %2) local_unnamed_addr #1 align 2 {
  %4 = alloca %"class.vox::Vector.0", align 4
  %5 = alloca %"class.vox::Vector.0", align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #3
  %6 = fptrunc double %1 to float
  %7 = fptrunc double %2 to float
  call void @_ZN3vox6VectorIfLm2EEC2Eff(ptr noundef nonnull align 4 dereferenceable(8) %4, float noundef %6, float noundef %7)
  %8 = getelementptr inbounds i8, ptr %0, i64 300
  %9 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 292
  call void @_ZN3voxmiIfEENS_6VectorIT_Lm2EEERKS3_S5_(ptr dead_on_unwind nonnull writable sret(%"class.vox::Vector.0") align 4 %5, ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(8) %10)
  %11 = getelementptr inbounds i8, ptr %0, i64 308
  %12 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #3
  %13 = load float, ptr %11, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 312
  %15 = load float, ptr %14, align 8, !tbaa !21
  call void @_ZN3vox7control12OrbitControl3panEff(ptr noundef nonnull align 8 dereferenceable(352) %0, float noundef %13, float noundef %15)
  %16 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZN3vox6VectorIfLm2EEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(8) %10, ptr noundef nonnull align 4 dereferenceable(8) %8)
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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, !14, i64 308}
!6 = !{!"_ZTSN3vox7control12OrbitControlE", !7, i64 0, !14, i64 48, !15, i64 52, !16, i64 64, !14, i64 76, !14, i64 80, !14, i64 84, !14, i64 88, !12, i64 92, !14, i64 96, !12, i64 100, !14, i64 104, !12, i64 108, !14, i64 112, !14, i64 116, !12, i64 120, !14, i64 124, !12, i64 128, !14, i64 132, !14, i64 136, !14, i64 140, !14, i64 144, !12, i64 148, !14, i64 152, !9, i64 160, !15, i64 168, !16, i64 180, !17, i64 192, !17, i64 204, !17, i64 216, !14, i64 228, !14, i64 232, !16, i64 236, !12, i64 248, !16, i64 252, !18, i64 264, !19, i64 268, !19, i64 276, !19, i64 284, !19, i64 292, !19, i64 300, !19, i64 308, !19, i64 316, !19, i64 324, !19, i64 332, !12, i64 340, !12, i64 341, !20, i64 344, !20, i64 348}
!7 = !{!"_ZTSN3vox6ScriptE", !8, i64 0, !12, i64 19, !13, i64 24, !13, i64 32, !13, i64 40}
!8 = !{!"_ZTSN3vox9ComponentE", !9, i64 8, !12, i64 16, !12, i64 17, !12, i64 18}
!9 = !{!"any pointer", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!"bool", !10, i64 0}
!13 = !{!"long", !10, i64 0}
!14 = !{!"float", !10, i64 0}
!15 = !{!"_ZTSN3vox5PointIfLm3EEE", !14, i64 0, !14, i64 4, !14, i64 8}
!16 = !{!"_ZTSN3vox6VectorIfLm3EEE", !14, i64 0, !14, i64 4, !14, i64 8}
!17 = !{!"_ZTSN3vox7control9SphericalE", !14, i64 0, !14, i64 4, !14, i64 8}
!18 = !{!"_ZTSN3vox7control12OrbitControl5STATE4EnumE", !10, i64 0}
!19 = !{!"_ZTSN3vox6VectorIfLm2EEE", !14, i64 0, !14, i64 4}
!20 = !{!"int", !10, i64 0}
!21 = !{!6, !14, i64 312}


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