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

; 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 nounwind uwtable
define dso_local void @_ZN3vox7control12OrbitControl8rotateUpEf(ptr noundef nonnull align 8 dereferenceable(352) %0, float noundef %1) #0 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca float, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store float %1, ptr %4, align 4, !tbaa !9
  %5 = load ptr, ptr %3, align 8
  %6 = load float, ptr %4, align 4, !tbaa !9
  %7 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %5, i32 0, i32 28
  %8 = getelementptr inbounds %"class.vox::control::Spherical", ptr %7, i32 0, i32 1
  %9 = load float, ptr %8, align 4, !tbaa !11
  %10 = fsub float %9, %6
  store float %10, ptr %8, align 4, !tbaa !11
  %11 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %5, i32 0, i32 8
  %12 = load i8, ptr %11, align 4, !tbaa !23, !range !24, !noundef !25
  %13 = trunc i8 %12 to i1
  br i1 %13, label %14, label %19

14:                                               ; preds = %2
  %15 = load float, ptr %4, align 4, !tbaa !9
  %16 = fneg float %15
  %17 = getelementptr inbounds %"class.vox::control::OrbitControl", ptr %5, i32 0, i32 29
  %18 = getelementptr inbounds %"class.vox::control::Spherical", ptr %17, i32 0, i32 1
  store float %16, ptr %18, align 4, !tbaa !26
  br label %19

19:                                               ; preds = %14, %2
  ret void
}

attributes #0 = { 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 = !{!"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 = !{!12, !10, i64 208}
!12 = !{!"_ZTSN3vox7control12OrbitControlE", !13, i64 0, !10, i64 48, !17, i64 52, !18, i64 64, !10, i64 76, !10, i64 80, !10, i64 84, !10, i64 88, !15, i64 92, !10, i64 96, !15, i64 100, !10, i64 104, !15, i64 108, !10, i64 112, !10, i64 116, !15, i64 120, !10, i64 124, !15, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !15, i64 148, !10, i64 152, !6, i64 160, !17, i64 168, !18, i64 180, !19, i64 192, !19, i64 204, !19, i64 216, !10, i64 228, !10, i64 232, !18, i64 236, !15, i64 248, !18, i64 252, !20, i64 264, !21, i64 268, !21, i64 276, !21, i64 284, !21, i64 292, !21, i64 300, !21, i64 308, !21, i64 316, !21, i64 324, !21, i64 332, !15, i64 340, !15, i64 341, !22, i64 344, !22, 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 = !{!"_ZTSN3vox5PointIfLm3EEE", !10, i64 0, !10, i64 4, !10, i64 8}
!18 = !{!"_ZTSN3vox6VectorIfLm3EEE", !10, i64 0, !10, i64 4, !10, i64 8}
!19 = !{!"_ZTSN3vox7control9SphericalE", !10, i64 0, !10, i64 4, !10, i64 8}
!20 = !{!"_ZTSN3vox7control12OrbitControl5STATE4EnumE", !7, i64 0}
!21 = !{!"_ZTSN3vox6VectorIfLm2EEE", !10, i64 0, !10, i64 4}
!22 = !{!"int", !7, i64 0}
!23 = !{!12, !15, i64 92}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = !{!12, !10, i64 220}


; 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 nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) uwtable
define dso_local void @_ZN3vox7control12OrbitControl8rotateUpEf(ptr nocapture noundef nonnull align 8 dereferenceable(352) %0, float noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 208
  %4 = load float, ptr %3, align 8, !tbaa !5
  %5 = fsub float %4, %1
  store float %5, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 92
  %7 = load i8, ptr %6, align 4, !tbaa !21, !range !22, !noundef !23
  %8 = trunc nuw i8 %7 to i1
  br i1 %8, label %9, label %12

9:                                                ; preds = %2
  %10 = fneg float %1
  %11 = getelementptr inbounds i8, ptr %0, i64 220
  store float %10, ptr %11, align 4, !tbaa !24
  br label %12

12:                                               ; preds = %9, %2
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: readwrite) 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, !14, i64 208}
!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, !12, i64 92}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!6, !14, i64 220}


; Effective O3 passes: GlobalOptPass,IPSCCPPass,InferAlignmentPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass