; LLVM IR from mackorone/mms :: old/v2/src/mouse/floodFill/FloodFill.ll (ZN9floodFill9FloodFill7victoryEv)

; 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.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl" }
%"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl" = type { %"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.floodFill::FloodFill" = type <{ %class.IMouseAlgorithm, ptr, [16 x [16 x %"class.floodFill::Cell"]], i32, i32, i32, i32, i8, i8, [6 x i8], %"class.floodFill::History", i8, [7 x i8] }>
%class.IMouseAlgorithm = type { ptr }
%"class.floodFill::Cell" = type { i32, i32, i32, i8, i8, [4 x i8], [4 x i8], ptr, ptr }
%"class.floodFill::History" = type { i32, i32, ptr, %"class.std::stack", %"class.std::queue", %"class.std::__cxx11::list", %"class.std::__cxx11::list.183" }
%"class.std::queue" = type { %"class.std::deque.174" }
%"class.std::deque.174" = type { %"class.std::_Deque_base.175" }
%"class.std::_Deque_base.175" = type { %"struct.std::_Deque_base<std::stack<floodFill::Cell *>, std::allocator<std::stack<floodFill::Cell *>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::stack<floodFill::Cell *>, std::allocator<std::stack<floodFill::Cell *>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::stack<floodFill::Cell *>, std::allocator<std::stack<floodFill::Cell *>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::stack<floodFill::Cell *>, std::allocator<std::stack<floodFill::Cell *>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.179", %"struct.std::_Deque_iterator.179" }
%"struct.std::_Deque_iterator.179" = type { ptr, ptr, ptr, ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::__cxx11::list.183" = type { %"class.std::__cxx11::_List_base.184" }
%"class.std::__cxx11::_List_base.184" = type { %"struct.std::__cxx11::_List_base<std::__cxx11::list<floodFill::Cellmod>, std::allocator<std::__cxx11::list<floodFill::Cellmod>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::__cxx11::list<floodFill::Cellmod>, std::allocator<std::__cxx11::list<floodFill::Cellmod>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9floodFill9FloodFill7victoryEv(ptr noundef nonnull align 8 dereferenceable(10505) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::stack", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  br label %10

10:                                               ; preds = %102, %1
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #4
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br label %11

11:                                               ; preds = %40, %10
  %12 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 3
  %13 = load i32, ptr %12, align 8, !tbaa !9
  %14 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 4
  %15 = load i32, ptr %14, align 4, !tbaa !36
  %16 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505) %9, i32 noundef %13, i32 noundef %15)
          to label %17 unwind label %41

17:                                               ; preds = %11
  br i1 %16, label %27, label %18

18:                                               ; preds = %17
  %19 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %20 unwind label %41

20:                                               ; preds = %18
  br i1 %19, label %24, label %21

21:                                               ; preds = %20
  %22 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %23 unwind label %41

23:                                               ; preds = %21
  br label %24

24:                                               ; preds = %23, %20
  %25 = phi i1 [ true, %20 ], [ %22, %23 ]
  %26 = xor i1 %25, true
  br label %27

27:                                               ; preds = %24, %17
  %28 = phi i1 [ false, %17 ], [ %26, %24 ]
  br i1 %28, label %29, label %49

29:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %30 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 2
  %31 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 3
  %32 = load i32, ptr %31, align 8, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %30, i64 0, i64 %33
  %35 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 4
  %36 = load i32, ptr %35, align 4, !tbaa !36
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %34, i64 0, i64 %37
  store ptr %38, ptr %6, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %39 unwind label %45

39:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  invoke void @_ZN9floodFill9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %40 unwind label %41

40:                                               ; preds = %39
  br label %11, !llvm.loop !37

41:                                               ; preds = %95, %92, %90, %83, %80, %61, %58, %39, %21, %18, %11
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %4, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %5, align 4
  br label %103

45:                                               ; preds = %29
  %46 = landingpad { ptr, i32 }
          cleanup
  %47 = extractvalue { ptr, i32 } %46, 0
  store ptr %47, ptr %4, align 8
  %48 = extractvalue { ptr, i32 } %46, 1
  store i32 %48, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %103

49:                                               ; preds = %27
  br label %50

50:                                               ; preds = %75, %49
  %51 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 3
  %52 = load i32, ptr %51, align 8, !tbaa !9
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %58, label %54

54:                                               ; preds = %50
  %55 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 4
  %56 = load i32, ptr %55, align 4, !tbaa !36
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %67

58:                                               ; preds = %54, %50
  %59 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %60 unwind label %41

60:                                               ; preds = %58
  br i1 %59, label %64, label %61

61:                                               ; preds = %60
  %62 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %63 unwind label %41

63:                                               ; preds = %61
  br label %64

64:                                               ; preds = %63, %60
  %65 = phi i1 [ true, %60 ], [ %62, %63 ]
  %66 = xor i1 %65, true
  br label %67

67:                                               ; preds = %64, %54
  %68 = phi i1 [ false, %54 ], [ %66, %64 ]
  br i1 %68, label %69, label %80

69:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %70 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %71 unwind label %76

71:                                               ; preds = %69
  %72 = load ptr, ptr %70, align 8, !tbaa !5
  store ptr %72, ptr %7, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %73 unwind label %76

73:                                               ; preds = %71
  %74 = load ptr, ptr %7, align 8, !tbaa !5
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %9, ptr noundef %74)
          to label %75 unwind label %76

75:                                               ; preds = %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %50, !llvm.loop !39

76:                                               ; preds = %73, %71, %69
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %4, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %103

80:                                               ; preds = %67
  %81 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %82 unwind label %41

82:                                               ; preds = %80
  br i1 %81, label %95, label %83

83:                                               ; preds = %82
  %84 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %85 unwind label %41

85:                                               ; preds = %83
  br i1 %84, label %95, label %86

86:                                               ; preds = %85
  %87 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %9, i32 0, i32 5
  %88 = load i32, ptr %87, align 8, !tbaa !40
  %89 = icmp eq i32 %88, 2
  br i1 %89, label %90, label %92

90:                                               ; preds = %86
  invoke void @_ZN9floodFill9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %91 unwind label %41

91:                                               ; preds = %90
  br label %94

92:                                               ; preds = %86
  invoke void @_ZN9floodFill9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %93 unwind label %41

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93, %91
  br label %95

95:                                               ; preds = %94, %85, %82
  %96 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill19checkRequestVictoryEv(ptr noundef nonnull align 8 dereferenceable(10505) %9)
          to label %97 unwind label %41

97:                                               ; preds = %95
  br i1 %96, label %98, label %99

98:                                               ; preds = %97
  store i32 1, ptr %8, align 4
  br label %100

99:                                               ; preds = %97
  store i32 0, ptr %8, align 4
  br label %100

100:                                              ; preds = %99, %98
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #4
  %101 = load i32, ptr %8, align 4
  switch i32 %101, label %110 [
    i32 0, label %102
    i32 1, label %104
  ]

102:                                              ; preds = %100
  br label %10, !llvm.loop !41

103:                                              ; preds = %76, %45, %41
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #4
  br label %105

104:                                              ; preds = %100
  ret void

105:                                              ; preds = %103
  %106 = load ptr, ptr %4, align 8
  %107 = load i32, ptr %5, align 4
  %108 = insertvalue { ptr, i32 } poison, ptr %106, 0
  %109 = insertvalue { ptr, i32 } %108, i32 %107, 1
  resume { ptr, i32 } %109

110:                                              ; preds = %100
  unreachable
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505), ptr noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill19checkRequestVictoryEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !12, i64 10256}
!10 = !{!"_ZTSN9floodFill9FloodFillE", !11, i64 0, !6, i64 8, !7, i64 16, !12, i64 10256, !12, i64 10260, !12, i64 10264, !12, i64 10268, !13, i64 10272, !13, i64 10273, !14, i64 10280, !13, i64 10504}
!11 = !{!"_ZTS15IMouseAlgorithm"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN9floodFill7HistoryE", !12, i64 0, !12, i64 4, !6, i64 8, !15, i64 16, !22, i64 96, !28, i64 176, !33, i64 200}
!15 = !{!"_ZTSSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE", !16, i64 0}
!16 = !{!"_ZTSSt5dequeIPN9floodFill4CellESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt11_Deque_baseIPN9floodFill4CellESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE11_Deque_implE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !21, i64 16, !21, i64 48}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSSt15_Deque_iteratorIPN9floodFill4CellERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSSt5queueISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEES4_IS7_SaIS7_EEE", !23, i64 0}
!23 = !{!"_ZTSSt5dequeISt5stackIPN9floodFill4CellES_IS3_SaIS3_EEESaIS6_EE", !24, i64 0}
!24 = !{!"_ZTSSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE11_Deque_implE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !27, i64 16, !27, i64 48}
!27 = !{!"_ZTSSt15_Deque_iteratorISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEERS7_PS7_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !30, i64 0}
!30 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !31, i64 0}
!31 = !{!"_ZTSNSt8__detail17_List_node_headerE", !32, i64 0, !20, i64 16}
!32 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!33 = !{!"_ZTSNSt7__cxx114listINS0_IN9floodFill7CellmodESaIS2_EEESaIS4_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EE10_List_implE", !31, i64 0}
!36 = !{!10, !12, i64 10260}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}
!40 = !{!10, !12, i64 10264}
!41 = distinct !{!41, !38}


; 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.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl" }
%"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl" = type { %"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<floodFill::Cell *, std::allocator<floodFill::Cell *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"class.floodFill::Cell" = type { i32, i32, i32, i8, i8, [4 x i8], [4 x i8], ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9floodFill9FloodFill7victoryEv(ptr noundef nonnull align 8 dereferenceable(10505) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::stack", align 8
  %3 = alloca ptr, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 10256
  %5 = getelementptr inbounds i8, ptr %0, i64 10260
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = getelementptr inbounds i8, ptr %0, i64 10264
  br label %8

8:                                                ; preds = %53, %1
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #4
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br label %9

9:                                                ; preds = %25, %8
  %10 = load i32, ptr %4, align 8, !tbaa !5
  %11 = load i32, ptr %5, align 4, !tbaa !35
  %12 = call noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %10, i32 noundef %11)
  br i1 %12, label %.critedge.preheader, label %13

13:                                               ; preds = %9
  %14 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %15 unwind label %.loopexit.split-lp.loopexit

15:                                               ; preds = %13
  br i1 %14, label %.critedge.preheader, label %16

16:                                               ; preds = %15
  %17 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %18 unwind label %.loopexit.split-lp.loopexit

18:                                               ; preds = %16
  br i1 %17, label %.critedge.preheader, label %19

.critedge.preheader:                              ; preds = %15, %9, %18
  br label %.critedge

19:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %20 = load i32, ptr %4, align 8, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = load i32, ptr %5, align 4, !tbaa !35
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %6, i64 0, i64 %21, i64 %23
  store ptr %24, ptr %3, align 8, !tbaa !36
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %25 unwind label %26

25:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  invoke void @_ZN9floodFill9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %9 unwind label %.loopexit.split-lp.loopexit, !llvm.loop !37

.loopexit:                                        ; preds = %30, %33
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %25, %16, %13
  %lpad.loopexit12 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %51, %50, %49, %43, %.critedge2
  %lpad.loopexit.split-lp13 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

26:                                               ; preds = %19
  %27 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  br label %.loopexit.split-lp

.critedge:                                        ; preds = %.critedge.preheader, %36
  %28 = load i32, ptr %4, align 8, !tbaa !5
  %.not = icmp eq i32 %28, 0
  %29 = load i32, ptr %5, align 4
  %.not8 = icmp eq i32 %29, 0
  %or.cond = select i1 %.not, i1 %.not8, i1 false
  br i1 %or.cond, label %.critedge2, label %30

30:                                               ; preds = %.critedge
  %31 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %32 unwind label %.loopexit

32:                                               ; preds = %30
  br i1 %31, label %.critedge2, label %33

33:                                               ; preds = %32
  %34 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %35 unwind label %.loopexit

35:                                               ; preds = %33
  br i1 %34, label %.critedge2, label %36

36:                                               ; preds = %35
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %38 = load ptr, ptr %37, align 8, !tbaa !36
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef %38)
          to label %.critedge unwind label %39, !llvm.loop !39

39:                                               ; preds = %36
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.critedge2:                                       ; preds = %32, %.critedge, %35
  %41 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %42 unwind label %.loopexit.split-lp.loopexit.split-lp

42:                                               ; preds = %.critedge2
  br i1 %41, label %51, label %43

43:                                               ; preds = %42
  %44 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %45 unwind label %.loopexit.split-lp.loopexit.split-lp

45:                                               ; preds = %43
  br i1 %44, label %51, label %46

46:                                               ; preds = %45
  %47 = load i32, ptr %7, align 8, !tbaa !40
  %48 = icmp eq i32 %47, 2
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  invoke void @_ZN9floodFill9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %51 unwind label %.loopexit.split-lp.loopexit.split-lp

50:                                               ; preds = %46
  invoke void @_ZN9floodFill9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %51 unwind label %.loopexit.split-lp.loopexit.split-lp

51:                                               ; preds = %49, %50, %45, %42
  %52 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill19checkRequestVictoryEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %53 unwind label %.loopexit.split-lp.loopexit.split-lp

53:                                               ; preds = %51
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  br i1 %52, label %54, label %8

.loopexit.split-lp:                               ; preds = %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %39, %26
  %.pn = phi { ptr, i32 } [ %40, %39 ], [ %27, %26 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit12, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp13, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn

54:                                               ; preds = %53
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN9floodFill9FloodFill19checkRequestVictoryEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #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, !11, i64 10256}
!6 = !{!"_ZTSN9floodFill9FloodFillE", !7, i64 0, !8, i64 8, !9, i64 16, !11, i64 10256, !11, i64 10260, !11, i64 10264, !11, i64 10268, !12, i64 10272, !12, i64 10273, !13, i64 10280, !12, i64 10504}
!7 = !{!"_ZTS15IMouseAlgorithm"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTSN9floodFill7HistoryE", !11, i64 0, !11, i64 4, !8, i64 8, !14, i64 16, !21, i64 96, !27, i64 176, !32, i64 200}
!14 = !{!"_ZTSSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE", !15, i64 0}
!15 = !{!"_ZTSSt5dequeIPN9floodFill4CellESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt11_Deque_baseIPN9floodFill4CellESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE11_Deque_implE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE16_Deque_impl_dataE", !8, i64 0, !19, i64 8, !20, i64 16, !20, i64 48}
!19 = !{!"long", !9, i64 0}
!20 = !{!"_ZTSSt15_Deque_iteratorIPN9floodFill4CellERS2_PS2_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!21 = !{!"_ZTSSt5queueISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEES4_IS7_SaIS7_EEE", !22, i64 0}
!22 = !{!"_ZTSSt5dequeISt5stackIPN9floodFill4CellES_IS3_SaIS3_EEESaIS6_EE", !23, i64 0}
!23 = !{!"_ZTSSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE11_Deque_implE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE16_Deque_impl_dataE", !8, i64 0, !19, i64 8, !26, i64 16, !26, i64 48}
!26 = !{!"_ZTSSt15_Deque_iteratorISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEERS7_PS7_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!27 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !28, i64 0}
!28 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !30, i64 0}
!30 = !{!"_ZTSNSt8__detail17_List_node_headerE", !31, i64 0, !19, i64 16}
!31 = !{!"_ZTSNSt8__detail15_List_node_baseE", !8, i64 0, !8, i64 8}
!32 = !{!"_ZTSNSt7__cxx114listINS0_IN9floodFill7CellmodESaIS2_EEESaIS4_EEE", !33, i64 0}
!33 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EE10_List_implE", !30, i64 0}
!35 = !{!6, !11, i64 10260}
!36 = !{!8, !8, i64 0}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}
!40 = !{!6, !11, i64 10264}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass