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

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

@settings = external global %struct.Settings, align 4
@camera = external global %struct.Camera, align 4
@scene_manager = external global %struct.SceneManager, align 8

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

declare i32 @glfwGetMouseButton(ptr noundef, i32 noundef) #0

declare <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20), <2 x float>) #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13WindowManager13InputCallbackEv(ptr noundef nonnull align 8 dereferenceable(44) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %struct.vec2, align 4
  %4 = alloca %struct.vec2, align 4
  %5 = alloca %struct.vec2, align 4
  %6 = alloca %struct.vec2, align 4
  %7 = alloca %struct.vec2, align 4
  %8 = alloca %struct.vec2, align 4
  %9 = alloca %struct.vec2, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %10 = load ptr, ptr %2, align 8
  %11 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 3
  %12 = load ptr, ptr %11, align 8, !tbaa !9
  %13 = call i32 @glfwGetMouseButton(ptr noundef %12, i32 noundef 0)
  %14 = icmp ne i32 %13, 0
  %15 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 6
  %16 = zext i1 %14 to i8
  store i8 %16, ptr %15, align 8, !tbaa !15
  %17 = call noundef nonnull align 8 dereferenceable(3016) ptr @_ZN5ImGui5GetIOEv()
  %18 = getelementptr inbounds %struct.ImGuiIO, ptr %17, i32 0, i32 52
  %19 = load i8, ptr %18, align 8, !tbaa !16, !range !22, !noundef !23
  %20 = trunc i8 %19 to i1
  %21 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 7
  %22 = zext i1 %20 to i8
  store i8 %22, ptr %21, align 1, !tbaa !24
  %23 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  %25 = call i32 @glfwGetKey(ptr noundef %24, i32 noundef 341)
  %26 = icmp ne i32 %25, 0
  %27 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 8
  %28 = zext i1 %26 to i8
  store i8 %28, ptr %27, align 2, !tbaa !25
  %29 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %30 = getelementptr inbounds %struct.Scene, ptr %29, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !28
  %32 = icmp ne ptr %31, null
  %33 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 9
  %34 = zext i1 %32 to i8
  store i8 %34, ptr %33, align 1, !tbaa !31
  %35 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 3
  %36 = load ptr, ptr %35, align 8, !tbaa !9
  %37 = call i32 @glfwGetKey(ptr noundef %36, i32 noundef 82)
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %51

39:                                               ; preds = %1
  %40 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 8
  %41 = load i8, ptr %40, align 2, !tbaa !25, !range !22, !noundef !23
  %42 = trunc i8 %41 to i1
  br i1 %42, label %51, label %43

43:                                               ; preds = %39
  %44 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %45 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %4, ptr align 8 %45, i64 8, i1 false), !tbaa.struct !32
  %46 = load <2 x float>, ptr %4, align 4
  %47 = call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %46)
  store <2 x float> %47, ptr %3, align 4
  %48 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 18), align 4, !tbaa !34
  %49 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 17), align 4, !tbaa !36
  %50 = load <2 x float>, ptr %3, align 4
  call void @_ZN5Scene17AddRepulsionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52) %44, <2 x float> %50, float noundef %48, float noundef %49)
  br label %51

51:                                               ; preds = %43, %39, %1
  %52 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 3
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = call i32 @glfwGetKey(ptr noundef %53, i32 noundef 65)
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %68

56:                                               ; preds = %51
  %57 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 8
  %58 = load i8, ptr %57, align 2, !tbaa !25, !range !22, !noundef !23
  %59 = trunc i8 %58 to i1
  br i1 %59, label %68, label %60

60:                                               ; preds = %56
  %61 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %62 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %62, i64 8, i1 false), !tbaa.struct !32
  %63 = load <2 x float>, ptr %6, align 4
  %64 = call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %63)
  store <2 x float> %64, ptr %5, align 4
  %65 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 20), align 4, !tbaa !37
  %66 = load float, ptr getelementptr inbounds (%struct.Settings, ptr @settings, i32 0, i32 19), align 4, !tbaa !38
  %67 = load <2 x float>, ptr %5, align 4
  call void @_ZN5Scene18AddAttractionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52) %61, <2 x float> %67, float noundef %65, float noundef %66)
  br label %68

68:                                               ; preds = %60, %56, %51
  %69 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 6
  %70 = load i8, ptr %69, align 8, !tbaa !15, !range !22, !noundef !23
  %71 = trunc i8 %70 to i1
  br i1 %71, label %72, label %112

72:                                               ; preds = %68
  %73 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 7
  %74 = load i8, ptr %73, align 1, !tbaa !24, !range !22, !noundef !23
  %75 = trunc i8 %74 to i1
  br i1 %75, label %112, label %76

76:                                               ; preds = %72
  %77 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 8
  %78 = load i8, ptr %77, align 2, !tbaa !25, !range !22, !noundef !23
  %79 = trunc i8 %78 to i1
  br i1 %79, label %112, label %80

80:                                               ; preds = %76
  %81 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 9
  %82 = load i8, ptr %81, align 1, !tbaa !31, !range !22, !noundef !23
  %83 = trunc i8 %82 to i1
  br i1 %83, label %84, label %112

84:                                               ; preds = %80
  %85 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %86 = getelementptr inbounds %struct.Scene, ptr %85, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !39
  %88 = icmp eq i32 %87, -1
  br i1 %88, label %89, label %103

89:                                               ; preds = %84
  %90 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %91 = getelementptr inbounds %struct.Scene, ptr %90, i32 0, i32 3
  %92 = load ptr, ptr %91, align 8, !tbaa !40
  %93 = getelementptr inbounds %struct.Particle, ptr %92, i32 0, i32 0
  %94 = load i8, ptr %93, align 4, !tbaa !41, !range !22, !noundef !23
  %95 = trunc i8 %94 to i1
  %96 = zext i1 %95 to i32
  %97 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %98 = getelementptr inbounds %struct.Scene, ptr %97, i32 0, i32 4
  store i32 %96, ptr %98, align 8, !tbaa !39
  %99 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %100 = getelementptr inbounds %struct.Scene, ptr %99, i32 0, i32 3
  %101 = load ptr, ptr %100, align 8, !tbaa !40
  %102 = getelementptr inbounds %struct.Particle, ptr %101, i32 0, i32 0
  store i8 1, ptr %102, align 4, !tbaa !41
  br label %103

103:                                              ; preds = %89, %84
  %104 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %105 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %106 = getelementptr inbounds %struct.Scene, ptr %105, i32 0, i32 3
  %107 = load ptr, ptr %106, align 8, !tbaa !40
  %108 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 8 %108, i64 8, i1 false), !tbaa.struct !32
  %109 = load <2 x float>, ptr %8, align 4
  %110 = call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %109)
  store <2 x float> %110, ptr %7, align 4
  %111 = load <2 x float>, ptr %7, align 4
  call void @_ZN5Scene12MoveParticleEP8Particle4vec2(ptr noundef nonnull align 8 dereferenceable(52) %104, ptr noundef %107, <2 x float> %111)
  br label %133

112:                                              ; preds = %80, %76, %72, %68
  %113 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %114 = getelementptr inbounds %struct.Scene, ptr %113, i32 0, i32 4
  %115 = load i32, ptr %114, align 8, !tbaa !39
  %116 = icmp ne i32 %115, -1
  br i1 %116, label %117, label %129

117:                                              ; preds = %112
  %118 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %119 = getelementptr inbounds %struct.Scene, ptr %118, i32 0, i32 4
  %120 = load i32, ptr %119, align 8, !tbaa !39
  %121 = icmp ne i32 %120, 0
  %122 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %123 = getelementptr inbounds %struct.Scene, ptr %122, i32 0, i32 3
  %124 = load ptr, ptr %123, align 8, !tbaa !40
  %125 = getelementptr inbounds %struct.Particle, ptr %124, i32 0, i32 0
  %126 = zext i1 %121 to i8
  store i8 %126, ptr %125, align 4, !tbaa !41
  %127 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %128 = getelementptr inbounds %struct.Scene, ptr %127, i32 0, i32 4
  store i32 -1, ptr %128, align 8, !tbaa !39
  br label %129

129:                                              ; preds = %117, %112
  %130 = load ptr, ptr @scene_manager, align 8, !tbaa !26
  %131 = getelementptr inbounds %struct.WindowManager, ptr %10, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 8 %131, i64 8, i1 false), !tbaa.struct !32
  %132 = load <2 x float>, ptr %9, align 4
  call void @_ZN5Scene22UpdateSelectedParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52) %130, <2 x float> %132)
  br label %133

133:                                              ; preds = %129, %103
  ret void
}

declare void @_ZN5Scene17AddRepulsionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>, float noundef, float noundef) #0

declare void @_ZN5Scene18AddAttractionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>, float noundef, float noundef) #0

declare void @_ZN5Scene12MoveParticleEP8Particle4vec2(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef, <2 x float>) #0

declare void @_ZN5Scene22UpdateSelectedParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>) #0

attributes #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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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" }

!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, !6, i64 16}
!10 = !{!"_ZTS13WindowManager", !11, i64 0, !13, i64 8, !13, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !14, i64 40, !14, i64 41, !14, i64 42, !14, i64 43}
!11 = !{!"_ZTS4vec2", !12, i64 0, !12, i64 4}
!12 = !{!"float", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!10, !14, i64 40}
!16 = !{!17, !14, i64 176}
!17 = !{!"_ZTS7ImGuiIO", !13, i64 0, !13, i64 4, !18, i64 8, !12, i64 16, !12, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !12, i64 56, !14, i64 60, !6, i64 64, !18, i64 72, !14, i64 80, !14, i64 81, !14, i64 82, !14, i64 83, !14, i64 84, !14, i64 85, !14, i64 86, !14, i64 87, !14, i64 88, !14, i64 89, !14, i64 90, !14, i64 91, !14, i64 92, !14, i64 93, !14, i64 94, !14, i64 95, !14, i64 96, !12, i64 100, !12, i64 104, !12, i64 108, !12, i64 112, !12, i64 116, !12, i64 120, !14, i64 124, !14, i64 125, !14, i64 126, !14, i64 127, !14, i64 128, !14, i64 129, !14, i64 130, !14, i64 131, !14, i64 132, !14, i64 133, !14, i64 134, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !14, i64 176, !14, i64 177, !14, i64 178, !14, i64 179, !14, i64 180, !14, i64 181, !14, i64 182, !12, i64 184, !13, i64 188, !13, i64 192, !13, i64 196, !13, i64 200, !18, i64 204, !6, i64 216, !18, i64 224, !7, i64 232, !12, i64 240, !12, i64 244, !19, i64 248, !14, i64 252, !14, i64 253, !14, i64 254, !14, i64 255, !13, i64 256, !7, i64 260, !14, i64 2724, !18, 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, !14, i64 2906, !14, i64 2907, !7, i64 2908, !7, i64 2928, !7, i64 2948, !12, i64 2968, !14, i64 2972, !14, i64 2973, !20, i64 2974, !21, i64 2976, !6, i64 2992, !6, i64 3000, !6, i64 3008}
!18 = !{!"_ZTS6ImVec2", !12, i64 0, !12, i64 4}
!19 = !{!"_ZTS16ImGuiMouseSource", !7, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = !{!"_ZTS8ImVectorItE", !13, i64 0, !13, i64 4, !6, i64 8}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!10, !14, i64 41}
!25 = !{!10, !14, i64 42}
!26 = !{!27, !6, i64 0}
!27 = !{!"_ZTS12SceneManager", !6, i64 0, !13, i64 8}
!28 = !{!29, !6, i64 32}
!29 = !{!"_ZTS5Scene", !30, i64 8, !6, i64 32, !6, i64 40, !13, i64 48}
!30 = !{!"_ZTS12SceneColours", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !13, i64 16, !13, i64 20}
!31 = !{!10, !14, i64 43}
!32 = !{i64 0, i64 4, !33, i64 4, i64 4, !33}
!33 = !{!12, !12, i64 0}
!34 = !{!35, !12, i64 52}
!35 = !{!"_ZTS8Settings", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12, !14, i64 16, !12, i64 20, !12, i64 24, !14, i64 28, !11, i64 32, !14, i64 40, !14, i64 41, !14, i64 42, !14, i64 43, !14, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !13, i64 64, !13, i64 68, !13, i64 72, !12, i64 76, !14, i64 80}
!36 = !{!35, !12, i64 48}
!37 = !{!35, !12, i64 60}
!38 = !{!35, !12, i64 56}
!39 = !{!29, !13, i64 48}
!40 = !{!29, !6, i64 40}
!41 = !{!42, !14, i64 0}
!42 = !{!"_ZTS8Particle", !14, i64 0, !11, i64 4, !11, i64 12, !12, i64 20, !12, i64 24, !12, i64 28, !11, i64 32, !7, 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.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.SceneManager = type <{ ptr, i32, [4 x i8] }>

@settings = external local_unnamed_addr global %struct.Settings, align 4
@camera = external global %struct.Camera, align 4
@scene_manager = external local_unnamed_addr global %struct.SceneManager, align 8

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

declare i32 @glfwGetMouseButton(ptr noundef, i32 noundef) local_unnamed_addr #0

declare <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20), <2 x float>) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13WindowManager13InputCallbackEv(ptr nocapture noundef nonnull align 8 dereferenceable(44) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = tail call i32 @glfwGetMouseButton(ptr noundef %3, i32 noundef 0)
  %5 = icmp ne i32 %4, 0
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = zext i1 %5 to i8
  store i8 %7, ptr %6, align 8, !tbaa !14
  %8 = tail call noundef nonnull align 8 dereferenceable(3016) ptr @_ZN5ImGui5GetIOEv()
  %9 = getelementptr inbounds i8, ptr %8, i64 176
  %10 = load i8, ptr %9, align 8, !tbaa !15, !range !21, !noundef !22
  %11 = getelementptr inbounds i8, ptr %0, i64 41
  store i8 %10, ptr %11, align 1, !tbaa !23
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = tail call i32 @glfwGetKey(ptr noundef %12, i32 noundef 341)
  %14 = icmp ne i32 %13, 0
  %15 = getelementptr inbounds i8, ptr %0, i64 42
  %16 = zext i1 %14 to i8
  store i8 %16, ptr %15, align 2, !tbaa !24
  %17 = load ptr, ptr @scene_manager, align 8, !tbaa !25
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !27
  %20 = icmp ne ptr %19, null
  %21 = getelementptr inbounds i8, ptr %0, i64 43
  %22 = zext i1 %20 to i8
  store i8 %22, ptr %21, align 1, !tbaa !30
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = tail call i32 @glfwGetKey(ptr noundef %23, i32 noundef 82)
  %.not = icmp eq i32 %24, 0
  br i1 %.not, label %33, label %25

25:                                               ; preds = %1
  %26 = load i8, ptr %15, align 2, !tbaa !24, !range !21, !noundef !22
  %27 = trunc nuw i8 %26 to i1
  br i1 %27, label %33, label %28

28:                                               ; preds = %25
  %29 = load ptr, ptr @scene_manager, align 8, !tbaa !25
  %.sroa.05.0.copyload = load <2 x float>, ptr %0, align 8
  %30 = tail call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %.sroa.05.0.copyload)
  %31 = load float, ptr getelementptr inbounds (i8, ptr @settings, i64 52), align 4, !tbaa !31
  %32 = load float, ptr getelementptr inbounds (i8, ptr @settings, i64 48), align 4, !tbaa !33
  tail call void @_ZN5Scene17AddRepulsionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52) %29, <2 x float> %30, float noundef %31, float noundef %32)
  br label %33

