; LLVM IR from Sonryle/JoePhys :: testbed/src/WindowManager.ll (ZN13WindowManager14ScrollCallbackEP10GLFWwindowdd)

; 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.Settings = type <{ i32, i32, i32, i32, i8, [3 x i8], float, float, i8, [3 x i8], %struct.vec2, i8, i8, i8, i8, i8, [3 x i8], float, float, float, float, i32, i32, i32, float, i8, [3 x i8] }>
%struct.vec2 = type { float, float }
%struct.Camera = type { %struct.vec2, float, i32, i32 }
%struct.WindowManager = type <{ %struct.vec2, i32, i32, ptr, ptr, ptr, i8, i8, i8, i8, [4 x i8] }>
%struct.SceneManager = type <{ ptr, i32, [4 x i8] }>
%struct.ImGuiIO = type { i32, i32, %struct.ImVec2, float, float, ptr, ptr, ptr, ptr, float, i8, ptr, %struct.ImVec2, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, float, float, float, float, float, float, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, i8, i8, i8, float, i32, i32, i32, i32, %struct.ImVec2, ptr, %struct.ImVec2, [5 x i8], float, float, i32, i8, i8, i8, i8, i32, [154 x %struct.ImGuiKeyData], i8, %struct.ImVec2, [5 x %struct.ImVec2], [5 x double], [5 x i8], [5 x i8], [5 x i16], [5 x i16], [5 x i8], [5 x double], [5 x i8], [5 x i8], i8, i8, [5 x float], [5 x float], [5 x float], float, i8, i8, i16, %struct.ImVector, ptr, ptr, ptr }
%struct.ImGuiKeyData = type { i8, float, float, float }
%struct.ImVec2 = type { float, float }
%struct.ImVector = type { i32, i32, ptr }
%struct.Particle = type { i8, %struct.vec2, %struct.vec2, float, float, float, %struct.vec2, [2 x %struct.vec2] }

@PI = external dso_local global double, align 8
@settings = external global %struct.Settings, align 4
@camera = external global %struct.Camera, align 4
@window_mgr = external dso_local global %struct.WindowManager, align 8
@scene_manager = external global %struct.SceneManager, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13WindowManager14ScrollCallbackEP10GLFWwindowdd(ptr noundef %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
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %struct.vec2, align 4
  %13 = alloca %struct.vec2, align 4
  %14 = alloca float, 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
  %15 = load ptr, ptr getelementptr inbounds (%struct.WindowManager, ptr @window_mgr, i32 0, i32 3), align 8, !tbaa !11
  %16 = call i32 @glfwGetKey(ptr noundef %15, i32 noundef 341)
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %40

18:                                               ; preds = %3
  %19 = call noundef nonnull align 8 dereferenceable(3016) ptr @_ZN5ImGui5GetIOEv()
  %20 = getelementptr inbounds %struct.ImGuiIO, ptr %19, i32 0, i32 52
  %21 = load i8, ptr %20, align 8, !tbaa !17, !range !23, !noundef !24
  %22 = trunc i8 %21 to i1
  %23 = zext i1 %22 to i32
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %39

25:                                               ; preds = %18
  %26 = load double, ptr %6, align 8, !tbaa !9
  %27 = fcmp olt double %26, 0.000000e+00
  br i1 %27, label %28, label %33

28:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %29 = load float, ptr getelementptr inbounds (%struct.Camera, ptr @camera, i32 0, i32 1), align 4, !tbaa !25
  %30 = fmul float %29, 0x3FEE666660000000
  store float %30, ptr %7, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store float 0x3EE4F8B580000000, ptr %8, align 4, !tbaa !27
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %32 = load float, ptr %31, align 4, !tbaa !27
  store float %32, ptr getelementptr inbounds (%struct.Camera, ptr @camera, i32 0, i32 1), align 4, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %38

33:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %34 = load float, ptr getelementptr inbounds (%struct.Camera, ptr @camera, i32 0, i32 1), align 4, !tbaa !25
  %35 = fmul float %34, 0x3FF0CCCCC0000000
  store float %35, ptr %9, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store float 1.000000e+03, ptr %10, align 4, !tbaa !27
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %37 = load float, ptr %36, align 4, !tbaa !27
  store float %37, ptr getelementptr inbounds (%struct.Camera, ptr @camera, i32 0, i32 1), align 4, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %38

38:                                               ; preds = %33, %28
  br label %39

39:                                               ; preds = %38, %18
  br label %116

40:                                               ; preds = %3
  %41 = call noundef nonnull align 8 dereferenceable(3016) ptr @_ZN5ImGui5GetIOEv()
  %42 = getelementptr inbounds %struct.ImGuiIO, ptr %41, i32 0, i32 52
  %43 = load i8, ptr %42, align 8, !tbaa !17, !range !23, !noundef !24
  %44 = trunc i8 %43 to i1
  %45 = zext i1 %44 to i32
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %115

47:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %48 = load ptr, ptr @scene_manager, align 8, !tbaa !28
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 @window_mgr, i64 8, i1 false), !tbaa.struct !30
  %49 = load <2 x float>, ptr %13, align 4
  %50 = call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %49)
  store <2 x float> %50, ptr %12, align 4
  %51 = load <2 x float>, ptr %12, align 4
  %52 = call noundef ptr @_ZN5Scene18GetNearestParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52) %48, <2 x float> %51)
  store ptr %52, ptr %11, align 8, !tbaa !5
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = icmp ne ptr %53, null
  br i1 %54, label %55, label %114

55:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.Particle, ptr %56, i32 0, i32 4
  %58 = load float, ptr %57, align 4, !tbaa !31
  store float %58, ptr %14, align 4, !tbaa !27
  %59 = load double, ptr %6, align 8, !tbaa !9
  %60 = fdiv double %59, 1.000000e+01
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.Particle, ptr %61, i32 0, i32 4
  %63 = load float, ptr %62, align 4, !tbaa !31
  %64 = fpext float %63 to double
  %65 = fadd double %64, %60
  %66 = fptrunc double %65 to float
  store float %66, ptr %62, align 4, !tbaa !31
  %67 = load ptr, ptr %11, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.Particle, ptr %67, i32 0, i32 4
  %69 = load float, ptr %68, align 4, !tbaa !31
  %70 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 6), align 4, !tbaa !33
  %71 = fcmp olt float %69, %70
  br i1 %71, label %72, label %76

72:                                               ; preds = %55
  %73 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 6), align 4, !tbaa !33
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.Particle, ptr %74, i32 0, i32 4
  store float %73, ptr %75, align 4, !tbaa !31
  br label %76

76:                                               ; preds = %72, %55
  %77 = load ptr, ptr %11, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Particle, ptr %77, i32 0, i32 4
  %79 = load float, ptr %78, align 4, !tbaa !31
  %80 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 7), align 4, !tbaa !35
  %81 = fcmp ogt float %79, %80
  br i1 %81, label %82, label %86

82:                                               ; preds = %76
  %83 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 7), align 4, !tbaa !35
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.Particle, ptr %84, i32 0, i32 4
  store float %83, ptr %85, align 4, !tbaa !31
  br label %86

86:                                               ; preds = %82, %76
  %87 = load ptr, ptr %11, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Particle, ptr %87, i32 0, i32 5
  %89 = load float, ptr %88, align 4, !tbaa !36
  %90 = fpext float %89 to double
  %91 = load double, ptr @PI, align 8, !tbaa !9
  %92 = load float, ptr %14, align 4, !tbaa !27
  %93 = fpext float %92 to double
  %94 = fmul double %91, %93
  %95 = load float, ptr %14, align 4, !tbaa !27
  %96 = fpext float %95 to double
  %97 = fmul double %94, %96
  %98 = fdiv double %90, %97
  %99 = load double, ptr @PI, align 8, !tbaa !9
  %100 = fmul double %98, %99
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.Particle, ptr %101, i32 0, i32 4
  %103 = load float, ptr %102, align 4, !tbaa !31
  %104 = fpext float %103 to double
  %105 = fmul double %100, %104
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.Particle, ptr %106, i32 0, i32 4
  %108 = load float, ptr %107, align 4, !tbaa !31
  %109 = fpext float %108 to double
  %110 = fmul double %105, %109
  %111 = fptrunc double %110 to float
  %112 = load ptr, ptr %11, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.Particle, ptr %112, i32 0, i32 5
  store float %111, ptr %113, align 4, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %114

114:                                              ; preds = %86, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %115

115:                                              ; preds = %114, %40
  br label %116

116:                                              ; preds = %115, %39
  ret void
}

declare i32 @glfwGetKey(ptr noundef, i32 noundef) #1

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

declare noundef ptr @_ZN5Scene18GetNearestParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>) #1

declare <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20), <2 x float>) #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) #3

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

declare noundef nonnull align 8 dereferenceable(3016) ptr @_ZN5ImGui5GetIOEv() #1

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

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

