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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9floodFill9FloodFill7exploreEv(ptr noundef nonnull align 8 dereferenceable(10505) %0) #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"class.std::stack", align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca %"class.std::stack", align 8
  %10 = alloca %"class.std::stack", align 8
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %17 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr %3) #6
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %18 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %19 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %18, i64 0, i64 0
  %20 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %19, i64 0, i64 0
  store ptr %20, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %21 unwind label %44

21:                                               ; preds = %1
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %22

22:                                               ; preds = %270, %111, %21
  %23 = invoke noundef zeroext i1 @_ZNKSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %24 unwind label %48

24:                                               ; preds = %22
  br i1 %23, label %25, label %33

25:                                               ; preds = %24
  %26 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %27 unwind label %48

27:                                               ; preds = %25
  br i1 %26, label %31, label %28

28:                                               ; preds = %27
  %29 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %30 unwind label %48

30:                                               ; preds = %28
  br label %31

31:                                               ; preds = %30, %27
  %32 = phi i1 [ true, %27 ], [ %29, %30 ]
  br label %33

33:                                               ; preds = %31, %24
  %34 = phi i1 [ true, %24 ], [ %32, %31 ]
  br i1 %34, label %35, label %272

35:                                               ; preds = %33
  %36 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %37 unwind label %48

37:                                               ; preds = %35
  br i1 %36, label %38, label %52

38:                                               ; preds = %37
  %39 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %40)
          to label %41 unwind label %48

41:                                               ; preds = %38
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %42 unwind label %48

42:                                               ; preds = %41
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %43 unwind label %48

43:                                               ; preds = %42
  store i32 1, ptr %7, align 4
  br label %367

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

48:                                               ; preds = %364, %362, %354, %343, %336, %331, %325, %63, %61, %55, %52, %42, %41, %38, %35, %28, %25, %22
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %5, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %6, align 4
  br label %370

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

54:                                               ; preds = %52
  br i1 %53, label %55, label %115

55:                                               ; preds = %54
  %56 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 3
  store i32 0, ptr %56, align 8, !tbaa !36
  %57 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 4
  store i32 0, ptr %57, align 4, !tbaa !37
  %58 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 5
  store i32 0, ptr %58, align 8, !tbaa !38
  %59 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %60)
          to label %61 unwind label %48

61:                                               ; preds = %55
  %62 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 11
  store i8 0, ptr %62, align 8, !tbaa !39
  invoke void @_ZN9floodFill9FloodFill11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %63 unwind label %48

63:                                               ; preds = %61
  %64 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 10
  %65 = invoke noundef ptr @_ZN9floodFill7History17getCheckpointCellEv(ptr noundef nonnull align 8 dereferenceable(224) %64)
          to label %66 unwind label %48

66:                                               ; preds = %63
  %67 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %68 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %67, i64 0, i64 0
  %69 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %68, i64 0, i64 0
  %70 = icmp eq ptr %65, %69
  br i1 %70, label %71, label %72

71:                                               ; preds = %66
  store i32 1, ptr %7, align 4
  br label %367

72:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #6
  %73 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 10
  invoke void @_ZN9floodFill7History18getCheckpointStackEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8 %8, ptr noundef nonnull align 8 dereferenceable(224) %73)
          to label %74 unwind label %92

74:                                               ; preds = %72
  %75 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr %9) #6
  %76 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 10
  invoke void @_ZN9floodFill7History17getCheckpointPathEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8 %9, ptr noundef nonnull align 8 dereferenceable(224) %76)
          to label %77 unwind label %96

77:                                               ; preds = %74
  %78 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 10
  invoke void @_ZN9floodFill7History18resetModifiedCellsEv(ptr noundef nonnull align 8 dereferenceable(224) %78)
          to label %79 unwind label %100

79:                                               ; preds = %77
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2ERKS6_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %80 unwind label %100

80:                                               ; preds = %79
  %81 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill19proceedToCheckpointESt5stackIPNS_4CellESt5dequeIS3_SaIS3_EEE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %10)
          to label %82 unwind label %104

82:                                               ; preds = %80
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #6
  br i1 %81, label %83, label %109

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

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

86:                                               ; preds = %85
  %87 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 1
  %88 = load ptr, ptr %87, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %88)
          to label %89 unwind label %100

89:                                               ; preds = %86
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %90 unwind label %100

90:                                               ; preds = %89
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %91 unwind label %100

91:                                               ; preds = %90
  store i32 1, ptr %7, align 4
  br label %111

92:                                               ; preds = %72
  %93 = landingpad { ptr, i32 }
          cleanup
  %94 = extractvalue { ptr, i32 } %93, 0
  store ptr %94, ptr %5, align 8
  %95 = extractvalue { ptr, i32 } %93, 1
  store i32 %95, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  br label %370

96:                                               ; preds = %74
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %5, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %6, align 4
  br label %114

100:                                              ; preds = %90, %89, %86, %83, %79, %77
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %5, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %6, align 4
  br label %113

104:                                              ; preds = %80
  %105 = landingpad { ptr, i32 }
          cleanup
  %106 = extractvalue { ptr, i32 } %105, 0
  store ptr %106, ptr %5, align 8
  %107 = extractvalue { ptr, i32 } %105, 1
  store i32 %107, ptr %6, align 4
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #6
  br label %113

108:                                              ; preds = %85
  store i32 2, ptr %7, align 4
  br label %111, !llvm.loop !40

109:                                              ; preds = %82
  %110 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 11
  store i8 1, ptr %110, align 8, !tbaa !39
  store i32 2, ptr %7, align 4
  br label %111, !llvm.loop !40

111:                                              ; preds = %109, %108, %91
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  %112 = load i32, ptr %7, align 4
  switch i32 %112, label %367 [
    i32 2, label %22
  ]

113:                                              ; preds = %104, %100
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  br label %114

114:                                              ; preds = %113, %96
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  br label %370

115:                                              ; preds = %54
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #6
  store i8 1, ptr %11, align 1, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !5
  br label %116

116:                                              ; preds = %169, %115
  %117 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %118 = trunc i8 %117 to i1
  br i1 %118, label %119, label %123

119:                                              ; preds = %116
  %120 = invoke noundef zeroext i1 @_ZNKSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %121 unwind label %134

121:                                              ; preds = %119
  %122 = xor i1 %120, true
  br label %123

123:                                              ; preds = %121, %116
  %124 = phi i1 [ false, %116 ], [ %122, %121 ]
  br i1 %124, label %125, label %170

125:                                              ; preds = %123
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %127 unwind label %134

127:                                              ; preds = %125
  %128 = load ptr, ptr %126, align 8, !tbaa !5
  store ptr %128, ptr %12, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %129 unwind label %134

129:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !45
  br label %130

130:                                              ; preds = %149, %129
  %131 = load i32, ptr %13, align 4, !tbaa !45
  %132 = icmp slt i32 %131, 4
  br i1 %132, label %138, label %133

133:                                              ; preds = %130
  store i32 6, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %156

134:                                              ; preds = %254, %250, %247, %244, %221, %219, %216, %213, %210, %205, %197, %194, %180, %174, %167, %164, %161, %159, %127, %125, %119
  %135 = landingpad { ptr, i32 }
          cleanup
  %136 = extractvalue { ptr, i32 } %135, 0
  store ptr %136, ptr %5, align 8
  %137 = extractvalue { ptr, i32 } %135, 1
  store i32 %137, ptr %6, align 4
  br label %271

138:                                              ; preds = %130
  %139 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %140 = trunc i8 %139 to i1
  br i1 %140, label %141, label %146

141:                                              ; preds = %138
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = load i32, ptr %13, align 4, !tbaa !45
  %144 = invoke noundef zeroext i1 @_ZN9floodFill4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(40) %142, i32 noundef %143)
          to label %145 unwind label %152

145:                                              ; preds = %141
  br label %146

146:                                              ; preds = %145, %138
  %147 = phi i1 [ false, %138 ], [ %144, %145 ]
  %148 = zext i1 %147 to i8
  store i8 %148, ptr %11, align 1, !tbaa !42
  br label %149

149:                                              ; preds = %146
  %150 = load i32, ptr %13, align 4, !tbaa !45
  %151 = add nsw i32 %150, 1
  store i32 %151, ptr %13, align 4, !tbaa !45
  br label %130, !llvm.loop !46

152:                                              ; preds = %141
  %153 = landingpad { ptr, i32 }
          cleanup
  %154 = extractvalue { ptr, i32 } %153, 0
  store ptr %154, ptr %5, align 8
  %155 = extractvalue { ptr, i32 } %153, 1
  store i32 %155, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %271

156:                                              ; preds = %133
  %157 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %158 = trunc i8 %157 to i1
  br i1 %158, label %159, label %169

159:                                              ; preds = %156
  %160 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN9floodFill4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(40) %160, i1 noundef zeroext true)
          to label %161 unwind label %134

161:                                              ; preds = %159
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = invoke noundef i32 @_ZN9floodFill4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(40) %162)
          to label %164 unwind label %134

164:                                              ; preds = %161
  %165 = load ptr, ptr %12, align 8, !tbaa !5
  %166 = invoke noundef i32 @_ZN9floodFill4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(40) %165)
          to label %167 unwind label %134

167:                                              ; preds = %164
  invoke void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505) %17, i32 noundef %163, i32 noundef %166)
          to label %168 unwind label %134

168:                                              ; preds = %167
  br label %169

169:                                              ; preds = %168, %156
  br label %116, !llvm.loop !47

170:                                              ; preds = %123
  %171 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %172 = trunc i8 %171 to i1
  br i1 %172, label %173, label %174

173:                                              ; preds = %170
  store i32 3, ptr %7, align 4
  br label %268

174:                                              ; preds = %170
  %175 = load ptr, ptr %12, align 8, !tbaa !5
  %176 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %175)
          to label %177 unwind label %134

177:                                              ; preds = %174
  %178 = icmp ne ptr %176, null
  br i1 %178, label %179, label %254

179:                                              ; preds = %177
  br label %180

180:                                              ; preds = %239, %225, %179
  %181 = load ptr, ptr %12, align 8, !tbaa !5
  %182 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %181)
          to label %183 unwind label %134

183:                                              ; preds = %180
  %184 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %185 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 3
  %186 = load i32, ptr %185, align 8, !tbaa !36
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %184, i64 0, i64 %187
  %189 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 4
  %190 = load i32, ptr %189, align 4, !tbaa !37
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %188, i64 0, i64 %191
  %193 = icmp ne ptr %182, %192
  br i1 %193, label %194, label %203

194:                                              ; preds = %183
  %195 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %196 unwind label %134

196:                                              ; preds = %194
  br i1 %195, label %200, label %197

197:                                              ; preds = %196
  %198 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %199 unwind label %134

199:                                              ; preds = %197
  br label %200

200:                                              ; preds = %199, %196
  %201 = phi i1 [ true, %196 ], [ %198, %199 ]
  %202 = xor i1 %201, true
  br label %203

203:                                              ; preds = %200, %183
  %204 = phi i1 [ false, %183 ], [ %202, %200 ]
  br i1 %204, label %205, label %244

205:                                              ; preds = %203
  %206 = load ptr, ptr %12, align 8, !tbaa !5
  %207 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13isOneCellAwayEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %206)
          to label %208 unwind label %134

208:                                              ; preds = %205
  br i1 %207, label %209, label %210

209:                                              ; preds = %208
  br label %244

210:                                              ; preds = %208
  %211 = load ptr, ptr %12, align 8, !tbaa !5
  %212 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %211)
          to label %213 unwind label %134

213:                                              ; preds = %210
  %214 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13isOneCellAwayEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %212)
          to label %215 unwind label %134

215:                                              ; preds = %213
  br i1 %214, label %216, label %221

216:                                              ; preds = %215
  %217 = load ptr, ptr %12, align 8, !tbaa !5
  %218 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %217)
          to label %219 unwind label %134

219:                                              ; preds = %216
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %218)
          to label %220 unwind label %134

220:                                              ; preds = %219
  br label %244

221:                                              ; preds = %215
  %222 = load ptr, ptr %12, align 8, !tbaa !5
  %223 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14tryUntraversedEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %222)
          to label %224 unwind label %134

224:                                              ; preds = %221
  br i1 %223, label %225, label %226

225:                                              ; preds = %224
  br label %180, !llvm.loop !48

226:                                              ; preds = %224
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %227 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %228 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 3
  %229 = load i32, ptr %228, align 8, !tbaa !36
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %227, i64 0, i64 %230
  %232 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 4
  %233 = load i32, ptr %232, align 4, !tbaa !37
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %231, i64 0, i64 %234
  %236 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %235)
          to label %237 unwind label %240

237:                                              ; preds = %226
  store ptr %236, ptr %14, align 8, !tbaa !5
  %238 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %238)
          to label %239 unwind label %240

239:                                              ; preds = %237
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %180, !llvm.loop !48

240:                                              ; preds = %237, %226
  %241 = landingpad { ptr, i32 }
          cleanup
  %242 = extractvalue { ptr, i32 } %241, 0
  store ptr %242, ptr %5, align 8
  %243 = extractvalue { ptr, i32 } %241, 1
  store i32 %243, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %271

244:                                              ; preds = %220, %209, %203
  %245 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %246 unwind label %134

246:                                              ; preds = %244
  br i1 %245, label %253, label %247

247:                                              ; preds = %246
  %248 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %249 unwind label %134

249:                                              ; preds = %247
  br i1 %248, label %253, label %250

250:                                              ; preds = %249
  %251 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %251)
          to label %252 unwind label %134

252:                                              ; preds = %250
  br label %253

253:                                              ; preds = %252, %249, %246
  br label %254

254:                                              ; preds = %253, %177
  invoke void @_ZN9floodFill9FloodFill23doUpdatesForCurrentCellEPSt5stackIPNS_4CellESt5dequeIS3_SaIS3_EEE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %3)
          to label %255 unwind label %134

255:                                              ; preds = %254
  %256 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 7
  %257 = load i8, ptr %256, align 8, !tbaa !49, !range !43, !noundef !44
  %258 = trunc i8 %257 to i1
  br i1 %258, label %267, label %259

259:                                              ; preds = %255
  %260 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 3
  %261 = load i32, ptr %260, align 8, !tbaa !36
  %262 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 4
  %263 = load i32, ptr %262, align 4, !tbaa !37
  %264 = call noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505) %17, i32 noundef %261, i32 noundef %263)
  br i1 %264, label %265, label %267

265:                                              ; preds = %259
  %266 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 7
  store i8 1, ptr %266, align 8, !tbaa !49
  br label %267

267:                                              ; preds = %265, %259, %255
  store i32 0, ptr %7, align 4
  br label %268

268:                                              ; preds = %267, %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  %269 = load i32, ptr %7, align 4
  switch i32 %269, label %376 [
    i32 0, label %270
    i32 3, label %272
  ]

270:                                              ; preds = %268
  br label %22, !llvm.loop !40

271:                                              ; preds = %240, %152, %134
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  br label %370

272:                                              ; preds = %268, %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !45
  br label %273

273:                                              ; preds = %310, %272
  %274 = load i32, ptr %15, align 4, !tbaa !45
  %275 = icmp slt i32 %274, 16
  br i1 %275, label %277, label %276

276:                                              ; preds = %273
  store i32 11, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %313

277:                                              ; preds = %273
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !45
  br label %278

278:                                              ; preds = %306, %277
  %279 = load i32, ptr %16, align 4, !tbaa !45
  %280 = icmp slt i32 %279, 16
  br i1 %280, label %282, label %281

281:                                              ; preds = %278
  store i32 14, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %309

282:                                              ; preds = %278
  %283 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %284 = load i32, ptr %15, align 4, !tbaa !45
  %285 = sext i32 %284 to i64
  %286 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %283, i64 0, i64 %285
  %287 = load i32, ptr %16, align 4, !tbaa !45
  %288 = sext i32 %287 to i64
  %289 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %286, i64 0, i64 %288
  %290 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %289)
          to label %291 unwind label %301

291:                                              ; preds = %282
  br i1 %290, label %305, label %292

292:                                              ; preds = %291
  %293 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %294 = load i32, ptr %15, align 4, !tbaa !45
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %293, i64 0, i64 %295
  %297 = load i32, ptr %16, align 4, !tbaa !45
  %298 = sext i32 %297 to i64
  %299 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %296, i64 0, i64 %298
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %299, i32 noundef 255)
          to label %300 unwind label %301

300:                                              ; preds = %292
  br label %305

301:                                              ; preds = %292, %282
  %302 = landingpad { ptr, i32 }
          cleanup
  %303 = extractvalue { ptr, i32 } %302, 0
  store ptr %303, ptr %5, align 8
  %304 = extractvalue { ptr, i32 } %302, 1
  store i32 %304, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %370

305:                                              ; preds = %300, %291
  br label %306

306:                                              ; preds = %305
  %307 = load i32, ptr %16, align 4, !tbaa !45
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %16, align 4, !tbaa !45
  br label %278, !llvm.loop !50

309:                                              ; preds = %281
  br label %310

310:                                              ; preds = %309
  %311 = load i32, ptr %15, align 4, !tbaa !45
  %312 = add nsw i32 %311, 1
  store i32 %312, ptr %15, align 4, !tbaa !45
  br label %273, !llvm.loop !51

313:                                              ; preds = %276
  %314 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 8
  store i8 1, ptr %314, align 1, !tbaa !52
  br label %315

315:                                              ; preds = %357, %342, %313
  %316 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 3
  %317 = load i32, ptr %316, align 8, !tbaa !36
  %318 = icmp ne i32 %317, 0
  br i1 %318, label %323, label %319

319:                                              ; preds = %315
  %320 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 4
  %321 = load i32, ptr %320, align 4, !tbaa !37
  %322 = icmp ne i32 %321, 0
  br label %323

323:                                              ; preds = %319, %315
  %324 = phi i1 [ true, %315 ], [ %322, %319 ]
  br i1 %324, label %325, label %358

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

330:                                              ; preds = %325
  br i1 %329, label %331, label %336

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

335:                                              ; preds = %331
  br label %357

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

341:                                              ; preds = %336
  br i1 %340, label %342, label %343

342:                                              ; preds = %341
  br label %315, !llvm.loop !53

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

354:                                              ; preds = %343
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %17, ptr noundef %353)
          to label %355 unwind label %48

355:                                              ; preds = %354
  br label %356

356:                                              ; preds = %355
  br label %357

357:                                              ; preds = %356, %335
  br label %315, !llvm.loop !53

358:                                              ; preds = %323
  %359 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 5
  %360 = load i32, ptr %359, align 8, !tbaa !38
  %361 = icmp eq i32 %360, 2
  br i1 %361, label %362, label %364

362:                                              ; preds = %358
  invoke void @_ZN9floodFill9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %363 unwind label %48

363:                                              ; preds = %362
  br label %366

364:                                              ; preds = %358
  invoke void @_ZN9floodFill9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
          to label %365 unwind label %48

365:                                              ; preds = %364
  br label %366

366:                                              ; preds = %365, %363
  store i32 0, ptr %7, align 4
  br label %367

367:                                              ; preds = %366, %111, %71, %43
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  %368 = load i32, ptr %7, align 4
  switch i32 %368, label %376 [
    i32 0, label %369
    i32 1, label %369
  ]

369:                                              ; preds = %367, %367
  ret void

370:                                              ; preds = %301, %271, %114, %92, %48, %44
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  br label %371

371:                                              ; preds = %370
  %372 = load ptr, ptr %5, align 8
  %373 = load i32, ptr %6, align 4
  %374 = insertvalue { ptr, i32 } poison, ptr %372, 0
  %375 = insertvalue { ptr, i32 } %374, i32 %373, 1
  resume { ptr, i32 } %375

376:                                              ; preds = %367, %268
  unreachable
}

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

declare void @_ZN9floodFill4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) #5

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

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

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

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

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

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

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

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

declare noundef i32 @_ZN9floodFill4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(40)) #5

declare noundef i32 @_ZN9floodFill4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(40)) #5

declare noundef zeroext i1 @_ZN9floodFill4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #5

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

declare noundef ptr @_ZN9floodFill7History17getCheckpointCellEv(ptr noundef nonnull align 8 dereferenceable(224)) #5

declare void @_ZN9floodFill7History18getCheckpointStackEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8, ptr noundef nonnull align 8 dereferenceable(224)) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

declare void @_ZN9floodFill7History17getCheckpointPathEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8, ptr noundef nonnull align 8 dereferenceable(224)) #5

declare void @_ZN9floodFill7History18resetModifiedCellsEv(ptr noundef nonnull align 8 dereferenceable(224)) #5

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

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

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

declare noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40)) #5

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 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 = { 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 #5 = { "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 #6 = { 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, !6, i64 8}
!10 = !{!"_ZTSN9floodFill9FloodFillE", !11, i64 0, !6, i64 8, !7, i64 16, !12, i64 10256, !12, i64 10260, !12, i64 10264, !12, i64 10268, !13, i64 10272, !13, i64 10273, !14, i64 10280, !13, i64 10504}
!11 = !{!"_ZTS15IMouseAlgorithm"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN9floodFill7HistoryE", !12, i64 0, !12, i64 4, !6, i64 8, !15, i64 16, !22, i64 96, !28, i64 176, !33, i64 200}
!15 = !{!"_ZTSSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE", !16, i64 0}
!16 = !{!"_ZTSSt5dequeIPN9floodFill4CellESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt11_Deque_baseIPN9floodFill4CellESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE11_Deque_implE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !21, i64 16, !21, i64 48}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSSt15_Deque_iteratorIPN9floodFill4CellERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSSt5queueISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEES4_IS7_SaIS7_EEE", !23, i64 0}
!23 = !{!"_ZTSSt5dequeISt5stackIPN9floodFill4CellES_IS3_SaIS3_EEESaIS6_EE", !24, i64 0}
!24 = !{!"_ZTSSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE11_Deque_implE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !27, i64 16, !27, i64 48}
!27 = !{!"_ZTSSt15_Deque_iteratorISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEERS7_PS7_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !30, i64 0}
!30 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !31, i64 0}
!31 = !{!"_ZTSNSt8__detail17_List_node_headerE", !32, i64 0, !20, i64 16}
!32 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!33 = !{!"_ZTSNSt7__cxx114listINS0_IN9floodFill7CellmodESaIS2_EEESaIS4_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EE10_List_implE", !31, i64 0}
!36 = !{!10, !12, i64 10256}
!37 = !{!10, !12, i64 10260}
!38 = !{!10, !12, i64 10264}
!39 = !{!10, !13, i64 10504}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!13, !13, i64 0}
!43 = !{i8 0, i8 2}
!44 = !{}
!45 = !{!12, !12, i64 0}
!46 = distinct !{!46, !41}
!47 = distinct !{!47, !41}
!48 = distinct !{!48, !41}
!49 = !{!10, !13, i64 10272}
!50 = distinct !{!50, !41}
!51 = distinct !{!51, !41}
!52 = !{!10, !13, i64 10273}
!53 = distinct !{!53, !41}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_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 @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9floodFill9FloodFill7exploreEv(ptr noundef nonnull align 8 dereferenceable(10505) %0) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::stack", align 8
  %3 = alloca ptr, align 8
  %4 = alloca %"class.std::stack", align 8
  %5 = alloca %"class.std::stack", align 8
  %6 = alloca %"class.std::stack", align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2IS5_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %7, ptr %3, align 8, !tbaa !5
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE4pushEOS2_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %8 unwind label %29

8:                                                ; preds = %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 10256
  %10 = getelementptr inbounds i8, ptr %0, i64 10260
  %11 = getelementptr inbounds i8, ptr %0, i64 10272
  %12 = getelementptr inbounds i8, ptr %0, i64 10264
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = getelementptr inbounds i8, ptr %0, i64 10504
  %15 = getelementptr inbounds i8, ptr %0, i64 10280
  br label %.backedge85

.critedge59:                                      ; preds = %51, %62
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  br label %.backedge85.backedge

.backedge85:                                      ; preds = %.backedge85.backedge, %8
  %16 = call noundef zeroext i1 @_ZNKSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %16, label %17, label %.critedge

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

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

20:                                               ; preds = %19
  %21 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %22 unwind label %.loopexit.split-lp.loopexit

22:                                               ; preds = %20
  br i1 %21, label %.critedge, label %.preheader.preheader

.critedge:                                        ; preds = %.backedge85, %19, %22
  %23 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %24 unwind label %.loopexit.split-lp.loopexit

24:                                               ; preds = %.critedge
  br i1 %23, label %25, label %31

25:                                               ; preds = %24
  %26 = load ptr, ptr %13, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %26)
          to label %27 unwind label %.loopexit.split-lp.loopexit.split-lp

27:                                               ; preds = %25
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %28 unwind label %.loopexit.split-lp.loopexit.split-lp

28:                                               ; preds = %27
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %.loopexit80 unwind label %.loopexit.split-lp.loopexit.split-lp

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

.loopexit:                                        ; preds = %.critedge6, %231, %232, %235, %242
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %37, %36, %34, %31, %.critedge, %20, %17
  %lpad.loopexit76 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %248, %247, %28, %27, %25
  %lpad.loopexit.split-lp77 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

31:                                               ; preds = %24
  %32 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %33 unwind label %.loopexit.split-lp.loopexit

33:                                               ; preds = %31
  br i1 %32, label %34, label %.preheader72

34:                                               ; preds = %33
  store i32 0, ptr %9, align 8, !tbaa !36
  store i32 0, ptr %10, align 4, !tbaa !37
  store i32 0, ptr %12, align 8, !tbaa !38
  %35 = load ptr, ptr %13, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %35)
          to label %36 unwind label %.loopexit.split-lp.loopexit

36:                                               ; preds = %34
  store i8 0, ptr %14, align 8, !tbaa !39
  invoke void @_ZN9floodFill9FloodFill11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %37 unwind label %.loopexit.split-lp.loopexit

37:                                               ; preds = %36
  %38 = invoke noundef ptr @_ZN9floodFill7History17getCheckpointCellEv(ptr noundef nonnull align 8 dereferenceable(224) %15)
          to label %39 unwind label %.loopexit.split-lp.loopexit

39:                                               ; preds = %37
  %40 = icmp eq ptr %38, %7
  br i1 %40, label %.loopexit80, label %41

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #6
  invoke void @_ZN9floodFill7History18getCheckpointStackEv(ptr dead_on_unwind nonnull writable sret(%"class.std::stack") align 8 %4, ptr noundef nonnull align 8 dereferenceable(224) %15)
          to label %42 unwind label %56

42:                                               ; preds = %41
  %43 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %5) #6
  invoke void @_ZN9floodFill7History17getCheckpointPathEv(ptr dead_on_unwind nonnull writable sret(%"class.std::stack") align 8 %5, ptr noundef nonnull align 8 dereferenceable(224) %15)
          to label %44 unwind label %58

44:                                               ; preds = %42
  invoke void @_ZN9floodFill7History18resetModifiedCellsEv(ptr noundef nonnull align 8 dereferenceable(224) %15)
          to label %45 unwind label %.loopexit81

45:                                               ; preds = %44
  invoke void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEC2ERKS6_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %46 unwind label %.loopexit81

46:                                               ; preds = %45
  %47 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill19proceedToCheckpointESt5stackIPNS_4CellESt5dequeIS3_SaIS3_EEE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %6)
          to label %48 unwind label %60

48:                                               ; preds = %46
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  br i1 %47, label %49, label %62

49:                                               ; preds = %48
  %50 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %51 unwind label %.loopexit81

51:                                               ; preds = %49
  br i1 %50, label %52, label %.critedge59, !llvm.loop !40

52:                                               ; preds = %51
  %53 = load ptr, ptr %13, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(296) %53)
          to label %54 unwind label %.loopexit.split-lp82

54:                                               ; preds = %52
  invoke void @_ZN9floodFill9FloodFill11resetColorsEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %55 unwind label %.loopexit.split-lp82

55:                                               ; preds = %54
  invoke void @_ZN9floodFill9FloodFill12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %63 unwind label %.loopexit.split-lp82

56:                                               ; preds = %41
  %57 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #6
  br label %.loopexit.split-lp

58:                                               ; preds = %42
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %65

.loopexit81:                                      ; preds = %44, %45, %49
  %lpad.loopexit83 = landingpad { ptr, i32 }
          cleanup
  br label %64

.loopexit.split-lp82:                             ; preds = %52, %54, %55
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %64

60:                                               ; preds = %46
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  br label %64

62:                                               ; preds = %48
  store i8 1, ptr %14, align 8, !tbaa !39
  br label %.critedge59, !llvm.loop !40

63:                                               ; preds = %55
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  br label %.loopexit80

64:                                               ; preds = %.loopexit81, %.loopexit.split-lp82, %60
  %.pn53 = phi { ptr, i32 } [ %61, %60 ], [ %lpad.loopexit83, %.loopexit81 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp82 ]
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  br label %65

65:                                               ; preds = %64, %58
  %.pn53.pn = phi { ptr, i32 } [ %.pn53, %64 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #6
  br label %.loopexit.split-lp

.preheader72:                                     ; preds = %33, %88
  %66 = call noundef zeroext i1 @_ZNKSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %66, label %.preheader.preheader, label %67

.preheader.preheader:                             ; preds = %22, %.preheader72
  br label %.preheader

.loopexit66:                                      ; preds = %.preheader65, %98, %101, %104, %107, %109, %115
  %lpad.loopexit68 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp67.loopexit:                    ; preds = %88, %86, %84, %83
  %lpad.loopexit73 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp67.loopexit.split-lp:           ; preds = %134, %133, %130, %.critedge4, %114, %112, %.critedge60
  %lpad.loopexit.split-lp74 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

67:                                               ; preds = %.preheader72
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %70 = invoke noundef zeroext i1 @_ZN9floodFill4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(40) %69, i32 noundef 0)
          to label %71 unwind label %81

71:                                               ; preds = %67
  br i1 %70, label %72, label %.critedge60

72:                                               ; preds = %71
  %73 = invoke noundef zeroext i1 @_ZN9floodFill4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(40) %69, i32 noundef 1)
          to label %74 unwind label %81

74:                                               ; preds = %72
  br i1 %73, label %75, label %.critedge60

75:                                               ; preds = %74
  %76 = invoke noundef zeroext i1 @_ZN9floodFill4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(40) %69, i32 noundef 2)
          to label %77 unwind label %81

77:                                               ; preds = %75
  br i1 %76, label %78, label %.critedge60

78:                                               ; preds = %77
  %79 = invoke noundef zeroext i1 @_ZN9floodFill4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(40) %69, i32 noundef 3)
          to label %80 unwind label %81

80:                                               ; preds = %78
  br i1 %79, label %83, label %.critedge60

81:                                               ; preds = %78, %75, %72, %67
  %82 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

83:                                               ; preds = %80
  invoke void @_ZN9floodFill4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(40) %69, i1 noundef zeroext true)
          to label %84 unwind label %.loopexit.split-lp67.loopexit

84:                                               ; preds = %83
  %85 = invoke noundef i32 @_ZN9floodFill4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
          to label %86 unwind label %.loopexit.split-lp67.loopexit

86:                                               ; preds = %84
  %87 = invoke noundef i32 @_ZN9floodFill4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
          to label %88 unwind label %.loopexit.split-lp67.loopexit

88:                                               ; preds = %86
  invoke void @_ZN9floodFill9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %85, i32 noundef %87)
          to label %.preheader72 unwind label %.loopexit.split-lp67.loopexit

.critedge60:                                      ; preds = %71, %74, %77, %80
  %89 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
          to label %90 unwind label %.loopexit.split-lp67.loopexit.split-lp

90:                                               ; preds = %.critedge60
  %.not = icmp eq ptr %89, null
  br i1 %.not, label %134, label %.preheader65

.preheader65:                                     ; preds = %90, %.preheader65.backedge
  %91 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
          to label %92 unwind label %.loopexit66

92:                                               ; preds = %.preheader65
  %93 = load i32, ptr %9, align 8, !tbaa !36
  %94 = sext i32 %93 to i64
  %95 = load i32, ptr %10, align 4, !tbaa !37
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %94, i64 %96
  %.not49 = icmp eq ptr %91, %97
  br i1 %.not49, label %.critedge4, label %98

98:                                               ; preds = %92
  %99 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %100 unwind label %.loopexit66

100:                                              ; preds = %98
  br i1 %99, label %.critedge4, label %101

101:                                              ; preds = %100
  %102 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %103 unwind label %.loopexit66

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

104:                                              ; preds = %103
  %105 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13isOneCellAwayEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %69)
          to label %106 unwind label %.loopexit66

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

107:                                              ; preds = %106
  %108 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
          to label %109 unwind label %.loopexit66

109:                                              ; preds = %107
  %110 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13isOneCellAwayEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef %108)
          to label %111 unwind label %.loopexit66

111:                                              ; preds = %109
  br i1 %110, label %112, label %115

112:                                              ; preds = %111
  %113 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
          to label %114 unwind label %.loopexit.split-lp67.loopexit.split-lp

114:                                              ; preds = %112
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef %113)
          to label %.critedge4 unwind label %.loopexit.split-lp67.loopexit.split-lp

115:                                              ; preds = %111
  %116 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14tryUntraversedEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %69)
          to label %117 unwind label %.loopexit66

117:                                              ; preds = %115
  br i1 %116, label %.preheader65.backedge, label %118

.preheader65.backedge:                            ; preds = %117, %125
  br label %.preheader65, !llvm.loop !42

118:                                              ; preds = %117
  %119 = load i32, ptr %9, align 8, !tbaa !36
  %120 = sext i32 %119 to i64
  %121 = load i32, ptr %10, align 4, !tbaa !37
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %120, i64 %122
  %124 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %123)
          to label %125 unwind label %126

125:                                              ; preds = %118
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef %124)
          to label %.preheader65.backedge unwind label %126

126:                                              ; preds = %125, %118
  %127 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.critedge4:                                       ; preds = %100, %92, %106, %103, %114
  %128 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %129 unwind label %.loopexit.split-lp67.loopexit.split-lp

129:                                              ; preds = %.critedge4
  br i1 %128, label %134, label %130

130:                                              ; preds = %129
  %131 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
          to label %132 unwind label %.loopexit.split-lp67.loopexit.split-lp

132:                                              ; preds = %130
  br i1 %131, label %134, label %133

133:                                              ; preds = %132
  invoke void @_ZN9floodFill9FloodFill11moveOneCellEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %69)
          to label %134 unwind label %.loopexit.split-lp67.loopexit.split-lp

134:                                              ; preds = %129, %132, %133, %90
  invoke void @_ZN9floodFill9FloodFill23doUpdatesForCurrentCellEPSt5stackIPNS_4CellESt5dequeIS3_SaIS3_EEE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %2)
          to label %135 unwind label %.loopexit.split-lp67.loopexit.split-lp

135:                                              ; preds = %134
  %136 = load i8, ptr %11, align 8, !tbaa !43, !range !44, !noundef !45
  %137 = trunc nuw i8 %136 to i1
  br i1 %137, label %.backedge85.backedge, label %138

138:                                              ; preds = %135
  %139 = load i32, ptr %9, align 8, !tbaa !36
  %140 = load i32, ptr %10, align 4, !tbaa !37
  %141 = call noundef zeroext i1 @_ZN9floodFill9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %139, i32 noundef %140)
  br i1 %141, label %142, label %.backedge85.backedge

142:                                              ; preds = %138
  store i8 1, ptr %11, align 8, !tbaa !43
  br label %.backedge85.backedge

.backedge85.backedge:                             ; preds = %142, %138, %135, %.critedge59
  br label %.backedge85

.preheader:                                       ; preds = %.preheader.preheader, %228
  %indvars.iv = phi i64 [ %indvars.iv.next, %228 ], [ 0, %.preheader.preheader ]
  %143 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 0
  %144 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %143)
          to label %149 unwind label %151

145:                                              ; preds = %228
  %146 = getelementptr inbounds i8, ptr %0, i64 10273
  store i8 1, ptr %146, align 1, !tbaa !46
  %147 = load i32, ptr %9, align 8, !tbaa !36
  %.not50101 = icmp eq i32 %147, 0
  %148 = load i32, ptr %10, align 4
  %.not51102 = icmp eq i32 %148, 0
  %or.cond103 = select i1 %.not50101, i1 %.not51102, i1 false
  br i1 %or.cond103, label %._crit_edge, label %.critedge6

149:                                              ; preds = %.preheader
  br i1 %144, label %153, label %150

150:                                              ; preds = %149
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %143, i32 noundef 255)
          to label %153 unwind label %151

151:                                              ; preds = %227, %223, %222, %218, %217, %213, %212, %208, %207, %203, %202, %198, %197, %193, %192, %188, %187, %183, %182, %178, %177, %173, %172, %168, %167, %163, %162, %158, %157, %153, %150, %.preheader
  %152 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

153:                                              ; preds = %149, %150
  %154 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 1
  %155 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %154)
          to label %156 unwind label %151

156:                                              ; preds = %153
  br i1 %155, label %158, label %157

157:                                              ; preds = %156
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %154, i32 noundef 255)
          to label %158 unwind label %151

158:                                              ; preds = %157, %156
  %159 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 2
  %160 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %159)
          to label %161 unwind label %151

161:                                              ; preds = %158
  br i1 %160, label %163, label %162

162:                                              ; preds = %161
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %159, i32 noundef 255)
          to label %163 unwind label %151

163:                                              ; preds = %162, %161
  %164 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 3
  %165 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %164)
          to label %166 unwind label %151

166:                                              ; preds = %163
  br i1 %165, label %168, label %167

167:                                              ; preds = %166
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %164, i32 noundef 255)
          to label %168 unwind label %151

168:                                              ; preds = %167, %166
  %169 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 4
  %170 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %169)
          to label %171 unwind label %151

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

172:                                              ; preds = %171
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %169, i32 noundef 255)
          to label %173 unwind label %151

173:                                              ; preds = %172, %171
  %174 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 5
  %175 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %174)
          to label %176 unwind label %151

176:                                              ; preds = %173
  br i1 %175, label %178, label %177

177:                                              ; preds = %176
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %174, i32 noundef 255)
          to label %178 unwind label %151

178:                                              ; preds = %177, %176
  %179 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 6
  %180 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %179)
          to label %181 unwind label %151

181:                                              ; preds = %178
  br i1 %180, label %183, label %182

182:                                              ; preds = %181
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %179, i32 noundef 255)
          to label %183 unwind label %151

183:                                              ; preds = %182, %181
  %184 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 7
  %185 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %184)
          to label %186 unwind label %151

186:                                              ; preds = %183
  br i1 %185, label %188, label %187

187:                                              ; preds = %186
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %184, i32 noundef 255)
          to label %188 unwind label %151

188:                                              ; preds = %187, %186
  %189 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 8
  %190 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %189)
          to label %191 unwind label %151

191:                                              ; preds = %188
  br i1 %190, label %193, label %192

192:                                              ; preds = %191
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %189, i32 noundef 255)
          to label %193 unwind label %151

193:                                              ; preds = %192, %191
  %194 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 9
  %195 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %194)
          to label %196 unwind label %151

196:                                              ; preds = %193
  br i1 %195, label %198, label %197

197:                                              ; preds = %196
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %194, i32 noundef 255)
          to label %198 unwind label %151

198:                                              ; preds = %197, %196
  %199 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 10
  %200 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %199)
          to label %201 unwind label %151

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

202:                                              ; preds = %201
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %199, i32 noundef 255)
          to label %203 unwind label %151

203:                                              ; preds = %202, %201
  %204 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 11
  %205 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %204)
          to label %206 unwind label %151

206:                                              ; preds = %203
  br i1 %205, label %208, label %207

207:                                              ; preds = %206
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %204, i32 noundef 255)
          to label %208 unwind label %151

208:                                              ; preds = %207, %206
  %209 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 12
  %210 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %209)
          to label %211 unwind label %151

211:                                              ; preds = %208
  br i1 %210, label %213, label %212

212:                                              ; preds = %211
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %209, i32 noundef 255)
          to label %213 unwind label %151

213:                                              ; preds = %212, %211
  %214 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 13
  %215 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %214)
          to label %216 unwind label %151

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

217:                                              ; preds = %216
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %214, i32 noundef 255)
          to label %218 unwind label %151

218:                                              ; preds = %217, %216
  %219 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 14
  %220 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %219)
          to label %221 unwind label %151

221:                                              ; preds = %218
  br i1 %220, label %223, label %222

222:                                              ; preds = %221
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %219, i32 noundef 255)
          to label %223 unwind label %151

223:                                              ; preds = %222, %221
  %224 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %indvars.iv, i64 15
  %225 = invoke noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40) %224)
          to label %226 unwind label %151

226:                                              ; preds = %223
  br i1 %225, label %228, label %227

227:                                              ; preds = %226
  invoke void @_ZN9floodFill4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(40) %224, i32 noundef 255)
          to label %228 unwind label %151

228:                                              ; preds = %227, %226
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 16
  br i1 %exitcond.not, label %145, label %.preheader, !llvm.loop !47

.critedge6:                                       ; preds = %145, %.backedge
  %229 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill13isOneCellAwayEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %7)
          to label %230 unwind label %.loopexit

230:                                              ; preds = %.critedge6
  br i1 %229, label %231, label %232

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

232:                                              ; preds = %230
  %233 = invoke noundef zeroext i1 @_ZN9floodFill9FloodFill14tryUntraversedEPNS_4CellE(ptr noundef nonnull align 8 dereferenceable(10505) %0, ptr noundef nonnull %7)
          to label %234 unwind label %.loopexit

234:                                              ; preds = %232
  br i1 %233, label %.backedge, label %235

235:                                              ; preds = %234
  %236 = load i32, ptr %9, align 8, !tbaa !36
  %237 = sext i32 %236 to i64
  %238 = load i32, ptr %10, align 4, !tbaa !37
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %7, i64 0, i64 %237, i64 %239
  %241 = invoke noundef ptr @_ZN9floodFill4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(40) %240)
          to label %242 unwind label %.loopexit

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

.backedge:                                        ; preds = %231, %242, %234
  %243 = load i32, ptr %9, align 8, !tbaa !36
  %.not50 = icmp eq i32 %243, 0
  %244 = load i32, ptr %10, align 4
  %.not51 = icmp eq i32 %244, 0
  %or.cond = select i1 %.not50, i1 %.not51, i1 false
  br i1 %or.cond, label %._crit_edge, label %.critedge6, !llvm.loop !48

._crit_edge:                                      ; preds = %.backedge, %145
  %245 = load i32, ptr %12, align 8, !tbaa !38
  %246 = icmp eq i32 %245, 2
  br i1 %246, label %247, label %248

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

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

.loopexit80:                                      ; preds = %39, %247, %248, %63, %28
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  ret void

.loopexit.split-lp:                               ; preds = %.loopexit66, %.loopexit.split-lp67.loopexit.split-lp, %.loopexit.split-lp67.loopexit, %.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit, %81, %126, %151, %65, %56, %29
  %.pn56 = phi { ptr, i32 } [ %.pn53.pn, %65 ], [ %57, %56 ], [ %152, %151 ], [ %30, %29 ], [ %82, %81 ], [ %127, %126 ], [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit76, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp77, %.loopexit.split-lp.loopexit.split-lp ], [ %lpad.loopexit68, %.loopexit66 ], [ %lpad.loopexit73, %.loopexit.split-lp67.loopexit ], [ %lpad.loopexit.split-lp74, %.loopexit.split-lp67.loopexit.split-lp ]
  call void @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn56
}

; 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 #5

declare void @_ZN9floodFill4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(40), i1 noundef zeroext) local_unnamed_addr #5

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

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

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

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

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

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

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

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

declare noundef i32 @_ZN9floodFill4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5

declare noundef i32 @_ZN9floodFill4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5

declare noundef zeroext i1 @_ZN9floodFill4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) local_unnamed_addr #5

; 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 #5

declare noundef ptr @_ZN9floodFill7History17getCheckpointCellEv(ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #5

declare void @_ZN9floodFill7History18getCheckpointStackEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8, ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEEaSEOS6_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

declare void @_ZN9floodFill7History17getCheckpointPathEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8, ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #5

declare void @_ZN9floodFill7History18resetModifiedCellsEv(ptr noundef nonnull align 8 dereferenceable(224)) local_unnamed_addr #5

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

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

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

declare noundef zeroext i1 @_ZN9floodFill4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #5

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 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 = { 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 #5 = { "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 #6 = { 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, !6, i64 8}
!10 = !{!"_ZTSN9floodFill9FloodFillE", !11, i64 0, !6, i64 8, !7, i64 16, !12, i64 10256, !12, i64 10260, !12, i64 10264, !12, i64 10268, !13, i64 10272, !13, i64 10273, !14, i64 10280, !13, i64 10504}
!11 = !{!"_ZTS15IMouseAlgorithm"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN9floodFill7HistoryE", !12, i64 0, !12, i64 4, !6, i64 8, !15, i64 16, !22, i64 96, !28, i64 176, !33, i64 200}
!15 = !{!"_ZTSSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE", !16, i64 0}
!16 = !{!"_ZTSSt5dequeIPN9floodFill4CellESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSSt11_Deque_baseIPN9floodFill4CellESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE11_Deque_implE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !21, i64 16, !21, i64 48}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSSt15_Deque_iteratorIPN9floodFill4CellERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSSt5queueISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEES4_IS7_SaIS7_EEE", !23, i64 0}
!23 = !{!"_ZTSSt5dequeISt5stackIPN9floodFill4CellES_IS3_SaIS3_EEESaIS6_EE", !24, i64 0}
!24 = !{!"_ZTSSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE11_Deque_implE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !27, i64 16, !27, i64 48}
!27 = !{!"_ZTSSt15_Deque_iteratorISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEERS7_PS7_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !30, i64 0}
!30 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !31, i64 0}
!31 = !{!"_ZTSNSt8__detail17_List_node_headerE", !32, i64 0, !20, i64 16}
!32 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!33 = !{!"_ZTSNSt7__cxx114listINS0_IN9floodFill7CellmodESaIS2_EEESaIS4_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EE10_List_implE", !31, i64 0}
!36 = !{!10, !12, i64 10256}
!37 = !{!10, !12, i64 10260}
!38 = !{!10, !12, i64 10264}
!39 = !{!10, !13, i64 10504}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = distinct !{!42, !41}
!43 = !{!10, !13, i64 10272}
!44 = !{i8 0, i8 2}
!45 = !{}
!46 = !{!10, !13, i64 10273}
!47 = distinct !{!47, !41}
!48 = distinct !{!48, !41}


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