33:                                               ; preds = %28, %25, %1
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = tail call i32 @glfwGetKey(ptr noundef %34, i32 noundef 65)
  %.not7 = icmp eq i32 %35, 0
  br i1 %.not7, label %44, label %36

36:                                               ; preds = %33
  %37 = load i8, ptr %15, align 2, !tbaa !24, !range !21, !noundef !22
  %38 = trunc nuw i8 %37 to i1
  br i1 %38, label %44, label %39

39:                                               ; preds = %36
  %40 = load ptr, ptr @scene_manager, align 8, !tbaa !25
  %.sroa.03.0.copyload = load <2 x float>, ptr %0, align 8
  %41 = tail call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %.sroa.03.0.copyload)
  %42 = load float, ptr getelementptr inbounds (i8, ptr @settings, i64 60), align 4, !tbaa !34
  %43 = load float, ptr getelementptr inbounds (i8, ptr @settings, i64 56), align 4, !tbaa !35
  tail call void @_ZN5Scene18AddAttractionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52) %40, <2 x float> %41, float noundef %42, float noundef %43)
  br label %44

44:                                               ; preds = %39, %36, %33
  %45 = load i8, ptr %6, align 8, !tbaa !14, !range !21, !noundef !22
  %46 = trunc nuw i8 %45 to i1
  br i1 %46, label %47, label %67

47:                                               ; preds = %44
  %48 = load i8, ptr %11, align 1, !tbaa !23, !range !21, !noundef !22
  %49 = trunc nuw i8 %48 to i1
  br i1 %49, label %67, label %50

50:                                               ; preds = %47
  %51 = load i8, ptr %15, align 2, !tbaa !24, !range !21, !noundef !22
  %52 = trunc nuw i8 %51 to i1
  br i1 %52, label %67, label %53

53:                                               ; preds = %50
  %54 = load i8, ptr %21, align 1, !tbaa !30, !range !21, !noundef !22
  %55 = trunc nuw i8 %54 to i1
  br i1 %55, label %56, label %67

56:                                               ; preds = %53
  %57 = load ptr, ptr @scene_manager, align 8, !tbaa !25
  %58 = getelementptr inbounds i8, ptr %57, i64 48
  %59 = load i32, ptr %58, align 8, !tbaa !36
  %60 = icmp eq i32 %59, -1
  %61 = getelementptr inbounds i8, ptr %57, i64 40
  %62 = load ptr, ptr %61, align 8, !tbaa !37
  br i1 %60, label %63, label %._crit_edge

