; LLVM IR from Whittler23/A-star-algorithm-SFML :: src/application.ll (ZN11Application13processEventsEv)

; 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.sf::Event" = type { i32, %union.anon.35 }
%union.anon.35 = type { %"struct.sf::Event::MouseWheelScrollEvent" }
%"struct.sf::Event::MouseWheelScrollEvent" = type { i32, float, i32, i32 }
%class.Application = type <{ %"class.sf::RenderWindow", %class.Grid, %class.Gui, %struct.MousePositions, %class.InformationWindow, %class.PathSolver, i8, [7 x i8] }>
%"class.sf::RenderWindow" = type { %"class.sf::Window", %"class.sf::RenderTarget" }
%"class.sf::Window" = type { ptr, ptr, ptr, %"class.sf::Clock", %"class.sf::Time", %"class.sf::Vector2" }
%"class.sf::Clock" = type { %"class.sf::Time" }
%"class.sf::Time" = type { i64 }
%"class.sf::Vector2" = type { i32, i32 }
%"class.sf::RenderTarget" = type { ptr, %"class.sf::View", %"class.sf::View", %"struct.sf::RenderTarget::StatesCache", i64 }
%"class.sf::View" = type <{ %"class.sf::Vector2.0", %"class.sf::Vector2.0", float, %"class.sf::Rect", %"class.sf::Transform", %"class.sf::Transform", i8, i8, [2 x i8] }>
%"class.sf::Vector2.0" = type { float, float }
%"class.sf::Rect" = type { float, float, float, float }
%"class.sf::Transform" = type { [16 x float] }
%"struct.sf::RenderTarget::StatesCache" = type <{ i8, i8, i8, i8, %"struct.sf::BlendMode", [4 x i8], i64, i8, i8, [2 x i8], [4 x %"class.sf::Vertex"], [4 x i8] }>
%"struct.sf::BlendMode" = type { i32, i32, i32, i32, i32, i32 }
%"class.sf::Vertex" = type { %"class.sf::Vector2.0", %"class.sf::Color", %"class.sf::Vector2.0" }
%"class.sf::Color" = type { i8, i8, i8, i8 }
%class.Grid = type <{ %"class.sf::Drawable", %"class.std::vector", ptr, ptr, i32, i32, i32, i8, [3 x i8] }>
%"class.sf::Drawable" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::unique_ptr<Node>, std::allocator<std::unique_ptr<Node>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::unique_ptr<Node>, std::allocator<std::unique_ptr<Node>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::unique_ptr<Node>, std::allocator<std::unique_ptr<Node>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::unique_ptr<Node>, std::allocator<std::unique_ptr<Node>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.Gui = type <{ ptr, %"class.std::map", i8, [7 x i8] }>
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<Button>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<Button>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<Button>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::unique_ptr<Button>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%struct.MousePositions = type { %"class.sf::Vector2.0", %"class.sf::Vector2.4" }
%"class.sf::Vector2.4" = type { i32, i32 }
%class.InformationWindow = type { %"class.sf::Drawable", %"class.sf::RectangleShape", %"class.sf::Text", %"class.sf::Font" }
%"class.sf::RectangleShape" = type { %"class.sf::Shape", %"class.sf::Vector2.0" }
%"class.sf::Shape" = type { %"class.sf::Drawable", %"class.sf::Transformable.base", ptr, %"class.sf::Rect.5", %"class.sf::Color", %"class.sf::Color", float, [4 x i8], %"class.sf::VertexArray", %"class.sf::VertexArray", %"class.sf::Rect", %"class.sf::Rect" }
%"class.sf::Transformable.base" = type <{ ptr, %"class.sf::Vector2.0", %"class.sf::Vector2.0", float, %"class.sf::Vector2.0", %"class.sf::Transform", i8, [3 x i8], %"class.sf::Transform", i8 }>
%"class.sf::Rect.5" = type { i32, i32, i32, i32 }
%"class.sf::VertexArray" = type <{ %"class.sf::Drawable", %"class.std::vector.6", i32, [4 x i8] }>
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<sf::Vertex, std::allocator<sf::Vertex>>::_Vector_impl" }
%"struct.std::_Vector_base<sf::Vertex, std::allocator<sf::Vertex>>::_Vector_impl" = type { %"struct.std::_Vector_base<sf::Vertex, std::allocator<sf::Vertex>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sf::Vertex, std::allocator<sf::Vertex>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.sf::Text" = type { %"class.sf::Drawable", %"class.sf::Transformable.base", %"class.sf::String", ptr, i32, float, float, i32, %"class.sf::Color", %"class.sf::Color", float, [4 x i8], %"class.sf::VertexArray", %"class.sf::VertexArray", %"class.sf::Rect", i8, i64 }
%"class.sf::String" = type { %"class.std::__cxx11::basic_string" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<unsigned int>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<unsigned int>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.sf::Font" = type { ptr, ptr, ptr, ptr, ptr, %"struct.sf::Font::Info", %"class.std::map.19", %"class.std::vector.25" }
%"struct.sf::Font::Info" = type { %"class.std::__cxx11::basic_string.14" }
%"class.std::__cxx11::basic_string.14" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon.18 }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon.18 = type { i64, [8 x i8] }
%"class.std::map.19" = type { %"class.std::_Rb_tree.20" }
%"class.std::_Rb_tree.20" = type { %"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, sf::Font::Page>, std::_Select1st<std::pair<const unsigned int, sf::Font::Page>>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, std::pair<const unsigned int, sf::Font::Page>, std::_Select1st<std::pair<const unsigned int, sf::Font::Page>>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector.25" = type { %"struct.std::_Vector_base.26" }
%"struct.std::_Vector_base.26" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.PathSolver = type <{ ptr, %class.PathDrawer, %"class.std::vector.30", %"class.std::vector.30", ptr, ptr, ptr, %"class.sf::Time", i8, [7 x i8] }>
%class.PathDrawer = type <{ %"class.std::vector.30", %"class.sf::Clock", i32, i8, [3 x i8] }>
%"class.std::vector.30" = type { %"struct.std::_Vector_base.31" }
%"struct.std::_Vector_base.31" = type { %"struct.std::_Vector_base<Node *, std::allocator<Node *>>::_Vector_impl" }
%"struct.std::_Vector_base<Node *, std::allocator<Node *>>::_Vector_impl" = type { %"struct.std::_Vector_base<Node *, std::allocator<Node *>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Node *, std::allocator<Node *>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; 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
define dso_local void @_ZN11Application13processEventsEv(ptr noundef nonnull align 8 dereferenceable(1673) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.sf::Event", align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 20, ptr %3) #4
  br label %5

5:                                                ; preds = %16, %1
  %6 = getelementptr inbounds %class.Application, ptr %4, i32 0, i32 0
  %7 = call noundef zeroext i1 @_ZN2sf6Window9pollEventERNS_5EventE(ptr noundef nonnull align 8 dereferenceable(48) %6, ptr noundef nonnull align 4 dereferenceable(20) %3)
  br i1 %7, label %8, label %17

8:                                                ; preds = %5
  %9 = getelementptr inbounds %class.Application, ptr %4, i32 0, i32 2
  %10 = getelementptr inbounds %class.Application, ptr %4, i32 0, i32 3
  call void @_ZN3Gui13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(57) %9, ptr noundef nonnull align 4 dereferenceable(20) %3, ptr noundef nonnull align 4 dereferenceable(16) %10)
  call void @_ZN11Application24processApplicationEventsERN2sf5EventE(ptr noundef nonnull align 8 dereferenceable(1673) %4, ptr noundef nonnull align 4 dereferenceable(20) %3)
  %11 = getelementptr inbounds %class.Application, ptr %4, i32 0, i32 2
  %12 = call noundef zeroext i1 @_ZN3Gui13getInteractedEv(ptr noundef nonnull align 8 dereferenceable(57) %11)
  br i1 %12, label %16, label %13

13:                                               ; preds = %8
  %14 = getelementptr inbounds %class.Application, ptr %4, i32 0, i32 1
  %15 = getelementptr inbounds %class.Application, ptr %4, i32 0, i32 3
  call void @_ZN4Grid13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(61) %14, ptr noundef nonnull align 4 dereferenceable(20) %3, ptr noundef nonnull align 4 dereferenceable(16) %15)
  br label %16

16:                                               ; preds = %13, %8
  br label %5, !llvm.loop !9

17:                                               ; preds = %5
  call void @llvm.lifetime.end.p0(i64 20, ptr %3) #4
  ret void
}

declare noundef zeroext i1 @_ZN2sf6Window9pollEventERNS_5EventE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(20)) #2

declare void @_ZN3Gui13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(57), ptr noundef nonnull align 4 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(16)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11Application24processApplicationEventsERN2sf5EventE(ptr noundef nonnull align 8 dereferenceable(1673), ptr noundef nonnull align 4 dereferenceable(20)) #3 align 2

declare noundef zeroext i1 @_ZN3Gui13getInteractedEv(ptr noundef nonnull align 8 dereferenceable(57)) #2

declare void @_ZN4Grid13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(61), ptr noundef nonnull align 4 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(16)) #2

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 = { "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 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; 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.sf::Event" = type { i32, %union.anon.35 }
%union.anon.35 = type { %"struct.sf::Event::MouseWheelScrollEvent" }
%"struct.sf::Event::MouseWheelScrollEvent" = type { i32, float, i32, i32 }

; 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
define dso_local void @_ZN11Application13processEventsEv(ptr noundef nonnull align 8 dereferenceable(1673) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca %"class.sf::Event", align 4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #4
  %3 = call noundef zeroext i1 @_ZN2sf6Window9pollEventERNS_5EventE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 4 dereferenceable(20) %2)
  br i1 %3, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 592
  %5 = getelementptr inbounds i8, ptr %0, i64 656
  %6 = getelementptr inbounds i8, ptr %0, i64 528
  br label %7

7:                                                ; preds = %.lr.ph, %10
  call void @_ZN3Gui13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(57) %4, ptr noundef nonnull align 4 dereferenceable(20) %2, ptr noundef nonnull align 4 dereferenceable(16) %5)
  call void @_ZN11Application24processApplicationEventsERN2sf5EventE(ptr noundef nonnull align 8 dereferenceable(1673) %0, ptr noundef nonnull align 4 dereferenceable(20) %2)
  %8 = call noundef zeroext i1 @_ZN3Gui13getInteractedEv(ptr noundef nonnull align 8 dereferenceable(57) %4)
  br i1 %8, label %10, label %9

9:                                                ; preds = %7
  call void @_ZN4Grid13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(61) %6, ptr noundef nonnull align 4 dereferenceable(20) %2, ptr noundef nonnull align 4 dereferenceable(16) %5)
  br label %10

10:                                               ; preds = %9, %7
  %11 = call noundef zeroext i1 @_ZN2sf6Window9pollEventERNS_5EventE(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef nonnull align 4 dereferenceable(20) %2)
  br i1 %11, label %7, label %._crit_edge, !llvm.loop !5

._crit_edge:                                      ; preds = %10, %1
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #4
  ret void
}

declare noundef zeroext i1 @_ZN2sf6Window9pollEventERNS_5EventE(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #2

declare void @_ZN3Gui13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(57), ptr noundef nonnull align 4 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11Application24processApplicationEventsERN2sf5EventE(ptr noundef nonnull align 8 dereferenceable(1673), ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #3 align 2

declare noundef zeroext i1 @_ZN3Gui13getInteractedEv(ptr noundef nonnull align 8 dereferenceable(57)) local_unnamed_addr #2

declare void @_ZN4Grid13processEventsERN2sf5EventER14MousePositions(ptr noundef nonnull align 8 dereferenceable(61), ptr noundef nonnull align 4 dereferenceable(20), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2

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 = { "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 = { 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 #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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass