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

; 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.Node = type <{ %class.Tile, ptr, i32, i32, i32, i32, i32, [4 x i8] }>
%class.Tile = type { %"class.sf::Drawable", %"class.sf::Transformable.base", %"class.sf::RectangleShape" }
%"class.sf::Drawable" = type { ptr }
%"class.sf::Transformable.base" = type <{ ptr, %"class.sf::Vector2", %"class.sf::Vector2", float, %"class.sf::Vector2", %"class.sf::Transform", i8, [3 x i8], %"class.sf::Transform", i8 }>
%"class.sf::Vector2" = type { float, float }
%"class.sf::Transform" = type { [16 x float] }
%"class.sf::RectangleShape" = type { %"class.sf::Shape", %"class.sf::Vector2" }
%"class.sf::Shape" = type { %"class.sf::Drawable", %"class.sf::Transformable.base", ptr, %"class.sf::Rect", %"class.sf::Color", %"class.sf::Color", float, [4 x i8], %"class.sf::VertexArray", %"class.sf::VertexArray", %"class.sf::Rect.0", %"class.sf::Rect.0" }
%"class.sf::Rect" = type { i32, i32, i32, i32 }
%"class.sf::Color" = type { i8, i8, i8, i8 }
%"class.sf::VertexArray" = type <{ %"class.sf::Drawable", %"class.std::vector", i32, [4 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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::Rect.0" = type { float, float, float, float }
%"class.sf::Vector2.1" = type { i32, i32 }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Tile11changeColorE8NodeType(ptr noundef nonnull align 8 dereferenceable(528), i32 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4NodeC2ERKN2sf7Vector2IiEEi(ptr noundef nonnull align 8 dereferenceable(556) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %9 = load ptr, ptr %4, align 8
  %10 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = load i32, ptr %6, align 4, !tbaa !9
  call void @_ZN4TileC1ERKN2sf7Vector2IiEEi(ptr noundef nonnull align 8 dereferenceable(528) %10, ptr noundef nonnull align 4 dereferenceable(8) %11, i32 noundef %12)
  %13 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 1
  store ptr null, ptr %13, align 8, !tbaa !11
  %14 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 2
  store i32 4, ptr %14, align 8, !tbaa !32
  %15 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 3
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %"class.sf::Vector2.1", ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 4, !tbaa !33
  store i32 %18, ptr %15, align 4, !tbaa !35
  %19 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 4
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.sf::Vector2.1", ptr %20, i32 0, i32 1
  %22 = load i32, ptr %21, align 4, !tbaa !36
  store i32 %22, ptr %19, align 8, !tbaa !37
  %23 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 5
  store i32 0, ptr %23, align 4, !tbaa !38
  %24 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 6
  store i32 0, ptr %24, align 8, !tbaa !39
  %25 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 0
  %26 = getelementptr inbounds %class.Node, ptr %9, i32 0, i32 2
  %27 = load i32, ptr %26, align 8, !tbaa !32
  invoke void @_ZN4Tile11changeColorE8NodeType(ptr noundef nonnull align 8 dereferenceable(528) %25, i32 noundef %27)
          to label %28 unwind label %29

28:                                               ; preds = %3
  ret void

29:                                               ; preds = %3
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %7, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %8, align 4
  call void @_ZN4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(528) %10) #2
  br label %33

33:                                               ; preds = %29
  %34 = load ptr, ptr %7, align 8
  %35 = load i32, ptr %8, align 4
  %36 = insertvalue { ptr, i32 } poison, ptr %34, 0
  %37 = insertvalue { ptr, i32 } %36, i32 %35, 1
  resume { ptr, i32 } %37
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(528)) unnamed_addr #1 align 2

declare void @_ZN4TileC1ERKN2sf7Vector2IiEEi(ptr, ptr, i32)

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 = { 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 #2 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 528}
!12 = !{!"_ZTS4Node", !13, i64 0, !6, i64 528, !31, i64 536, !10, i64 540, !10, i64 544, !10, i64 548, !10, i64 552}
!13 = !{!"_ZTS4Tile", !14, i64 0, !15, i64 8, !20, i64 184}
!14 = !{!"_ZTSN2sf8DrawableE"}
!15 = !{!"_ZTSN2sf13TransformableE", !16, i64 8, !16, i64 16, !17, i64 24, !16, i64 28, !18, i64 36, !19, i64 100, !18, i64 104, !19, i64 168}
!16 = !{!"_ZTSN2sf7Vector2IfEE", !17, i64 0, !17, i64 4}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_ZTSN2sf9TransformE", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTSN2sf14RectangleShapeE", !21, i64 0, !16, i64 336}
!21 = !{!"_ZTSN2sf5ShapeE", !14, i64 0, !15, i64 8, !6, i64 184, !22, i64 192, !23, i64 208, !23, i64 212, !17, i64 216, !24, i64 224, !24, i64 264, !30, i64 304, !30, i64 320}
!22 = !{!"_ZTSN2sf4RectIiEE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!23 = !{!"_ZTSN2sf5ColorE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!24 = !{!"_ZTSN2sf11VertexArrayE", !14, i64 0, !25, i64 8, !29, i64 32}
!25 = !{!"_ZTSSt6vectorIN2sf6VertexESaIS1_EE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIN2sf6VertexESaIS1_EE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIN2sf6VertexESaIS1_EE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN2sf6VertexESaIS1_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!"_ZTSN2sf13PrimitiveTypeE", !7, i64 0}
!30 = !{!"_ZTSN2sf4RectIfEE", !17, i64 0, !17, i64 4, !17, i64 8, !17, i64 12}
!31 = !{!"_ZTS8NodeType", !7, i64 0}
!32 = !{!12, !31, i64 536}
!33 = !{!34, !10, i64 0}
!34 = !{!"_ZTSN2sf7Vector2IiEE", !10, i64 0, !10, i64 4}
!35 = !{!12, !10, i64 540}
!36 = !{!34, !10, i64 4}
!37 = !{!12, !10, i64 544}
!38 = !{!12, !10, i64 548}
!39 = !{!12, !10, i64 552}


; 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"

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4Tile11changeColorE8NodeType(ptr noundef nonnull align 8 dereferenceable(528), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4NodeC2ERKN2sf7Vector2IiEEi(ptr noundef nonnull align 8 dereferenceable(556) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, i32 noundef %2) unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  tail call void @_ZN4TileC1ERKN2sf7Vector2IiEEi(ptr noundef nonnull align 8 dereferenceable(528) %0, ptr noundef nonnull align 4 dereferenceable(8) %1, i32 noundef %2)
  %4 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr null, ptr %4, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 536
  store i32 4, ptr %5, align 8, !tbaa !30
  %6 = getelementptr inbounds i8, ptr %0, i64 540
  %7 = load <2 x i32>, ptr %1, align 4, !tbaa !31
  store <2 x i32> %7, ptr %6, align 4, !tbaa !31
  %8 = getelementptr inbounds i8, ptr %0, i64 548
  store i32 0, ptr %8, align 4, !tbaa !32
  %9 = getelementptr inbounds i8, ptr %0, i64 552
  store i32 0, ptr %9, align 8, !tbaa !33
  invoke void @_ZN4Tile11changeColorE8NodeType(ptr noundef nonnull align 8 dereferenceable(528) %0, i32 noundef 4)
          to label %10 unwind label %11

10:                                               ; preds = %3
  ret void

11:                                               ; preds = %3
  %12 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZN4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(528) %0) #2
  resume { ptr, i32 } %12
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN4TileD2Ev(ptr noundef nonnull align 8 dereferenceable(528)) unnamed_addr #1 align 2

declare void @_ZN4TileC1ERKN2sf7Vector2IiEEi(ptr, ptr, i32) local_unnamed_addr

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 = { 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 #2 = { 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, !18, i64 528}
!6 = !{!"_ZTS4Node", !7, i64 0, !18, i64 528, !29, i64 536, !20, i64 540, !20, i64 544, !20, i64 548, !20, i64 552}
!7 = !{!"_ZTS4Tile", !8, i64 0, !9, i64 8, !16, i64 184}
!8 = !{!"_ZTSN2sf8DrawableE"}
!9 = !{!"_ZTSN2sf13TransformableE", !10, i64 8, !10, i64 16, !11, i64 24, !10, i64 28, !14, i64 36, !15, i64 100, !14, i64 104, !15, i64 168}
!10 = !{!"_ZTSN2sf7Vector2IfEE", !11, i64 0, !11, i64 4}
!11 = !{!"float", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"_ZTSN2sf9TransformE", !12, i64 0}
!15 = !{!"bool", !12, i64 0}
!16 = !{!"_ZTSN2sf14RectangleShapeE", !17, i64 0, !10, i64 336}
!17 = !{!"_ZTSN2sf5ShapeE", !8, i64 0, !9, i64 8, !18, i64 184, !19, i64 192, !21, i64 208, !21, i64 212, !11, i64 216, !22, i64 224, !22, i64 264, !28, i64 304, !28, i64 320}
!18 = !{!"any pointer", !12, i64 0}
!19 = !{!"_ZTSN2sf4RectIiEE", !20, i64 0, !20, i64 4, !20, i64 8, !20, i64 12}
!20 = !{!"int", !12, i64 0}
!21 = !{!"_ZTSN2sf5ColorE", !12, i64 0, !12, i64 1, !12, i64 2, !12, i64 3}
!22 = !{!"_ZTSN2sf11VertexArrayE", !8, i64 0, !23, i64 8, !27, i64 32}
!23 = !{!"_ZTSSt6vectorIN2sf6VertexESaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSSt12_Vector_baseIN2sf6VertexESaIS1_EE", !25, i64 0}
!25 = !{!"_ZTSNSt12_Vector_baseIN2sf6VertexESaIS1_EE12_Vector_implE", !26, i64 0}
!26 = !{!"_ZTSNSt12_Vector_baseIN2sf6VertexESaIS1_EE17_Vector_impl_dataE", !18, i64 0, !18, i64 8, !18, i64 16}
!27 = !{!"_ZTSN2sf13PrimitiveTypeE", !12, i64 0}
!28 = !{!"_ZTSN2sf4RectIfEE", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!29 = !{!"_ZTS8NodeType", !12, i64 0}
!30 = !{!6, !29, i64 536}
!31 = !{!20, !20, i64 0}
!32 = !{!6, !20, i64 548}
!33 = !{!6, !20, i64 552}


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