63:                                               ; preds = %56
  %64 = load i8, ptr %62, align 4, !tbaa !38, !range !21, !noundef !22
  %65 = zext nneg i8 %64 to i32
  store i32 %65, ptr %58, align 8, !tbaa !36
  store i8 1, ptr %62, align 4, !tbaa !38
  br label %._crit_edge

._crit_edge:                                      ; preds = %56, %63
  %.sroa.01.0.copyload = load <2 x float>, ptr %0, align 8
  %66 = tail call <2 x float> @_ZN6Camera23ScreenSpaceToWorldSpaceE4vec2(ptr noundef nonnull align 4 dereferenceable(20) @camera, <2 x float> %.sroa.01.0.copyload)
  tail call void @_ZN5Scene12MoveParticleEP8Particle4vec2(ptr noundef nonnull align 8 dereferenceable(52) %57, ptr noundef %62, <2 x float> %66)
  br label %77

67:                                               ; preds = %53, %50, %47, %44
  %68 = load ptr, ptr @scene_manager, align 8, !tbaa !25
  %69 = getelementptr inbounds i8, ptr %68, i64 48
  %70 = load i32, ptr %69, align 8, !tbaa !36
  %.not8 = icmp eq i32 %70, -1
  br i1 %.not8, label %76, label %71

71:                                               ; preds = %67
  %72 = icmp ne i32 %70, 0
  %73 = getelementptr inbounds i8, ptr %68, i64 40
  %74 = load ptr, ptr %73, align 8, !tbaa !37
  %75 = zext i1 %72 to i8
  store i8 %75, ptr %74, align 4, !tbaa !38
  store i32 -1, ptr %69, align 8, !tbaa !36
  br label %76

76:                                               ; preds = %71, %67
  %.sroa.0.0.copyload = load <2 x float>, ptr %0, align 8
  tail call void @_ZN5Scene22UpdateSelectedParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52) %68, <2 x float> %.sroa.0.0.copyload)
  br label %77

77:                                               ; preds = %76, %._crit_edge
  ret void
}

declare void @_ZN5Scene17AddRepulsionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>, float noundef, float noundef) local_unnamed_addr #0

declare void @_ZN5Scene18AddAttractionForceE4vec2ff(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>, float noundef, float noundef) local_unnamed_addr #0

declare void @_ZN5Scene12MoveParticleEP8Particle4vec2(ptr noundef nonnull align 8 dereferenceable(52), ptr noundef, <2 x float>) local_unnamed_addr #0

declare void @_ZN5Scene22UpdateSelectedParticleE4vec2(ptr noundef nonnull align 8 dereferenceable(52), <2 x float>) local_unnamed_addr #0

attributes #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 = { 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" }

!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 = !{!6, !13, i64 40}
!15 = !{!16, !13, i64 176}
!16 = !{!"_ZTS7ImGuiIO", !11, i64 0, !11, i64 4, !17, 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, !17, 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, !17, i64 204, !12, i64 216, !17, i64 224, !9, i64 232, !8, i64 240, !8, i64 244, !18, i64 248, !13, i64 252, !13, i64 253, !13, i64 254, !13, i64 255, !11, i64 256, !9, i64 260, !13, i64 2724, !17, 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, !19, i64 2974, !20, i64 2976, !12, i64 2992, !12, i64 3000, !12, i64 3008}
!17 = !{!"_ZTS6ImVec2", !8, i64 0, !8, i64 4}
!18 = !{!"_ZTS16ImGuiMouseSource", !9, i64 0}
!19 = !{!"short", !9, i64 0}
!20 = !{!"_ZTS8ImVectorItE", !11, i64 0, !11, i64 4, !12, i64 8}
!21 = !{i8 0, i8 2}
!22 = !{}
!23 = !{!6, !13, i64 41}
!24 = !{!6, !13, i64 42}
!25 = !{!26, !12, i64 0}
!26 = !{!"_ZTS12SceneManager", !12, i64 0, !11, i64 8}
!27 = !{!28, !12, i64 32}
!28 = !{!"_ZTS5Scene", !29, i64 8, !12, i64 32, !12, i64 40, !11, i64 48}
!29 = !{!"_ZTS12SceneColours", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}
!30 = !{!6, !13, i64 43}
!31 = !{!32, !8, i64 52}
!32 = !{!"_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}
!33 = !{!32, !8, i64 48}
!34 = !{!32, !8, i64 60}
!35 = !{!32, !8, i64 56}
!36 = !{!28, !11, i64 48}
!37 = !{!28, !12, i64 40}
!38 = !{!39, !13, i64 0}
!39 = !{!"_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}


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