attributes #0 = { 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 #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" }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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, !6, i64 16}
!12 = !{!"_ZTS13WindowManager", !13, i64 0, !15, i64 8, !15, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !16, i64 40, !16, i64 41, !16, i64 42, !16, i64 43}
!13 = !{!"_ZTS4vec2", !14, i64 0, !14, i64 4}
!14 = !{!"float", !7, i64 0}
!15 = !{!"int", !7, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !16, i64 176}
!18 = !{!"_ZTS7ImGuiIO", !15, i64 0, !15, i64 4, !19, i64 8, !14, i64 16, !14, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !14, i64 56, !16, i64 60, !6, i64 64, !19, i64 72, !16, i64 80, !16, i64 81, !16, i64 82, !16, i64 83, !16, i64 84, !16, i64 85, !16, i64 86, !16, i64 87, !16, i64 88, !16, i64 89, !16, i64 90, !16, i64 91, !16, i64 92, !16, i64 93, !16, i64 94, !16, i64 95, !16, i64 96, !14, i64 100, !14, i64 104, !14, i64 108, !14, i64 112, !14, i64 116, !14, i64 120, !16, i64 124, !16, i64 125, !16, i64 126, !16, i64 127, !16, i64 128, !16, i64 129, !16, i64 130, !16, i64 131, !16, i64 132, !16, i64 133, !16, i64 134, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !16, i64 176, !16, i64 177, !16, i64 178, !16, i64 179, !16, i64 180, !16, i64 181, !16, i64 182, !14, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !19, i64 204, !6, i64 216, !19, i64 224, !7, i64 232, !14, i64 240, !14, i64 244, !20, i64 248, !16, i64 252, !16, i64 253, !16, i64 254, !16, i64 255, !15, i64 256, !7, i64 260, !16, i64 2724, !19, i64 2728, !7, i64 2736, !7, i64 2776, !7, i64 2816, !7, i64 2821, !7, i64 2826, !7, i64 2836, !7, i64 2846, !7, i64 2856, !7, i64 2896, !7, i64 2901, !16, i64 2906, !16, i64 2907, !7, i64 2908, !7, i64 2928, !7, i64 2948, !14, i64 2968, !16, i64 2972, !16, i64 2973, !21, i64 2974, !22, i64 2976, !6, i64 2992, !6, i64 3000, !6, i64 3008}
!19 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!20 = !{!"_ZTS16ImGuiMouseSource", !7, i64 0}
!21 = !{!"short", !7, i64 0}
!22 = !{!"_ZTS8ImVectorItE", !15, i64 0, !15, i64 4, !6, i64 8}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!26, !14, i64 8}
!26 = !{!"_ZTS6Camera", !13, i64 0, !14, i64 8, !15, i64 12, !15, i64 16}
!27 = !{!14, !14, i64 0}
!28 = !{!29, !6, i64 0}
!29 = !{!"_ZTS12SceneManager", !6, i64 0, !15, i64 8}
!30 = !{i64 0, i64 4, !27, i64 4, i64 4, !27}
!31 = !{!32, !14, i64 24}
!32 = !{!"_ZTS8Particle", !16, i64 0, !13, i64 4, !13, i64 12, !14, i64 20, !14, i64 24, !14, i64 28, !13, i64 32, !7, i64 40}
!33 = !{!34, !14, i64 20}
!34 = !{!"_ZTS8Settings", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !16, i64 16, !14, i64 20, !14, i64 24, !16, i64 28, !13, i64 32, !16, i64 40, !16, i64 41, !16, i64 42, !16, i64 43, !16, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !15, i64 64, !15, i64 68, !15, i64 72, !14, i64 76, !16, i64 80}
!35 = !{!34, !14, i64 24}
!36 = !{!32, !14, i64 28}


; 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.Settings = type <{ i32, i32, i32, i32, i8, [3 x i8], float, float, i8, [3 x i8], %struct.vec2, i8, i8, i8, i8, i8, [3 x i8], float, float, float, float, i32, i32, i32, float, i8, [3 x i8] }>
%struct.vec2 = type { float, float }
%struct.Camera = type { %struct.vec2, float, i32, i32 }
%struct.WindowManager = type <{ %struct.vec2, i32, i32, ptr, ptr, ptr, i8, i8, i8, i8, [4 x i8] }>
%struct.SceneManager = type <{ ptr, i32, [4 x i8] }>

@PI = external dso_local local_unnamed_addr global double, align 8
@settings = external local_unnamed_addr global %struct.Settings, align 4
@camera = external global %struct.Camera, align 4
@window_mgr = external dso_local local_unnamed_addr global %struct.WindowManager, align 8
@scene_manager = external local_unnamed_addr global %struct.SceneManager, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13WindowManager14ScrollCallbackEP10GLFWwindowdd(ptr nocapture noundef readnone %0, double noundef %1, double noundef %2) local_unnamed_addr #0 align 2 {
  %4 = alloca float, align 4
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @window_mgr, i64 16), align 8, !tbaa !5
  %9 = tail call i32 @glfwGetKey(ptr noundef %8, i32 noundef 341)
  %.not = icmp eq i32 %9, 0
  %10 = tail call noundef nonnull align 8 dereferenceable(3016) ptr @_ZN5ImGui5GetIOEv()
  %11 = getelementptr inbounds i8, ptr %10, i64 176
  %12 = load i8, ptr %11, align 8, !tbaa !14, !range !20, !noundef !21
  %13 = icmp eq i8 %12, 0
  br i1 %.not, label %27, label %14

14:                                               ; preds = %3
  br i1 %13, label %15, label %61

15:                                               ; preds = %14
  %16 = fcmp olt double %2, 0.000000e+00
  br i1 %16, label %17, label %22

17:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %18 = load float, ptr getelementptr inbounds (i8, ptr @camera, i64 8), align 4, !tbaa !22
  %19 = fmul float %18, 0x3FEE666660000000
  store float %19, ptr %4, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store float 0x3EE4F8B580000000, ptr %5, align 4, !tbaa !24
  %20 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %21 = load float, ptr %20, align 4, !tbaa !24
  store float %21, ptr getelementptr inbounds (i8, ptr @camera, i64 8), align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %61

22:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  %23 = load float, ptr getelementptr inbounds (i8, ptr @camera, i64 8), align 4, !tbaa !22
  %24 = fmul float %23, 0x3FF0CCCCC0000000
  store float %24, ptr %6, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store float 1.000000e+03, ptr %7, align 4, !tbaa !24
  %25 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %26 = load float, ptr %25, align 4, !tbaa !24
  store float %26, ptr getelementptr inbounds (i8, ptr @camera, i64 8), align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %61

27:                                               ; preds = %3
  br i1 %13, label %28, label %61

28:                                               ; preds = %27
  %29 = load ptr, ptr @scene_manager, align 8, !tbaa !25
  %.sroa.0.0.copyload = load <2 x float>, ptr @window_mgr, align 8
  %30 = tail call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %.sroa.0.0.copyload)
  %31 = tail call noundef ptr @_ZN5Scene18GetNearestParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52) %29, <2 x float> %30)
  %.not18 = icmp eq ptr %31, null
  br i1 %.not18, label %61, label %32

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %31, i64 24
  %34 = load float, ptr %33, align 4, !tbaa !27
  %35 = fdiv double %2, 1.000000e+01
  %36 = fpext float %34 to double
  %37 = fadd double %35, %36
  %38 = fptrunc double %37 to float
  store float %38, ptr %33, align 4, !tbaa !27
  %39 = load float, ptr getelementptr inbounds (i8, ptr @settings, i64 20), align 4, !tbaa !29
  %40 = fcmp ogt float %39, %38
  br i1 %40, label %41, label %42

41:                                               ; preds = %32
  store float %39, ptr %33, align 4, !tbaa !27
  br label %42

42:                                               ; preds = %41, %32
  %43 = phi float [ %39, %41 ], [ %38, %32 ]
  %44 = load float, ptr getelementptr inbounds (i8, ptr @settings, i64 24), align 4, !tbaa !31
  %45 = fcmp ogt float %43, %44
  br i1 %45, label %46, label %47

46:                                               ; preds = %42
  store float %44, ptr %33, align 4, !tbaa !27
  br label %47

47:                                               ; preds = %46, %42
  %48 = phi float [ %44, %46 ], [ %43, %42 ]
  %49 = getelementptr inbounds i8, ptr %31, i64 28
  %50 = load float, ptr %49, align 4, !tbaa !32
  %51 = fpext float %50 to double
  %52 = load double, ptr @PI, align 8, !tbaa !33
  %53 = fmul double %52, %36
  %54 = fmul double %53, %36
  %55 = fdiv double %51, %54
  %56 = fmul double %52, %55
  %57 = fpext float %48 to double
  %58 = fmul double %56, %57
  %59 = fmul double %58, %57
  %60 = fptrunc double %59 to float
  store float %60, ptr %49, align 4, !tbaa !32
  br label %61

61:                                               ; preds = %28, %47, %27, %14, %22, %17
  ret void
}

declare i32 @glfwGetKey(ptr noundef, i32 noundef) local_unnamed_addr #1

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

declare noundef ptr @_ZN5Scene18GetNearestParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>) local_unnamed_addr #1

declare <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20), <2 x float>) 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) #2

declare noundef nonnull align 8 dereferenceable(3016) ptr @_ZN5ImGui5GetIOEv() local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

attributes #0 = { 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 #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" }
attributes #2 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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, !12, i64 16}
!6 = !{!"_ZTS13WindowManager", !7, i64 0, !11, i64 8, !11, i64 12, !12, i64 16, !12, i64 24, !12, i64 32, !13, i64 40, !13, i64 41, !13, i64 42, !13, i64 43}
!7 = !{!"_ZTS4vec2", !8, i64 0, !8, i64 4}
!8 = !{!"float", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"any pointer", !9, i64 0}
!13 = !{!"bool", !9, i64 0}
!14 = !{!15, !13, i64 176}
!15 = !{!"_ZTS7ImGuiIO", !11, i64 0, !11, i64 4, !16, i64 8, !8, i64 16, !8, i64 20, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !8, i64 56, !13, i64 60, !12, i64 64, !16, i64 72, !13, i64 80, !13, i64 81, !13, i64 82, !13, i64 83, !13, i64 84, !13, i64 85, !13, i64 86, !13, i64 87, !13, i64 88, !13, i64 89, !13, i64 90, !13, i64 91, !13, i64 92, !13, i64 93, !13, i64 94, !13, i64 95, !13, i64 96, !8, i64 100, !8, i64 104, !8, i64 108, !8, i64 112, !8, i64 116, !8, i64 120, !13, i64 124, !13, i64 125, !13, i64 126, !13, i64 127, !13, i64 128, !13, i64 129, !13, i64 130, !13, i64 131, !13, i64 132, !13, i64 133, !13, i64 134, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !12, i64 168, !13, i64 176, !13, i64 177, !13, i64 178, !13, i64 179, !13, i64 180, !13, i64 181, !13, i64 182, !8, i64 184, !11, i64 188, !11, i64 192, !11, i64 196, !11, i64 200, !16, i64 204, !12, i64 216, !16, i64 224, !9, i64 232, !8, i64 240, !8, i64 244, !17, i64 248, !13, i64 252, !13, i64 253, !13, i64 254, !13, i64 255, !11, i64 256, !9, i64 260, !13, i64 2724, !16, i64 2728, !9, i64 2736, !9, i64 2776, !9, i64 2816, !9, i64 2821, !9, i64 2826, !9, i64 2836, !9, i64 2846, !9, i64 2856, !9, i64 2896, !9, i64 2901, !13, i64 2906, !13, i64 2907, !9, i64 2908, !9, i64 2928, !9, i64 2948, !8, i64 2968, !13, i64 2972, !13, i64 2973, !18, i64 2974, !19, i64 2976, !12, i64 2992, !12, i64 3000, !12, i64 3008}
!16 = !{!"_ZTS6ImVec2", !8, i64 0, !8, i64 4}
!17 = !{!"_ZTS16ImGuiMouseSource", !9, i64 0}
!18 = !{!"short", !9, i64 0}
!19 = !{!"_ZTS8ImVectorItE", !11, i64 0, !11, i64 4, !12, i64 8}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = !{!23, !8, i64 8}
!23 = !{!"_ZTS6Camera", !7, i64 0, !8, i64 8, !11, i64 12, !11, i64 16}
!24 = !{!8, !8, i64 0}
!25 = !{!26, !12, i64 0}
!26 = !{!"_ZTS12SceneManager", !12, i64 0, !11, i64 8}
!27 = !{!28, !8, i64 24}
!28 = !{!"_ZTS8Particle", !13, i64 0, !7, i64 4, !7, i64 12, !8, i64 20, !8, i64 24, !8, i64 28, !7, i64 32, !9, i64 40}
!29 = !{!30, !8, i64 20}
!30 = !{!"_ZTS8Settings", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !13, i64 16, !8, i64 20, !8, i64 24, !13, i64 28, !7, i64 32, !13, i64 40, !13, i64 41, !13, i64 42, !13, i64 43, !13, i64 44, !8, i64 48, !8, i64 52, !8, i64 56, !8, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !8, i64 76, !13, i64 80}
!31 = !{!30, !8, i64 24}
!32 = !{!28, !8, i64 28}
!33 = !{!34, !34, i64 0}
!34 = !{!"double", !9, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass