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

; 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::queue.209" = type { %"class.std::deque.210" }
%"class.std::deque.210" = type { %"class.std::_Deque_base.211" }
%"class.std::_Deque_base.211" = type { %"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.215", %"struct.std::_Deque_iterator.215" }
%"struct.std::_Deque_iterator.215" = type { ptr, ptr, ptr, ptr }
%"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.std::__cxx11::list.216" = type { %"class.std::__cxx11::_List_base.217" }
%"class.std::__cxx11::_List_base.217" = type { %"struct.std::__cxx11::_List_base<floodFill::SimpleCellmod, std::allocator<floodFill::SimpleCellmod>>::_List_impl" }
%"struct.std::__cxx11::_List_base<floodFill::SimpleCellmod, std::allocator<floodFill::SimpleCellmod>>::_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 }
%"struct.std::_List_iterator.221" = type { 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" }
%"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" }
%"struct.floodFill::SimpleCellmod" = type { ptr, ptr, i32, [4 x i8] }

; 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 @_ZN9floodFill9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505), i32 noundef, i32 noundef) #2 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: mustprogress uwtable
define dso_local void @_ZN9floodFill9FloodFill10bffExploreEPSt5stackIPNS_4CellESt5dequeIS3_SaIS3_EEE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::queue.209", align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::list.216", align 8
  %13 = alloca %"class.std::__cxx11::list.216", align 8
  %14 = alloca %"struct.std::_List_iterator.221", align 8
  %15 = alloca %"struct.std::_List_iterator.221", align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %19 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 2
  %20 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %19, i64 0, i64 0
  %21 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %20, i64 0, i64 0
  store ptr %21, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #5
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEEC2IS8_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br label %22

22:                                               ; preds = %276, %2
  br label %23

23:                                               ; preds = %22
  br label %24

24:                                               ; preds = %95, %93, %23
  %25 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 11
  %26 = load i8, ptr %25, align 8, !tbaa !9, !range !36, !noundef !37
  %27 = trunc i8 %26 to i1
  %28 = xor i1 %27, true
  br i1 %28, label %29, label %97

29:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %30, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %31 unwind label %40

31:                                               ; preds = %29
  br label %32

32:                                               ; preds = %39, %31
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %48

35:                                               ; preds = %32
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 8 dereferenceable(8) %7)
          to label %36 unwind label %44

36:                                               ; preds = %35
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %37)
          to label %39 unwind label %44

39:                                               ; preds = %36
  store ptr %38, ptr %7, align 8, !tbaa !5
  br label %32, !llvm.loop !38

40:                                               ; preds = %29
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %9, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %10, align 4
  br label %96

44:                                               ; preds = %89, %88, %82, %79, %77, %76, %73, %70, %68, %66, %64, %56, %53, %50, %48, %36, %35
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  br label %96

48:                                               ; preds = %32
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %49 unwind label %44

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %69, %49
  %51 = invoke noundef zeroext i1 @_ZNKSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %52 unwind label %44

52:                                               ; preds = %50
  br i1 %51, label %62, label %53

53:                                               ; preds = %52
  %54 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %55 unwind label %44

55:                                               ; preds = %53
  br i1 %54, label %59, label %56

56:                                               ; preds = %55
  %57 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %58 unwind label %44

58:                                               ; preds = %56
  br label %59

59:                                               ; preds = %58, %55
  %60 = phi i1 [ true, %55 ], [ %57, %58 ]
  %61 = xor i1 %60, true
  br label %62

62:                                               ; preds = %59, %52
  %63 = phi i1 [ false, %52 ], [ %61, %59 ]
  br i1 %63, label %64, label %70

64:                                               ; preds = %62
  %65 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %66 unwind label %44

66:                                               ; preds = %64
  %67 = load ptr, ptr %65, align 8, !tbaa !5
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %67)
          to label %68 unwind label %44

68:                                               ; preds = %66
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %69 unwind label %44

69:                                               ; preds = %68
  br label %50, !llvm.loop !40

70:                                               ; preds = %62
  %71 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %72 unwind label %44

72:                                               ; preds = %70
  br i1 %71, label %73, label %79

73:                                               ; preds = %72
  %74 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 1
  %75 = load ptr, ptr %74, align 8, !tbaa !41
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %75)
          to label %76 unwind label %44

76:                                               ; preds = %73
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %77 unwind label %44

77:                                               ; preds = %76
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %78 unwind label %44

78:                                               ; preds = %77
  store i32 1, ptr %11, align 4
  br label %93

79:                                               ; preds = %72
  %80 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %81 unwind label %44

81:                                               ; preds = %79
  br i1 %80, label %82, label %91

82:                                               ; preds = %81
  %83 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  store i32 0, ptr %83, align 8, !tbaa !42
  %84 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  store i32 0, ptr %84, align 4, !tbaa !43
  %85 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 5
  store i32 0, ptr %85, align 8, !tbaa !44
  %86 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !41
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %87)
          to label %88 unwind label %44

88:                                               ; preds = %82
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %89 unwind label %44

89:                                               ; preds = %88
  invoke void @_ZN9floodFill9FloodFill11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %90 unwind label %44

90:                                               ; preds = %89
  store i32 4, ptr %11, align 4
  br label %93, !llvm.loop !45

91:                                               ; preds = %81
  %92 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 11
  store i8 1, ptr %92, align 8, !tbaa !9
  store i32 0, ptr %11, align 4
  br label %93

93:                                               ; preds = %91, %90, %78
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %94 = load i32, ptr %11, align 4
  switch i32 %94, label %372 [
    i32 0, label %95
    i32 4, label %24
  ]

95:                                               ; preds = %93
  br label %24, !llvm.loop !45

96:                                               ; preds = %44, %40
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %373

97:                                               ; preds = %24
  br label %98

98:                                               ; preds = %163, %97
  %99 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  %100 = load i32, ptr %99, align 8, !tbaa !42
  %101 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  %102 = load i32, ptr %101, align 4, !tbaa !43
  %103 = call noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505) %18, i32 noundef %100, i32 noundef %102)
  br i1 %103, label %113, label %104

104:                                              ; preds = %98
  %105 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %106 unwind label %130

106:                                              ; preds = %104
  br i1 %105, label %110, label %107

107:                                              ; preds = %106
  %108 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %109 unwind label %130

109:                                              ; preds = %107
  br label %110

110:                                              ; preds = %109, %106
  %111 = phi i1 [ true, %106 ], [ %108, %109 ]
  %112 = xor i1 %111, true
  br label %113

113:                                              ; preds = %110, %98
  %114 = phi i1 [ false, %98 ], [ %112, %110 ]
  br i1 %114, label %115, label %164

115:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  call void @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %116 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 2
  %117 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  %118 = load i32, ptr %117, align 8, !tbaa !42
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %116, i64 0, i64 %119
  %121 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  %122 = load i32, ptr %121, align 4, !tbaa !43
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %120, i64 0, i64 %123
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %12, ptr noundef %124)
          to label %125 unwind label %134

125:                                              ; preds = %115
  %126 = call noundef zeroext i1 @_ZN9floodFill9FloodFill9spaceLeftEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
  br i1 %126, label %127, label %138

127:                                              ; preds = %125
  %128 = call noundef ptr @_ZN9floodFill9FloodFill11getLeftCellEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %12, ptr noundef %128)
          to label %129 unwind label %134

129:                                              ; preds = %127
  br label %138

130:                                              ; preds = %275, %268, %193, %188, %186, %182, %179, %177, %176, %173, %170, %165, %164, %107, %104
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %9, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %10, align 4
  br label %373

134:                                              ; preds = %161, %157, %156, %155, %154, %149, %148, %145, %140, %127, %115
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %9, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %10, align 4
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %373

138:                                              ; preds = %129, %125
  %139 = call noundef zeroext i1 @_ZN9floodFill9FloodFill10spaceFrontEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
  br i1 %139, label %140, label %143

140:                                              ; preds = %138
  %141 = call noundef ptr @_ZN9floodFill9FloodFill12getFrontCellEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %12, ptr noundef %141)
          to label %142 unwind label %134

142:                                              ; preds = %140
  br label %143

143:                                              ; preds = %142, %138
  %144 = call noundef zeroext i1 @_ZN9floodFill9FloodFill10spaceRightEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
  br i1 %144, label %145, label %148

145:                                              ; preds = %143
  %146 = call noundef ptr @_ZN9floodFill9FloodFill12getRightCellEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %12, ptr noundef %146)
          to label %147 unwind label %134

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147, %143
  invoke void @_ZN9floodFill9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %149 unwind label %134

149:                                              ; preds = %148
  %150 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  %151 = load i32, ptr %150, align 8, !tbaa !42
  %152 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  %153 = load i32, ptr %152, align 4, !tbaa !43
  invoke void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505) %18, i32 noundef %151, i32 noundef %153)
          to label %154 unwind label %134

154:                                              ; preds = %149
  invoke void @_ZN9floodFill9FloodFill16dobffCellUpdatesEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %155 unwind label %134

155:                                              ; preds = %154
  invoke void @_ZN9floodFill9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %156 unwind label %134

156:                                              ; preds = %155
  invoke void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE4pushERKS5_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %157 unwind label %134

157:                                              ; preds = %156
  %158 = invoke noundef i64 @_ZNKSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %159 unwind label %134

159:                                              ; preds = %157
  %160 = icmp ugt i64 %158, 8
  br i1 %160, label %161, label %163

161:                                              ; preds = %159
  invoke void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %162 unwind label %134

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162, %159
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %98, !llvm.loop !46

164:                                              ; preds = %113
  invoke void @_ZN9floodFill9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %165 unwind label %130

165:                                              ; preds = %164
  %166 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  %167 = load i32, ptr %166, align 8, !tbaa !42
  %168 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  %169 = load i32, ptr %168, align 4, !tbaa !43
  invoke void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505) %18, i32 noundef %167, i32 noundef %169)
          to label %170 unwind label %130

170:                                              ; preds = %165
  %171 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %172 unwind label %130

172:                                              ; preds = %170
  br i1 %171, label %173, label %179

173:                                              ; preds = %172
  %174 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 1
  %175 = load ptr, ptr %174, align 8, !tbaa !41
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %175)
          to label %176 unwind label %130

176:                                              ; preds = %173
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %177 unwind label %130

177:                                              ; preds = %176
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %178 unwind label %130

178:                                              ; preds = %177
  store i32 1, ptr %11, align 4
  br label %372

179:                                              ; preds = %172
  %180 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %181 unwind label %130

181:                                              ; preds = %179
  br i1 %180, label %182, label %277

182:                                              ; preds = %181
  %183 = invoke noundef i64 @_ZNKSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %184 unwind label %130

184:                                              ; preds = %182
  %185 = icmp eq i64 %183, 8
  br i1 %185, label %186, label %268

186:                                              ; preds = %184
  %187 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %188 unwind label %130

188:                                              ; preds = %186
  %189 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %187) #5
  %190 = getelementptr inbounds %"struct.floodFill::SimpleCellmod", ptr %189, i32 0, i32 0
  %191 = load ptr, ptr %190, align 8, !tbaa !47
  store ptr %191, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %192 unwind label %130

192:                                              ; preds = %188
  br label %193

193:                                              ; preds = %264, %192
  %194 = invoke noundef zeroext i1 @_ZNKSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %195 unwind label %130

195:                                              ; preds = %193
  %196 = xor i1 %194, true
  br i1 %196, label %197, label %267

197:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %198 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %199 unwind label %209

199:                                              ; preds = %197
  invoke void @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %198)
          to label %200 unwind label %209

200:                                              ; preds = %199
  invoke void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %201 unwind label %213

201:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %202 = call ptr @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %203 = getelementptr inbounds %"struct.std::_List_iterator.221", ptr %14, i32 0, i32 0
  store ptr %202, ptr %203, align 8
  br label %204

204:                                              ; preds = %261, %201
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %205 = call ptr @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %206 = getelementptr inbounds %"struct.std::_List_iterator.221", ptr %15, i32 0, i32 0
  store ptr %205, ptr %206, align 8
  %207 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN9floodFill13SimpleCellmodEES4_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br i1 %207, label %217, label %208

208:                                              ; preds = %204
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %264

209:                                              ; preds = %199, %197
  %210 = landingpad { ptr, i32 }
          cleanup
  %211 = extractvalue { ptr, i32 } %210, 0
  store ptr %211, ptr %9, align 8
  %212 = extractvalue { ptr, i32 } %210, 1
  store i32 %212, ptr %10, align 4
  br label %266

213:                                              ; preds = %200
  %214 = landingpad { ptr, i32 }
          cleanup
  %215 = extractvalue { ptr, i32 } %214, 0
  store ptr %215, ptr %9, align 8
  %216 = extractvalue { ptr, i32 } %214, 1
  store i32 %216, ptr %10, align 4
  br label %265

217:                                              ; preds = %204
  %218 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %219 = getelementptr inbounds %"struct.floodFill::SimpleCellmod", ptr %218, i32 0, i32 0
  %220 = load ptr, ptr %219, align 8, !tbaa !47
  %221 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %222 = getelementptr inbounds %"struct.floodFill::SimpleCellmod", ptr %221, i32 0, i32 1
  %223 = load ptr, ptr %222, align 8, !tbaa !49
  invoke void @_ZN9floodFill4Cell7setPrevEPS0_(ptr noundef nonnull align 8 dereferenceable(40) %220, ptr noundef %223)
          to label %224 unwind label %236

224:                                              ; preds = %217
  %225 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %226 = getelementptr inbounds %"struct.floodFill::SimpleCellmod", ptr %225, i32 0, i32 0
  %227 = load ptr, ptr %226, align 8, !tbaa !47
  %228 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %229 = getelementptr inbounds %"struct.floodFill::SimpleCellmod", ptr %228, i32 0, i32 2
  %230 = load i32, ptr %229, align 8, !tbaa !50
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %227, i32 noundef %230)
          to label %231 unwind label %236

231:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !51
  br label %232

232:                                              ; preds = %253, %231
  %233 = load i32, ptr %16, align 4, !tbaa !51
  %234 = icmp slt i32 %233, 4
  br i1 %234, label %240, label %235

235:                                              ; preds = %232
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %260

236:                                              ; preds = %224, %217
  %237 = landingpad { ptr, i32 }
          cleanup
  %238 = extractvalue { ptr, i32 } %237, 0
  store ptr %238, ptr %9, align 8
  %239 = extractvalue { ptr, i32 } %237, 1
  store i32 %239, ptr %10, align 4
  br label %263

240:                                              ; preds = %232
  %241 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %242 = getelementptr inbounds %"struct.floodFill::SimpleCellmod", ptr %241, i32 0, i32 0
  %243 = load ptr, ptr %242, align 8, !tbaa !47
  %244 = load i32, ptr %16, align 4, !tbaa !51
  %245 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %246 = getelementptr inbounds %"struct.floodFill::SimpleCellmod", ptr %245, i32 0, i32 3
  %247 = load i32, ptr %16, align 4, !tbaa !51
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [4 x i8], ptr %246, i64 0, i64 %248
  %250 = load i8, ptr %249, align 1, !tbaa !52, !range !36, !noundef !37
  %251 = trunc i8 %250 to i1
  invoke void @_ZN9floodFill4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(40) %243, i32 noundef %244, i1 noundef zeroext %251)
          to label %252 unwind label %256

252:                                              ; preds = %240
  br label %253

253:                                              ; preds = %252
  %254 = load i32, ptr %16, align 4, !tbaa !51
  %255 = add nsw i32 %254, 1
  store i32 %255, ptr %16, align 4, !tbaa !51
  br label %232, !llvm.loop !53

256:                                              ; preds = %240
  %257 = landingpad { ptr, i32 }
          cleanup
  %258 = extractvalue { ptr, i32 } %257, 0
  store ptr %258, ptr %9, align 8
  %259 = extractvalue { ptr, i32 } %257, 1
  store i32 %259, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %263

260:                                              ; preds = %235
  br label %261

261:                                              ; preds = %260
  %262 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIN9floodFill13SimpleCellmodEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %204, !llvm.loop !54

263:                                              ; preds = %256, %236
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %265

264:                                              ; preds = %208
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %193, !llvm.loop !55

265:                                              ; preds = %263, %213
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %266

266:                                              ; preds = %265, %209
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %373

267:                                              ; preds = %195
  br label %268

268:                                              ; preds = %267, %184
  %269 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  store i32 0, ptr %269, align 8, !tbaa !42
  %270 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  store i32 0, ptr %270, align 4, !tbaa !43
  %271 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 5
  store i32 0, ptr %271, align 8, !tbaa !44
  %272 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 11
  store i8 0, ptr %272, align 8, !tbaa !9
  %273 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 1
  %274 = load ptr, ptr %273, align 8, !tbaa !41
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %274)
          to label %275 unwind label %130

275:                                              ; preds = %268
  invoke void @_ZN9floodFill9FloodFill11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %276 unwind label %130

276:                                              ; preds = %275
  br label %22, !llvm.loop !56

277:                                              ; preds = %181
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %278 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 2
  %279 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  %280 = load i32, ptr %279, align 8, !tbaa !42
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %278, i64 0, i64 %281
  %283 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  %284 = load i32, ptr %283, align 4, !tbaa !43
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %282, i64 0, i64 %285
  store ptr %286, ptr %17, align 8, !tbaa !5
  br label %287

287:                                              ; preds = %297, %277
  %288 = load ptr, ptr %17, align 8, !tbaa !5
  %289 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %288)
          to label %290 unwind label %298

290:                                              ; preds = %287
  %291 = icmp ne ptr %289, null
  br i1 %291, label %292, label %302

292:                                              ; preds = %290
  %293 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %293, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %294 unwind label %298

294:                                              ; preds = %292
  %295 = load ptr, ptr %17, align 8, !tbaa !5
  %296 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %295)
          to label %297 unwind label %298

297:                                              ; preds = %294
  store ptr %296, ptr %17, align 8, !tbaa !5
  br label %287, !llvm.loop !57

298:                                              ; preds = %368, %366, %359, %356, %352, %341, %334, %329, %323, %315, %312, %294, %292, %287
  %299 = landingpad { ptr, i32 }
          cleanup
  %300 = extractvalue { ptr, i32 } %299, 0
  store ptr %300, ptr %9, align 8
  %301 = extractvalue { ptr, i32 } %299, 1
  store i32 %301, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %373

302:                                              ; preds = %290
  %303 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 8
  store i8 1, ptr %303, align 1, !tbaa !58
  br label %304

304:                                              ; preds = %355, %340, %302
  %305 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  %306 = load i32, ptr %305, align 8, !tbaa !42
  %307 = icmp ne i32 %306, 0
  br i1 %307, label %312, label %308

308:                                              ; preds = %304
  %309 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  %310 = load i32, ptr %309, align 4, !tbaa !43
  %311 = icmp ne i32 %310, 0
  br i1 %311, label %312, label %321

312:                                              ; preds = %308, %304
  %313 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %314 unwind label %298

314:                                              ; preds = %312
  br i1 %313, label %318, label %315

315:                                              ; preds = %314
  %316 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %317 unwind label %298

317:                                              ; preds = %315
  br label %318

318:                                              ; preds = %317, %314
  %319 = phi i1 [ true, %314 ], [ %316, %317 ]
  %320 = xor i1 %319, true
  br label %321

321:                                              ; preds = %318, %308
  %322 = phi i1 [ false, %308 ], [ %320, %318 ]
  br i1 %322, label %323, label %356

323:                                              ; preds = %321
  %324 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 2
  %325 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %324, i64 0, i64 0
  %326 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %325, i64 0, i64 0
  %327 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13isOneCellAwayEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %326)
          to label %328 unwind label %298

328:                                              ; preds = %323
  br i1 %327, label %329, label %334

329:                                              ; preds = %328
  %330 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 2
  %331 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %330, i64 0, i64 0
  %332 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %331, i64 0, i64 0
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %332)
          to label %333 unwind label %298

333:                                              ; preds = %329
  br label %355

334:                                              ; preds = %328
  %335 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 2
  %336 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %335, i64 0, i64 0
  %337 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %336, i64 0, i64 0
  %338 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14tryUntraversedEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %337)
          to label %339 unwind label %298

339:                                              ; preds = %334
  br i1 %338, label %340, label %341

340:                                              ; preds = %339
  br label %304, !llvm.loop !59

341:                                              ; preds = %339
  %342 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 2
  %343 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 3
  %344 = load i32, ptr %343, align 8, !tbaa !42
  %345 = sext i32 %344 to i64
  %346 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %342, i64 0, i64 %345
  %347 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 4
  %348 = load i32, ptr %347, align 4, !tbaa !43
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %346, i64 0, i64 %349
  %351 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %350)
          to label %352 unwind label %298

352:                                              ; preds = %341
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %18, ptr noundef %351)
          to label %353 unwind label %298

353:                                              ; preds = %352
  br label %354

354:                                              ; preds = %353
  br label %355

355:                                              ; preds = %354, %333
  br label %304, !llvm.loop !59

356:                                              ; preds = %321
  %357 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %358 unwind label %298

358:                                              ; preds = %356
  br i1 %357, label %371, label %359

359:                                              ; preds = %358
  %360 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %361 unwind label %298

361:                                              ; preds = %359
  br i1 %360, label %371, label %362

362:                                              ; preds = %361
  %363 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %18, i32 0, i32 5
  %364 = load i32, ptr %363, align 8, !tbaa !44
  %365 = icmp eq i32 %364, 2
  br i1 %365, label %366, label %368

366:                                              ; preds = %362
  invoke void @_ZN9floodFill9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %367 unwind label %298

367:                                              ; preds = %366
  br label %370

368:                                              ; preds = %362
  invoke void @_ZN9floodFill9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(10505) %18)
          to label %369 unwind label %298

369:                                              ; preds = %368
  br label %370

370:                                              ; preds = %369, %367
  br label %371

371:                                              ; preds = %370, %361, %358
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %372

372:                                              ; preds = %371, %178, %93
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

373:                                              ; preds = %298, %266, %134, %130, %96
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %374

374:                                              ; preds = %373
  %375 = load ptr, ptr %9, align 8
  %376 = load i32, ptr %10, align 4
  %377 = insertvalue { ptr, i32 } poison, ptr %375, 0
  %378 = insertvalue { ptr, i32 } %377, i32 %376, 1
  resume { ptr, i32 } %378
}

; 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
declare dso_local void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505)) #2 align 2

declare void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #4

declare void @_ZN9floodFill4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i1 noundef zeroext) #4

declare void @_ZN9floodFill4Cell7setPrevEPS0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #4

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

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

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

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

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

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

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

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

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

declare void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296)) #4

declare noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40)) #4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !13, i64 10504}
!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 = !{i8 0, i8 2}
!37 = !{}
!38 = distinct !{!38, !39}
!39 = !{!"llvm.loop.mustprogress"}
!40 = distinct !{!40, !39}
!41 = !{!10, !6, i64 8}
!42 = !{!10, !12, i64 10256}
!43 = !{!10, !12, i64 10260}
!44 = !{!10, !12, i64 10264}
!45 = distinct !{!45, !39}
!46 = distinct !{!46, !39}
!47 = !{!48, !6, i64 0}
!48 = !{!"_ZTSN9floodFill13SimpleCellmodE", !6, i64 0, !6, i64 8, !12, i64 16, !7, i64 20}
!49 = !{!48, !6, i64 8}
!50 = !{!48, !12, i64 16}
!51 = !{!12, !12, i64 0}
!52 = !{!13, !13, i64 0}
!53 = distinct !{!53, !39}
!54 = distinct !{!54, !39}
!55 = distinct !{!55, !39}
!56 = distinct !{!56, !39}
!57 = distinct !{!57, !39}
!58 = !{!10, !13, i64 10273}
!59 = distinct !{!59, !39}


; 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::queue.209" = type { %"class.std::deque.210" }
%"class.std::deque.210" = type { %"class.std::_Deque_base.211" }
%"class.std::_Deque_base.211" = type { %"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::__cxx11::list<floodFill::SimpleCellmod>, std::allocator<std::__cxx11::list<floodFill::SimpleCellmod>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.215", %"struct.std::_Deque_iterator.215" }
%"struct.std::_Deque_iterator.215" = type { ptr, ptr, ptr, ptr }
%"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.std::__cxx11::list.216" = type { %"class.std::__cxx11::_List_base.217" }
%"class.std::__cxx11::_List_base.217" = type { %"struct.std::__cxx11::_List_base<floodFill::SimpleCellmod, std::allocator<floodFill::SimpleCellmod>>::_List_impl" }
%"struct.std::__cxx11::_List_base<floodFill::SimpleCellmod, std::allocator<floodFill::SimpleCellmod>>::_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 }
%"struct.std::_List_iterator.221" = type { 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 @_ZN9floodFill9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505), i32 noundef, i32 noundef) local_unnamed_addr #2 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: mustprogress uwtable
define dso_local void @_ZN9floodFill9FloodFill10bffExploreEPSt5stackIPNS_4CellESt5dequeIS3_SaIS3_EEE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::queue.209", align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::stack", align 8
  %6 = alloca %"class.std::__cxx11::list.216", align 8
  %7 = alloca %"class.std::__cxx11::list.216", align 8
  %8 = alloca %"struct.std::_List_iterator.221", align 8
  %9 = alloca %"struct.std::_List_iterator.221", align 8
  %10 = alloca ptr, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #5
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEEC2IS8_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %12 = getelementptr inbounds i8, ptr %0, i64 10504
  %13 = getelementptr inbounds i8, ptr %0, i64 10256
  %14 = getelementptr inbounds i8, ptr %0, i64 10260
  %15 = getelementptr inbounds i8, ptr %0, i64 10264
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  br label %17

17:                                               ; preds = %173, %2
  %.019 = phi ptr [ %11, %2 ], [ %.120, %173 ]
  %18 = load i8, ptr %12, align 8, !tbaa !5, !range !35, !noundef !36
  %19 = trunc nuw i8 %18 to i1
  br i1 %19, label %.preheader44, label %.lr.ph82

.preheader44:                                     ; preds = %54, %17
  %20 = load i32, ptr %13, align 8, !tbaa !37
  %21 = load i32, ptr %14, align 4, !tbaa !38
  %22 = call noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %20, i32 noundef %21)
  br i1 %22, label %.critedge2, label %.lr.ph83

.lr.ph82:                                         ; preds = %17, %54
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  store ptr %.019, ptr %4, align 8, !tbaa !39
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %thread-pre-split unwind label %27

thread-pre-split:                                 ; preds = %.lr.ph82
  %.pr = load ptr, ptr %4, align 8, !tbaa !39
  %.not2576 = icmp eq ptr %.pr, null
  br i1 %.not2576, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %thread-pre-split, %26
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %5, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %23 unwind label %.loopexit.split-lp37.loopexit

23:                                               ; preds = %.lr.ph
  %24 = load ptr, ptr %4, align 8, !tbaa !39
  %25 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %24)
          to label %26 unwind label %.loopexit.split-lp37.loopexit

26:                                               ; preds = %23
  store ptr %25, ptr %4, align 8, !tbaa !39
  %.not25 = icmp eq ptr %25, null
  br i1 %.not25, label %._crit_edge, label %.lr.ph, !llvm.loop !40

27:                                               ; preds = %.lr.ph82
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %57

.loopexit36:                                      ; preds = %.lr.ph78, %32, %35
  %lpad.loopexit38 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp37

.loopexit.split-lp37.loopexit:                    ; preds = %23, %.lr.ph
  %lpad.loopexit40 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp37

.loopexit.split-lp37.loopexit.split-lp.loopexit:  ; preds = %.critedge, %46, %49, %51, %52
  %lpad.loopexit49 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp37

.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp: ; preds = %42, %44, %45
  %lpad.loopexit.split-lp50 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp37

.loopexit.split-lp37:                             ; preds = %.loopexit.split-lp37.loopexit, %.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp37.loopexit.split-lp.loopexit, %.loopexit36
  %lpad.phi39 = phi { ptr, i32 } [ %lpad.loopexit38, %.loopexit36 ], [ %lpad.loopexit40, %.loopexit.split-lp37.loopexit ], [ %lpad.loopexit49, %.loopexit.split-lp37.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp50, %.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  br label %57

._crit_edge:                                      ; preds = %26, %thread-pre-split
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %29 = call noundef zeroext i1 @_ZNKSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %29, label %.critedge, label %.lr.ph78

.lr.ph78:                                         ; preds = %._crit_edge, %38
  %30 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %31 unwind label %.loopexit36

31:                                               ; preds = %.lr.ph78
  br i1 %30, label %.critedge, label %32

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

34:                                               ; preds = %32
  br i1 %33, label %.critedge, label %35

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

38:                                               ; preds = %35
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %39 = call noundef zeroext i1 @_ZNKSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %39, label %.critedge, label %.lr.ph78, !llvm.loop !42

.critedge:                                        ; preds = %34, %38, %31, %._crit_edge
  %40 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %41 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit

41:                                               ; preds = %.critedge
  br i1 %40, label %42, label %46

42:                                               ; preds = %41
  %43 = load ptr, ptr %16, align 8, !tbaa !43
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %43)
          to label %44 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp

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

45:                                               ; preds = %44
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %.thread unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp

.thread:                                          ; preds = %45
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %224

46:                                               ; preds = %41
  %47 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %48 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit

48:                                               ; preds = %46
  br i1 %47, label %49, label %53

49:                                               ; preds = %48
  store i32 0, ptr %13, align 8, !tbaa !37
  store i32 0, ptr %14, align 4, !tbaa !38
  store i32 0, ptr %15, align 8, !tbaa !44
  %50 = load ptr, ptr %16, align 8, !tbaa !43
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %50)
          to label %51 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit

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

52:                                               ; preds = %51
  invoke void @_ZN9floodFill9FloodFill11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %54 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit, !llvm.loop !45

53:                                               ; preds = %48
  store i8 1, ptr %12, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %52, %53
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %55 = load i8, ptr %12, align 8, !tbaa !5, !range !35, !noundef !36
  %56 = trunc nuw i8 %55 to i1
  br i1 %56, label %.preheader44, label %.lr.ph82

57:                                               ; preds = %.loopexit.split-lp37, %27
  %.pn26 = phi { ptr, i32 } [ %lpad.phi39, %.loopexit.split-lp37 ], [ %28, %27 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %.loopexit.split-lp46

.lr.ph83:                                         ; preds = %.preheader44, %94
  %58 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %59 unwind label %.loopexit45

59:                                               ; preds = %.lr.ph83
  br i1 %58, label %.critedge2, label %60

60:                                               ; preds = %59
  %61 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %62 unwind label %.loopexit45

62:                                               ; preds = %60
  br i1 %61, label %.critedge2, label %63

63:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %64 = load i32, ptr %13, align 8, !tbaa !37
  %65 = sext i32 %64 to i64
  %66 = load i32, ptr %14, align 4, !tbaa !38
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %11, i64 0, i64 %65, i64 %67
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %6, ptr noundef nonnull %68)
          to label %69 unwind label %73

69:                                               ; preds = %63
  %70 = call noundef zeroext i1 @_ZN9floodFill9FloodFill9spaceLeftEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
  br i1 %70, label %71, label %75

71:                                               ; preds = %69
  %72 = call noundef ptr @_ZN9floodFill9FloodFill11getLeftCellEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %6, ptr noundef %72)
          to label %75 unwind label %73

.loopexit45:                                      ; preds = %.lr.ph83, %60
  %lpad.loopexit47 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp46

.loopexit.split-lp46.loopexit:                    ; preds = %173, %.loopexit43, %108, %101, %98, %.critedge2
  %lpad.loopexit52 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp46

.loopexit.split-lp46.loopexit.split-lp:           ; preds = %107, %106, %104
  %lpad.loopexit.split-lp53 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp46

73:                                               ; preds = %89, %88, %87, %84, %83, %81, %77, %71, %63
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %.loopexit.split-lp46

75:                                               ; preds = %71, %69
  %76 = call noundef zeroext i1 @_ZN9floodFill9FloodFill10spaceFrontEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
  br i1 %76, label %77, label %79

77:                                               ; preds = %75
  %78 = call noundef ptr @_ZN9floodFill9FloodFill12getFrontCellEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %6, ptr noundef %78)
          to label %79 unwind label %73

79:                                               ; preds = %77, %75
  %80 = call noundef zeroext i1 @_ZN9floodFill9FloodFill10spaceRightEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
  br i1 %80, label %81, label %83

81:                                               ; preds = %79
  %82 = call noundef ptr @_ZN9floodFill9FloodFill12getRightCellEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
  invoke void @_ZN9floodFill9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listINS_13SimpleCellmodESaIS3_EEEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %6, ptr noundef %82)
          to label %83 unwind label %73

83:                                               ; preds = %81, %79
  invoke void @_ZN9floodFill9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %84 unwind label %73

84:                                               ; preds = %83
  %85 = load i32, ptr %13, align 8, !tbaa !37
  %86 = load i32, ptr %14, align 4, !tbaa !38
  invoke void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %85, i32 noundef %86)
          to label %87 unwind label %73

87:                                               ; preds = %84
  invoke void @_ZN9floodFill9FloodFill16dobffCellUpdatesEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %88 unwind label %73

88:                                               ; preds = %87
  invoke void @_ZN9floodFill9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %89 unwind label %73

89:                                               ; preds = %88
  invoke void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE4pushERKS5_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %90 unwind label %73

90:                                               ; preds = %89
  %91 = call noundef i64 @_ZNKSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %92 = icmp ugt i64 %91, 8
  br i1 %92, label %93, label %94

93:                                               ; preds = %90
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br label %94

94:                                               ; preds = %93, %90
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %95 = load i32, ptr %13, align 8, !tbaa !37
  %96 = load i32, ptr %14, align 4, !tbaa !38
  %97 = call noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %95, i32 noundef %96)
  br i1 %97, label %.critedge2, label %.lr.ph83, !llvm.loop !46

.critedge2:                                       ; preds = %62, %94, %59, %.preheader44
  invoke void @_ZN9floodFill9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %98 unwind label %.loopexit.split-lp46.loopexit

98:                                               ; preds = %.critedge2
  %99 = load i32, ptr %13, align 8, !tbaa !37
  %100 = load i32, ptr %14, align 4, !tbaa !38
  invoke void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %99, i32 noundef %100)
          to label %101 unwind label %.loopexit.split-lp46.loopexit

101:                                              ; preds = %98
  %102 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %103 unwind label %.loopexit.split-lp46.loopexit

103:                                              ; preds = %101
  br i1 %102, label %104, label %108

104:                                              ; preds = %103
  %105 = load ptr, ptr %16, align 8, !tbaa !43
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %105)
          to label %106 unwind label %.loopexit.split-lp46.loopexit.split-lp

106:                                              ; preds = %104
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %107 unwind label %.loopexit.split-lp46.loopexit.split-lp

107:                                              ; preds = %106
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %224 unwind label %.loopexit.split-lp46.loopexit.split-lp

108:                                              ; preds = %103
  %109 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %110 unwind label %.loopexit.split-lp46.loopexit

110:                                              ; preds = %108
  br i1 %109, label %111, label %174

111:                                              ; preds = %110
  %112 = call noundef i64 @_ZNKSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %113 = icmp eq i64 %112, 8
  br i1 %113, label %114, label %.loopexit43

114:                                              ; preds = %111
  %115 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %116 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %115) #5
  %117 = load ptr, ptr %116, align 8, !tbaa !47
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %118 = call noundef zeroext i1 @_ZNKSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %118, label %.loopexit43, label %.lr.ph97

.lr.ph97:                                         ; preds = %114, %._crit_edge95
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %119 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  invoke void @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EEC2ERKS4_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %119)
          to label %120 unwind label %125

120:                                              ; preds = %.lr.ph97
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %121 = call ptr @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %121, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %122 = call ptr @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %122, ptr %9, align 8
  %123 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN9floodFill13SimpleCellmodEES4_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %123, label %.lr.ph94, label %._crit_edge95

._crit_edge95:                                    ; preds = %164, %120
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %124 = call noundef zeroext i1 @_ZNKSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %124, label %.loopexit43, label %.lr.ph97, !llvm.loop !49

125:                                              ; preds = %.lr.ph97
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %171

.lr.ph94:                                         ; preds = %120, %164
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %128 = load ptr, ptr %127, align 8, !tbaa !47
  %129 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %130 = getelementptr inbounds i8, ptr %129, i64 8
  %131 = load ptr, ptr %130, align 8, !tbaa !50
  invoke void @_ZN9floodFill4Cell7setPrevEPS0_(ptr noundef nonnull align 8 dereferenceable(40) %128, ptr noundef %131)
          to label %132 unwind label %144

132:                                              ; preds = %.lr.ph94
  %133 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %134 = load ptr, ptr %133, align 8, !tbaa !47
  %135 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %136 = getelementptr inbounds i8, ptr %135, i64 16
  %137 = load i32, ptr %136, align 8, !tbaa !51
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %134, i32 noundef %137)
          to label %.preheader.preheader unwind label %144

.preheader.preheader:                             ; preds = %132
  %138 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %139 = load ptr, ptr %138, align 8, !tbaa !47
  %140 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %141 = getelementptr inbounds i8, ptr %140, i64 20
  %142 = load i8, ptr %141, align 4, !tbaa !52, !range !35, !noundef !36
  %143 = trunc nuw i8 %142 to i1
  invoke void @_ZN9floodFill4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(40) %139, i32 noundef 0, i1 noundef zeroext %143)
          to label %.preheader.1 unwind label %168

144:                                              ; preds = %132, %.lr.ph94
  %145 = landingpad { ptr, i32 }
          cleanup
  br label %170

.preheader.1:                                     ; preds = %.preheader.preheader
  %146 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %147 = load ptr, ptr %146, align 8, !tbaa !47
  %148 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %149 = getelementptr inbounds i8, ptr %148, i64 21
  %150 = load i8, ptr %149, align 1, !tbaa !52, !range !35, !noundef !36
  %151 = trunc nuw i8 %150 to i1
  invoke void @_ZN9floodFill4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(40) %147, i32 noundef 1, i1 noundef zeroext %151)
          to label %.preheader.2 unwind label %168

.preheader.2:                                     ; preds = %.preheader.1
  %152 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %153 = load ptr, ptr %152, align 8, !tbaa !47
  %154 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %155 = getelementptr inbounds i8, ptr %154, i64 22
  %156 = load i8, ptr %155, align 2, !tbaa !52, !range !35, !noundef !36
  %157 = trunc nuw i8 %156 to i1
  invoke void @_ZN9floodFill4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(40) %153, i32 noundef 2, i1 noundef zeroext %157)
          to label %.preheader.3 unwind label %168

.preheader.3:                                     ; preds = %.preheader.2
  %158 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %159 = load ptr, ptr %158, align 8, !tbaa !47
  %160 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorIN9floodFill13SimpleCellmodEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %161 = getelementptr inbounds i8, ptr %160, i64 23
  %162 = load i8, ptr %161, align 1, !tbaa !52, !range !35, !noundef !36
  %163 = trunc nuw i8 %162 to i1
  invoke void @_ZN9floodFill4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(40) %159, i32 noundef 3, i1 noundef zeroext %163)
          to label %164 unwind label %168

164:                                              ; preds = %.preheader.3
  %165 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorIN9floodFill13SimpleCellmodEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %166 = call ptr @_ZNSt7__cxx114listIN9floodFill13SimpleCellmodESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %166, ptr %9, align 8
  %167 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN9floodFill13SimpleCellmodEES4_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %167, label %.lr.ph94, label %._crit_edge95, !llvm.loop !53

168:                                              ; preds = %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %169 = landingpad { ptr, i32 }
          cleanup
  br label %170

170:                                              ; preds = %168, %144
  %.pn = phi { ptr, i32 } [ %169, %168 ], [ %145, %144 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt7__cxx1110_List_baseIN9floodFill13SimpleCellmodESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %171

171:                                              ; preds = %170, %125
  %.pn.pn = phi { ptr, i32 } [ %.pn, %170 ], [ %126, %125 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %.loopexit.split-lp46

.loopexit43:                                      ; preds = %._crit_edge95, %114, %111
  %.120 = phi ptr [ %.019, %111 ], [ %117, %114 ], [ %117, %._crit_edge95 ]
  store i32 0, ptr %13, align 8, !tbaa !37
  store i32 0, ptr %14, align 4, !tbaa !38
  store i32 0, ptr %15, align 8, !tbaa !44
  store i8 0, ptr %12, align 8, !tbaa !5
  %172 = load ptr, ptr %16, align 8, !tbaa !43
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %172)
          to label %173 unwind label %.loopexit.split-lp46.loopexit

173:                                              ; preds = %.loopexit43
  invoke void @_ZN9floodFill9FloodFill11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %17 unwind label %.loopexit.split-lp46.loopexit, !llvm.loop !54

174:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %175 = load i32, ptr %13, align 8, !tbaa !37
  %176 = sext i32 %175 to i64
  %177 = load i32, ptr %14, align 4, !tbaa !38
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %11, i64 0, i64 %176, i64 %178
  br label %180

180:                                              ; preds = %184, %174
  %storemerge = phi ptr [ %179, %174 ], [ %186, %184 ]
  store ptr %storemerge, ptr %10, align 8, !tbaa !39
  %181 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %storemerge)
          to label %182 unwind label %.loopexit.split-lp.loopexit

182:                                              ; preds = %180
  %.not = icmp eq ptr %181, null
  br i1 %.not, label %187, label %183

183:                                              ; preds = %182
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushERKS2_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %184 unwind label %.loopexit.split-lp.loopexit

184:                                              ; preds = %183
  %185 = load ptr, ptr %10, align 8, !tbaa !39
  %186 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %185)
          to label %180 unwind label %.loopexit.split-lp.loopexit, !llvm.loop !55

.loopexit:                                        ; preds = %.lr.ph102, %193, %196, %199, %200, %203, %210
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %184, %183, %180
  %lpad.loopexit33 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %222, %221, %215, %.critedge4
  %lpad.loopexit.split-lp34 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit33, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp34, %.loopexit.split-lp.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %.loopexit.split-lp46

187:                                              ; preds = %182
  %188 = getelementptr inbounds i8, ptr %0, i64 10273
  store i8 1, ptr %188, align 1, !tbaa !56
  %189 = load i32, ptr %13, align 8, !tbaa !37
  %.not2198 = icmp eq i32 %189, 0
  %190 = load i32, ptr %14, align 4
  %.not2299 = icmp eq i32 %190, 0
  %or.cond100 = select i1 %.not2198, i1 %.not2299, i1 false
  br i1 %or.cond100, label %.critedge4, label %.lr.ph102

.lr.ph102:                                        ; preds = %187, %.backedge
  %191 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %192 unwind label %.loopexit

192:                                              ; preds = %.lr.ph102
  br i1 %191, label %.critedge4, label %193

193:                                              ; preds = %192
  %194 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %195 unwind label %.loopexit

195:                                              ; preds = %193
  br i1 %194, label %.critedge4, label %196

196:                                              ; preds = %195
  %197 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13isOneCellAwayEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %11)
          to label %198 unwind label %.loopexit

198:                                              ; preds = %196
  br i1 %197, label %199, label %200

199:                                              ; preds = %198
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %11)
          to label %.backedge unwind label %.loopexit

200:                                              ; preds = %198
  %201 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14tryUntraversedEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %11)
          to label %202 unwind label %.loopexit

202:                                              ; preds = %200
  br i1 %201, label %.backedge, label %203

203:                                              ; preds = %202
  %204 = load i32, ptr %13, align 8, !tbaa !37
  %205 = sext i32 %204 to i64
  %206 = load i32, ptr %14, align 4, !tbaa !38
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %11, i64 0, i64 %205, i64 %207
  %209 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %208)
          to label %210 unwind label %.loopexit

210:                                              ; preds = %203
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef %209)
          to label %.backedge unwind label %.loopexit

.backedge:                                        ; preds = %199, %210, %202
  %211 = load i32, ptr %13, align 8, !tbaa !37
  %.not21 = icmp eq i32 %211, 0
  %212 = load i32, ptr %14, align 4
  %.not22 = icmp eq i32 %212, 0
  %or.cond = select i1 %.not21, i1 %.not22, i1 false
  br i1 %or.cond, label %.critedge4, label %.lr.ph102, !llvm.loop !57

.critedge4:                                       ; preds = %195, %.backedge, %192, %187
  %213 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %214 unwind label %.loopexit.split-lp.loopexit.split-lp

214:                                              ; preds = %.critedge4
  br i1 %213, label %223, label %215

215:                                              ; preds = %214
  %216 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %217 unwind label %.loopexit.split-lp.loopexit.split-lp

217:                                              ; preds = %215
  br i1 %216, label %223, label %218

218:                                              ; preds = %217
  %219 = load i32, ptr %15, align 8, !tbaa !44
  %220 = icmp eq i32 %219, 2
  br i1 %220, label %221, label %222

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

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

223:                                              ; preds = %221, %222, %217, %214
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %224

224:                                              ; preds = %.thread, %107, %223
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  ret void

.loopexit.split-lp46:                             ; preds = %.loopexit45, %.loopexit.split-lp46.loopexit.split-lp, %.loopexit.split-lp46.loopexit, %.loopexit.split-lp, %171, %73, %57
  %.pn26.pn = phi { ptr, i32 } [ %.pn26, %57 ], [ %.pn.pn, %171 ], [ %lpad.phi, %.loopexit.split-lp ], [ %74, %73 ], [ %lpad.loopexit47, %.loopexit45 ], [ %lpad.loopexit52, %.loopexit.split-lp46.loopexit ], [ %lpad.loopexit.split-lp53, %.loopexit.split-lp46.loopexit.split-lp ]
  call void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn26.pn
}

; 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
declare dso_local void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505)) local_unnamed_addr #2 align 2

declare void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #4

declare void @_ZN9floodFill4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i1 noundef zeroext) local_unnamed_addr #4

declare void @_ZN9floodFill4Cell7setPrevEPS0_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #4

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

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

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

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

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

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

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

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

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

declare void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296)) local_unnamed_addr #4

declare noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt14_List_iteratorIN9floodFill13SimpleCellmodEES4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #1

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5queueINSt7__cxx114listIN9floodFill13SimpleCellmodESaIS3_EEESt5dequeIS5_SaIS5_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 10504}
!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 = !{i8 0, i8 2}
!36 = !{}
!37 = !{!6, !11, i64 10256}
!38 = !{!6, !11, i64 10260}
!39 = !{!8, !8, i64 0}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = distinct !{!42, !41}
!43 = !{!6, !8, i64 8}
!44 = !{!6, !11, i64 10264}
!45 = distinct !{!45, !41}
!46 = distinct !{!46, !41}
!47 = !{!48, !8, i64 0}
!48 = !{!"_ZTSN9floodFill13SimpleCellmodE", !8, i64 0, !8, i64 8, !11, i64 16, !9, i64 20}
!49 = distinct !{!49, !41}
!50 = !{!48, !8, i64 8}
!51 = !{!48, !11, i64 16}
!52 = !{!12, !12, i64 0}
!53 = distinct !{!53, !41}
!54 = distinct !{!54, !41}
!55 = distinct !{!55, !41}
!56 = !{!6, !12, i64 10273}
!57 = distinct !{!57, !41}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass