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

; 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::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 }
%"class.vox::Vector.0" = type { float, float }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox7control12OrbitControl12onMouseWheelEdd(ptr noundef nonnull align 8 dereferenceable(352) %0, double noundef %1, double noundef %2) #0 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca double, align 8
  %6 = alloca double, align 8
  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
  %7 = load ptr, ptr %4, align 8
  %8 = call noundef zeroext i1 @_ZN3vox9Component7enabledEv(ptr noundef nonnull align 8 dereferenceable(19) %7)
  %9 = zext i1 %8 to i32
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %25, label %11

11:                                               ; preds = %3
  %12 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %7, i32 0, i32 12
  %13 = load i8, ptr %12, align 4, !tbaa !11, !range !24, !noundef !25
  %14 = trunc i8 %13 to i1
  %15 = zext i1 %14 to i32
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %25, label %17

17:                                               ; preds = %11
  %18 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %7, i32 0, i32 35
  %19 = load i32, ptr %18, align 8, !tbaa !26
  %20 = icmp ne i32 %19, -1
  br i1 %20, label %21, label %26

21:                                               ; preds = %17
  %22 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %7, i32 0, i32 35
  %23 = load i32, ptr %22, align 8, !tbaa !26
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %21, %11, %3
  br label %29

26:                                               ; preds = %21, %17
  %27 = load double, ptr %5, align 8, !tbaa !9
  %28 = load double, ptr %6, align 8, !tbaa !9
  call void @_ZN3vox7control12OrbitControl16handleMouseWheelEdd(ptr noundef nonnull align 8 dereferenceable(352) %7, double noundef %27, double noundef %28)
  br label %29

29:                                               ; preds = %26, %25
  ret void
}

declare noundef zeroext i1 @_ZN3vox9Component7enabledEv(ptr noundef nonnull align 8 dereferenceable(19)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox7control12OrbitControl16handleMouseWheelEdd(ptr noundef nonnull align 8 dereferenceable(352), double noundef, double noundef) #0 align 2

attributes #0 = { 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 #1 = { "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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !15, i64 108}
!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 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!12, !21, i64 264}


; 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 uwtable
define dso_local void @_ZN3vox7control12OrbitControl12onMouseWheelEdd(ptr noundef nonnull align 8 dereferenceable(352) %0, double noundef %1, double noundef %2) local_unnamed_addr #0 align 2 {
  %4 = tail call noundef zeroext i1 @_ZN3vox9Component7enabledEv(ptr noundef nonnull align 8 dereferenceable(19) %0)
  %5 = getelementptr inbounds i8, ptr %0, i64 108
  %6 = load i8, ptr %5, align 4, !range !5
  %7 = icmp ne i8 %6, 0
  %or.cond.not = select i1 %4, i1 %7, i1 false
  br i1 %or.cond.not, label %8, label %12

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 264
  %10 = load i32, ptr %9, align 8, !tbaa !6
  switch i32 %10, label %12 [
    i32 -1, label %11
    i32 0, label %11
  ]

11:                                               ; preds = %8, %8
  tail call void @_ZN3vox7control12OrbitControl16handleMouseWheelEdd(ptr noundef nonnull align 8 dereferenceable(352) %0, double noundef %1, double noundef %2)
  br label %12

12:                                               ; preds = %8, %3, %11
  ret void
}

declare noundef zeroext i1 @_ZN3vox9Component7enabledEv(ptr noundef nonnull align 8 dereferenceable(19)) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3vox7control12OrbitControl16handleMouseWheelEdd(ptr noundef nonnull align 8 dereferenceable(352), double noundef, double noundef) local_unnamed_addr #0 align 2

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass