; LLVM IR from mackorone/mms :: old/v1/src/algo/FloodFill/FloodFill.ll (ZN9FloodFill7exploreEv)

; 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<Cell *, std::allocator<Cell *>>::_Deque_impl" }
%"struct.std::_Deque_base<Cell *, std::allocator<Cell *>>::_Deque_impl" = type { %"struct.std::_Deque_base<Cell *, std::allocator<Cell *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Cell *, std::allocator<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 = type <{ %class.IAlgorithm, ptr, [16 x [16 x %class.Cell]], i32, i32, i32, i32, i8, i8, [6 x i8], %class.History, i8, [7 x i8] }>
%class.IAlgorithm = type { ptr }
%class.Cell = type { i32, i32, i32, i8, i8, [4 x i8], [4 x i8], ptr }
%class.History = type { i32, i32, ptr, %"class.std::stack", %"class.std::queue", %"class.std::__cxx11::list", %"class.std::__cxx11::list.9" }
%"class.std::queue" = type { %"class.std::deque.0" }
%"class.std::deque.0" = type { %"class.std::_Deque_base.1" }
%"class.std::_Deque_base.1" = type { %"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.5", %"struct.std::_Deque_iterator.5" }
%"struct.std::_Deque_iterator.5" = 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.9" = type { %"class.std::__cxx11::_List_base.10" }
%"class.std::__cxx11::_List_base.10" = type { %"struct.std::__cxx11::_List_base<std::__cxx11::list<Cellmod>, std::allocator<std::__cxx11::list<Cellmod>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::__cxx11::list<Cellmod>, std::allocator<std::__cxx11::list<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

; 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 @_ZN9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(8457), i32 noundef, i32 noundef) #1 align 2

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9FloodFill7exploreEv(ptr noundef nonnull align 8 dereferenceable(8457) %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 @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEC2IS4_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, ptr %17, i32 0, i32 2
  %19 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %18, i64 0, i64 0
  %20 = getelementptr inbounds [16 x %class.Cell], ptr %19, i64 0, i64 0
  store ptr %20, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %21 unwind label %54

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

22:                                               ; preds = %298, %131, %21
  %23 = invoke noundef zeroext i1 @_ZNKSt5stackIP4CellSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %24 unwind label %58

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

25:                                               ; preds = %24
  %26 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %27 = load ptr, ptr %26, align 8, !tbaa !9
  %28 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %27)
          to label %29 unwind label %58

29:                                               ; preds = %25
  br i1 %28, label %35, label %30

30:                                               ; preds = %29
  %31 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %32)
          to label %34 unwind label %58

34:                                               ; preds = %30
  br label %35

35:                                               ; preds = %34, %29
  %36 = phi i1 [ true, %29 ], [ %33, %34 ]
  br label %37

37:                                               ; preds = %35, %24
  %38 = phi i1 [ true, %24 ], [ %36, %35 ]
  br i1 %38, label %39, label %300

39:                                               ; preds = %37
  %40 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %41)
          to label %43 unwind label %58

43:                                               ; preds = %39
  br i1 %42, label %44, label %62

44:                                               ; preds = %43
  %45 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %46)
          to label %47 unwind label %58

47:                                               ; preds = %44
  %48 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %49, i32 noundef 0, i32 noundef 0)
          to label %50 unwind label %58

50:                                               ; preds = %47
  %51 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %52)
          to label %53 unwind label %58

53:                                               ; preds = %50
  store i32 1, ptr %7, align 4
  br label %395

54:                                               ; preds = %1
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %5, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %398

58:                                               ; preds = %392, %390, %382, %371, %364, %359, %353, %77, %73, %67, %62, %50, %47, %44, %39, %30, %25, %22
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %5, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %6, align 4
  br label %398

62:                                               ; preds = %43
  %63 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %64 = load ptr, ptr %63, align 8, !tbaa !9
  %65 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %64)
          to label %66 unwind label %58

66:                                               ; preds = %62
  br i1 %65, label %67, label %135

67:                                               ; preds = %66
  %68 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 3
  store i32 0, ptr %68, align 8, !tbaa !36
  %69 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 4
  store i32 0, ptr %69, align 4, !tbaa !37
  %70 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 5
  store i32 0, ptr %70, align 8, !tbaa !38
  %71 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %72 = load ptr, ptr %71, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %72)
          to label %73 unwind label %58

73:                                               ; preds = %67
  %74 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 11
  store i8 0, ptr %74, align 8, !tbaa !39
  %75 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %76)
          to label %77 unwind label %58

77:                                               ; preds = %73
  %78 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 10
  %79 = invoke noundef ptr @_ZN7History17getCheckpointCellEv(ptr noundef nonnull align 8 dereferenceable(224) %78)
          to label %80 unwind label %58

80:                                               ; preds = %77
  %81 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %82 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %81, i64 0, i64 0
  %83 = getelementptr inbounds [16 x %class.Cell], ptr %82, i64 0, i64 0
  %84 = icmp eq ptr %79, %83
  br i1 %84, label %85, label %86

85:                                               ; preds = %80
  store i32 1, ptr %7, align 4
  br label %395

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #6
  %87 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 10
  invoke void @_ZN7History18getCheckpointStackEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8 %8, ptr noundef nonnull align 8 dereferenceable(224) %87)
          to label %88 unwind label %112

88:                                               ; preds = %86
  %89 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEaSEOS5_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_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
  %90 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 10
  invoke void @_ZN7History17getCheckpointPathEv(ptr dead_on_unwind writable sret(%"class.std::stack") align 8 %9, ptr noundef nonnull align 8 dereferenceable(224) %90)
          to label %91 unwind label %116

91:                                               ; preds = %88
  %92 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 10
  invoke void @_ZN7History18resetModifiedCellsEv(ptr noundef nonnull align 8 dereferenceable(224) %92)
          to label %93 unwind label %120

93:                                               ; preds = %91
  invoke void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef nonnull align 8 dereferenceable(80) %9)
          to label %94 unwind label %120

94:                                               ; preds = %93
  %95 = invoke noundef zeroext i1 @_ZN9FloodFill19proceedToCheckpointESt5stackIP4CellSt5dequeIS2_SaIS2_EEE(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %10)
          to label %96 unwind label %124

96:                                               ; preds = %94
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #6
  br i1 %95, label %97, label %129

97:                                               ; preds = %96
  %98 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !9
  %100 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %99)
          to label %101 unwind label %120

101:                                              ; preds = %97
  br i1 %100, label %102, label %128

102:                                              ; preds = %101
  %103 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %104)
          to label %105 unwind label %120

105:                                              ; preds = %102
  %106 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %107, i32 noundef 0, i32 noundef 0)
          to label %108 unwind label %120

108:                                              ; preds = %105
  %109 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %110)
          to label %111 unwind label %120

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

112:                                              ; preds = %86
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %5, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  br label %398

116:                                              ; preds = %88
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %5, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %6, align 4
  br label %134

120:                                              ; preds = %108, %105, %102, %97, %93, %91
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %5, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %6, align 4
  br label %133

124:                                              ; preds = %94
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %5, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %6, align 4
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #6
  br label %133

128:                                              ; preds = %101
  store i32 2, ptr %7, align 4
  br label %131, !llvm.loop !40

129:                                              ; preds = %96
  %130 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 11
  store i8 1, ptr %130, align 8, !tbaa !39
  store i32 2, ptr %7, align 4
  br label %131, !llvm.loop !40

131:                                              ; preds = %129, %128, %111
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  %132 = load i32, ptr %7, align 4
  switch i32 %132, label %395 [
    i32 2, label %22
  ]

133:                                              ; preds = %124, %120
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %9) #6
  br label %134

134:                                              ; preds = %133, %116
  call void @llvm.lifetime.end.p0(i64 80, ptr %9) #6
  br label %398

135:                                              ; preds = %66
  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 %136

136:                                              ; preds = %189, %135
  %137 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %138 = trunc i8 %137 to i1
  br i1 %138, label %139, label %143

139:                                              ; preds = %136
  %140 = invoke noundef zeroext i1 @_ZNKSt5stackIP4CellSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %141 unwind label %154

141:                                              ; preds = %139
  %142 = xor i1 %140, true
  br label %143

143:                                              ; preds = %141, %136
  %144 = phi i1 [ false, %136 ], [ %142, %141 ]
  br i1 %144, label %145, label %190

145:                                              ; preds = %143
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %147 unwind label %154

147:                                              ; preds = %145
  %148 = load ptr, ptr %146, align 8, !tbaa !5
  store ptr %148, ptr %12, align 8, !tbaa !5
  invoke void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
          to label %149 unwind label %154

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

150:                                              ; preds = %169, %149
  %151 = load i32, ptr %13, align 4, !tbaa !45
  %152 = icmp slt i32 %151, 4
  br i1 %152, label %158, label %153

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

154:                                              ; preds = %282, %278, %273, %268, %245, %243, %240, %237, %234, %229, %219, %214, %200, %194, %187, %184, %181, %179, %147, %145, %139
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %5, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %6, align 4
  br label %299

158:                                              ; preds = %150
  %159 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %160 = trunc i8 %159 to i1
  br i1 %160, label %161, label %166

161:                                              ; preds = %158
  %162 = load ptr, ptr %12, align 8, !tbaa !5
  %163 = load i32, ptr %13, align 4, !tbaa !45
  %164 = invoke noundef zeroext i1 @_ZN4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(32) %162, i32 noundef %163)
          to label %165 unwind label %172

165:                                              ; preds = %161
  br label %166

166:                                              ; preds = %165, %158
  %167 = phi i1 [ false, %158 ], [ %164, %165 ]
  %168 = zext i1 %167 to i8
  store i8 %168, ptr %11, align 1, !tbaa !42
  br label %169

169:                                              ; preds = %166
  %170 = load i32, ptr %13, align 4, !tbaa !45
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %13, align 4, !tbaa !45
  br label %150, !llvm.loop !46

172:                                              ; preds = %161
  %173 = landingpad { ptr, i32 }
          cleanup
  %174 = extractvalue { ptr, i32 } %173, 0
  store ptr %174, ptr %5, align 8
  %175 = extractvalue { ptr, i32 } %173, 1
  store i32 %175, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %299

176:                                              ; preds = %153
  %177 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %178 = trunc i8 %177 to i1
  br i1 %178, label %179, label %189

179:                                              ; preds = %176
  %180 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(32) %180, i1 noundef zeroext true)
          to label %181 unwind label %154

181:                                              ; preds = %179
  %182 = load ptr, ptr %12, align 8, !tbaa !5
  %183 = invoke noundef i32 @_ZN4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(32) %182)
          to label %184 unwind label %154

184:                                              ; preds = %181
  %185 = load ptr, ptr %12, align 8, !tbaa !5
  %186 = invoke noundef i32 @_ZN4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(32) %185)
          to label %187 unwind label %154

187:                                              ; preds = %184
  invoke void @_ZN9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(8457) %17, i32 noundef %183, i32 noundef %186)
          to label %188 unwind label %154

188:                                              ; preds = %187
  br label %189

189:                                              ; preds = %188, %176
  br label %136, !llvm.loop !47

190:                                              ; preds = %143
  %191 = load i8, ptr %11, align 1, !tbaa !42, !range !43, !noundef !44
  %192 = trunc i8 %191 to i1
  br i1 %192, label %193, label %194

193:                                              ; preds = %190
  store i32 3, ptr %7, align 4
  br label %296

194:                                              ; preds = %190
  %195 = load ptr, ptr %12, align 8, !tbaa !5
  %196 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %195)
          to label %197 unwind label %154

197:                                              ; preds = %194
  %198 = icmp ne ptr %196, null
  br i1 %198, label %199, label %282

199:                                              ; preds = %197
  br label %200

200:                                              ; preds = %263, %249, %199
  %201 = load ptr, ptr %12, align 8, !tbaa !5
  %202 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %201)
          to label %203 unwind label %154

203:                                              ; preds = %200
  %204 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %205 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 3
  %206 = load i32, ptr %205, align 8, !tbaa !36
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %204, i64 0, i64 %207
  %209 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 4
  %210 = load i32, ptr %209, align 4, !tbaa !37
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [16 x %class.Cell], ptr %208, i64 0, i64 %211
  %213 = icmp ne ptr %202, %212
  br i1 %213, label %214, label %227

214:                                              ; preds = %203
  %215 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %216 = load ptr, ptr %215, align 8, !tbaa !9
  %217 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %216)
          to label %218 unwind label %154

218:                                              ; preds = %214
  br i1 %217, label %224, label %219

219:                                              ; preds = %218
  %220 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %221 = load ptr, ptr %220, align 8, !tbaa !9
  %222 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %221)
          to label %223 unwind label %154

223:                                              ; preds = %219
  br label %224

224:                                              ; preds = %223, %218
  %225 = phi i1 [ true, %218 ], [ %222, %223 ]
  %226 = xor i1 %225, true
  br label %227

227:                                              ; preds = %224, %203
  %228 = phi i1 [ false, %203 ], [ %226, %224 ]
  br i1 %228, label %229, label %268

229:                                              ; preds = %227
  %230 = load ptr, ptr %12, align 8, !tbaa !5
  %231 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %230)
          to label %232 unwind label %154

232:                                              ; preds = %229
  br i1 %231, label %233, label %234

233:                                              ; preds = %232
  br label %268

234:                                              ; preds = %232
  %235 = load ptr, ptr %12, align 8, !tbaa !5
  %236 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %235)
          to label %237 unwind label %154

237:                                              ; preds = %234
  %238 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %236)
          to label %239 unwind label %154

239:                                              ; preds = %237
  br i1 %238, label %240, label %245

240:                                              ; preds = %239
  %241 = load ptr, ptr %12, align 8, !tbaa !5
  %242 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %241)
          to label %243 unwind label %154

243:                                              ; preds = %240
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %242)
          to label %244 unwind label %154

244:                                              ; preds = %243
  br label %268

245:                                              ; preds = %239
  %246 = load ptr, ptr %12, align 8, !tbaa !5
  %247 = invoke noundef zeroext i1 @_ZN9FloodFill14tryUntraversedEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %246)
          to label %248 unwind label %154

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

249:                                              ; preds = %248
  br label %200, !llvm.loop !48

250:                                              ; preds = %248
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %251 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %252 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 3
  %253 = load i32, ptr %252, align 8, !tbaa !36
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %251, i64 0, i64 %254
  %256 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 4
  %257 = load i32, ptr %256, align 4, !tbaa !37
  %258 = sext i32 %257 to i64
  %259 = getelementptr inbounds [16 x %class.Cell], ptr %255, i64 0, i64 %258
  %260 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %259)
          to label %261 unwind label %264

261:                                              ; preds = %250
  store ptr %260, ptr %14, align 8, !tbaa !5
  %262 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %262)
          to label %263 unwind label %264

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

264:                                              ; preds = %261, %250
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %5, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %299

268:                                              ; preds = %244, %233, %227
  %269 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %270 = load ptr, ptr %269, align 8, !tbaa !9
  %271 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %270)
          to label %272 unwind label %154

272:                                              ; preds = %268
  br i1 %271, label %281, label %273

273:                                              ; preds = %272
  %274 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 1
  %275 = load ptr, ptr %274, align 8, !tbaa !9
  %276 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %275)
          to label %277 unwind label %154

277:                                              ; preds = %273
  br i1 %276, label %281, label %278

278:                                              ; preds = %277
  %279 = load ptr, ptr %12, align 8, !tbaa !5
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %279)
          to label %280 unwind label %154

280:                                              ; preds = %278
  br label %281

281:                                              ; preds = %280, %277, %272
  br label %282

282:                                              ; preds = %281, %197
  invoke void @_ZN9FloodFill23doUpdatesForCurrentCellEPSt5stackIP4CellSt5dequeIS2_SaIS2_EEE(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %3)
          to label %283 unwind label %154

283:                                              ; preds = %282
  %284 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 7
  %285 = load i8, ptr %284, align 8, !tbaa !49, !range !43, !noundef !44
  %286 = trunc i8 %285 to i1
  br i1 %286, label %295, label %287

287:                                              ; preds = %283
  %288 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 3
  %289 = load i32, ptr %288, align 8, !tbaa !36
  %290 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 4
  %291 = load i32, ptr %290, align 4, !tbaa !37
  %292 = call noundef zeroext i1 @_ZN9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(8457) %17, i32 noundef %289, i32 noundef %291)
  br i1 %292, label %293, label %295

293:                                              ; preds = %287
  %294 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 7
  store i8 1, ptr %294, align 8, !tbaa !49
  br label %295

295:                                              ; preds = %293, %287, %283
  store i32 0, ptr %7, align 4
  br label %296

296:                                              ; preds = %295, %193
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  %297 = load i32, ptr %7, align 4
  switch i32 %297, label %404 [
    i32 0, label %298
    i32 3, label %300
  ]

298:                                              ; preds = %296
  br label %22, !llvm.loop !40

299:                                              ; preds = %264, %172, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #6
  br label %398

300:                                              ; preds = %296, %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !45
  br label %301

301:                                              ; preds = %338, %300
  %302 = load i32, ptr %15, align 4, !tbaa !45
  %303 = icmp slt i32 %302, 16
  br i1 %303, label %305, label %304

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

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

306:                                              ; preds = %334, %305
  %307 = load i32, ptr %16, align 4, !tbaa !45
  %308 = icmp slt i32 %307, 16
  br i1 %308, label %310, label %309

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

310:                                              ; preds = %306
  %311 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %312 = load i32, ptr %15, align 4, !tbaa !45
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %311, i64 0, i64 %313
  %315 = load i32, ptr %16, align 4, !tbaa !45
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [16 x %class.Cell], ptr %314, i64 0, i64 %316
  %318 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %317)
          to label %319 unwind label %329

319:                                              ; preds = %310
  br i1 %318, label %333, label %320

320:                                              ; preds = %319
  %321 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %322 = load i32, ptr %15, align 4, !tbaa !45
  %323 = sext i32 %322 to i64
  %324 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %321, i64 0, i64 %323
  %325 = load i32, ptr %16, align 4, !tbaa !45
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [16 x %class.Cell], ptr %324, i64 0, i64 %326
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %327, i32 noundef 256)
          to label %328 unwind label %329

328:                                              ; preds = %320
  br label %333

329:                                              ; preds = %320, %310
  %330 = landingpad { ptr, i32 }
          cleanup
  %331 = extractvalue { ptr, i32 } %330, 0
  store ptr %331, ptr %5, align 8
  %332 = extractvalue { ptr, i32 } %330, 1
  store i32 %332, 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 %398

333:                                              ; preds = %328, %319
  br label %334

334:                                              ; preds = %333
  %335 = load i32, ptr %16, align 4, !tbaa !45
  %336 = add nsw i32 %335, 1
  store i32 %336, ptr %16, align 4, !tbaa !45
  br label %306, !llvm.loop !50

337:                                              ; preds = %309
  br label %338

338:                                              ; preds = %337
  %339 = load i32, ptr %15, align 4, !tbaa !45
  %340 = add nsw i32 %339, 1
  store i32 %340, ptr %15, align 4, !tbaa !45
  br label %301, !llvm.loop !51

341:                                              ; preds = %304
  %342 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 8
  store i8 1, ptr %342, align 1, !tbaa !52
  br label %343

343:                                              ; preds = %385, %370, %341
  %344 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 3
  %345 = load i32, ptr %344, align 8, !tbaa !36
  %346 = icmp ne i32 %345, 0
  br i1 %346, label %351, label %347

347:                                              ; preds = %343
  %348 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 4
  %349 = load i32, ptr %348, align 4, !tbaa !37
  %350 = icmp ne i32 %349, 0
  br label %351

351:                                              ; preds = %347, %343
  %352 = phi i1 [ true, %343 ], [ %350, %347 ]
  br i1 %352, label %353, label %386

353:                                              ; preds = %351
  %354 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %355 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %354, i64 0, i64 0
  %356 = getelementptr inbounds [16 x %class.Cell], ptr %355, i64 0, i64 0
  %357 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %356)
          to label %358 unwind label %58

358:                                              ; preds = %353
  br i1 %357, label %359, label %364

359:                                              ; preds = %358
  %360 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %361 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %360, i64 0, i64 0
  %362 = getelementptr inbounds [16 x %class.Cell], ptr %361, i64 0, i64 0
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %362)
          to label %363 unwind label %58

363:                                              ; preds = %359
  br label %385

364:                                              ; preds = %358
  %365 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %366 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %365, i64 0, i64 0
  %367 = getelementptr inbounds [16 x %class.Cell], ptr %366, i64 0, i64 0
  %368 = invoke noundef zeroext i1 @_ZN9FloodFill14tryUntraversedEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %367)
          to label %369 unwind label %58

369:                                              ; preds = %364
  br i1 %368, label %370, label %371

370:                                              ; preds = %369
  br label %343, !llvm.loop !53

371:                                              ; preds = %369
  %372 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 2
  %373 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 3
  %374 = load i32, ptr %373, align 8, !tbaa !36
  %375 = sext i32 %374 to i64
  %376 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %372, i64 0, i64 %375
  %377 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 4
  %378 = load i32, ptr %377, align 4, !tbaa !37
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [16 x %class.Cell], ptr %376, i64 0, i64 %379
  %381 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %380)
          to label %382 unwind label %58

382:                                              ; preds = %371
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %17, ptr noundef %381)
          to label %383 unwind label %58

383:                                              ; preds = %382
  br label %384

384:                                              ; preds = %383
  br label %385

385:                                              ; preds = %384, %363
  br label %343, !llvm.loop !53

386:                                              ; preds = %351
  %387 = getelementptr inbounds %class.FloodFill, ptr %17, i32 0, i32 5
  %388 = load i32, ptr %387, align 8, !tbaa !38
  %389 = icmp eq i32 %388, 2
  br i1 %389, label %390, label %392

390:                                              ; preds = %386
  invoke void @_ZN9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(8457) %17)
          to label %391 unwind label %58

391:                                              ; preds = %390
  br label %394

392:                                              ; preds = %386
  invoke void @_ZN9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(8457) %17)
          to label %393 unwind label %58

393:                                              ; preds = %392
  br label %394

394:                                              ; preds = %393, %391
  store i32 0, ptr %7, align 4
  br label %395

395:                                              ; preds = %394, %131, %85, %53
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  %396 = load i32, ptr %7, align 4
  switch i32 %396, label %404 [
    i32 0, label %397
    i32 1, label %397
  ]

397:                                              ; preds = %395, %395
  ret void

398:                                              ; preds = %329, %299, %134, %112, %58, %54
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %3) #6
  br label %399

399:                                              ; preds = %398
  %400 = load ptr, ptr %5, align 8
  %401 = load i32, ptr %6, align 4
  %402 = insertvalue { ptr, i32 } poison, ptr %400, 0
  %403 = insertvalue { ptr, i32 } %402, i32 %401, 1
  resume { ptr, i32 } %403

404:                                              ; preds = %395, %296
  unreachable
}

declare void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef, i32 noundef) #5

declare void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #5

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

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

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

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

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

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

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

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

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

declare noundef i32 @_ZN4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(32)) #5

declare noundef i32 @_ZN4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(32)) #5

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

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

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

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

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

declare void @_ZN7History18getCheckpointStackEv(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 @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEaSEOS5_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

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

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

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

declare noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32)) #5

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

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

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

declare noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32)) #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 = !{!"_ZTS9FloodFill", !11, i64 0, !6, i64 8, !7, i64 16, !12, i64 8208, !12, i64 8212, !12, i64 8216, !12, i64 8220, !13, i64 8224, !13, i64 8225, !14, i64 8232, !13, i64 8456}
!11 = !{!"_ZTS10IAlgorithm"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS7History", !12, i64 0, !12, i64 4, !6, i64 8, !15, i64 16, !22, i64 96, !28, i64 176, !33, i64 200}
!15 = !{!"_ZTSSt5stackIP4CellSt5dequeIS1_SaIS1_EEE", !16, i64 0}
!16 = !{!"_ZTSSt5dequeIP4CellSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt11_Deque_baseIP4CellSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE11_Deque_implE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !21, i64 16, !21, i64 48}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSSt15_Deque_iteratorIP4CellRS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSSt5queueISt5stackIP4CellSt5dequeIS2_SaIS2_EEES3_IS6_SaIS6_EEE", !23, i64 0}
!23 = !{!"_ZTSSt5dequeISt5stackIP4CellS_IS2_SaIS2_EEESaIS5_EE", !24, i64 0}
!24 = !{!"_ZTSSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE11_Deque_implE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !27, i64 16, !27, i64 48}
!27 = !{!"_ZTSSt15_Deque_iteratorISt5stackIP4CellSt5dequeIS2_SaIS2_EEERS6_PS6_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_I7CellmodSaIS1_EEESaIS3_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EE10_List_implE", !31, i64 0}
!36 = !{!10, !12, i64 8208}
!37 = !{!10, !12, i64 8212}
!38 = !{!10, !12, i64 8216}
!39 = !{!10, !13, i64 8456}
!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 8224}
!50 = distinct !{!50, !41}
!51 = distinct !{!51, !41}
!52 = !{!10, !13, i64 8225}
!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<Cell *, std::allocator<Cell *>>::_Deque_impl" }
%"struct.std::_Deque_base<Cell *, std::allocator<Cell *>>::_Deque_impl" = type { %"struct.std::_Deque_base<Cell *, std::allocator<Cell *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<Cell *, std::allocator<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.Cell = type { i32, i32, i32, i8, i8, [4 x i8], [4 x i8], ptr }

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

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

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

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9FloodFill7exploreEv(ptr noundef nonnull align 8 dereferenceable(8457) %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 @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEC2IS4_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 @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %8 unwind label %34

8:                                                ; preds = %1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = getelementptr inbounds i8, ptr %0, i64 8208
  %11 = getelementptr inbounds i8, ptr %0, i64 8212
  %12 = getelementptr inbounds i8, ptr %0, i64 8224
  %13 = getelementptr inbounds i8, ptr %0, i64 8216
  %14 = getelementptr inbounds i8, ptr %0, i64 8456
  %15 = getelementptr inbounds i8, ptr %0, i64 8232
  br label %.backedge85

.critedge59:                                      ; preds = %58, %71
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_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 @_ZNKSt5stackIP4CellSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %16, label %17, label %.critedge

17:                                               ; preds = %.backedge85
  %18 = load ptr, ptr %9, align 8, !tbaa !9
  %19 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %18)
          to label %20 unwind label %.loopexit.split-lp.loopexit

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

21:                                               ; preds = %20
  %22 = load ptr, ptr %9, align 8, !tbaa !9
  %23 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %22)
          to label %24 unwind label %.loopexit.split-lp.loopexit

24:                                               ; preds = %21
  br i1 %23, label %.critedge, label %.preheader.preheader

.critedge:                                        ; preds = %.backedge85, %20, %24
  %25 = load ptr, ptr %9, align 8, !tbaa !9
  %26 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %25)
          to label %27 unwind label %.loopexit.split-lp.loopexit

27:                                               ; preds = %.critedge
  %28 = load ptr, ptr %9, align 8, !tbaa !9
  br i1 %26, label %29, label %36

29:                                               ; preds = %27
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %28)
          to label %30 unwind label %.loopexit.split-lp.loopexit.split-lp

30:                                               ; preds = %29
  %31 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %31, i32 noundef 0, i32 noundef 0)
          to label %32 unwind label %.loopexit.split-lp.loopexit.split-lp

32:                                               ; preds = %30
  %33 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %33)
          to label %.loopexit80 unwind label %.loopexit.split-lp.loopexit.split-lp

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

.loopexit:                                        ; preds = %.critedge6, %244, %245, %248, %255
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %43, %41, %39, %36, %.critedge, %21, %17
  %lpad.loopexit76 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %261, %260, %32, %30, %29
  %lpad.loopexit.split-lp77 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

36:                                               ; preds = %27
  %37 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %28)
          to label %38 unwind label %.loopexit.split-lp.loopexit

38:                                               ; preds = %36
  br i1 %37, label %39, label %.preheader72

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

41:                                               ; preds = %39
  store i8 0, ptr %14, align 8, !tbaa !39
  %42 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %42)
          to label %43 unwind label %.loopexit.split-lp.loopexit

43:                                               ; preds = %41
  %44 = invoke noundef ptr @_ZN7History17getCheckpointCellEv(ptr noundef nonnull align 8 dereferenceable(224) %15)
          to label %45 unwind label %.loopexit.split-lp.loopexit

45:                                               ; preds = %43
  %46 = icmp eq ptr %44, %7
  br i1 %46, label %.loopexit80, label %47

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

48:                                               ; preds = %47
  %49 = call noundef nonnull align 8 dereferenceable(80) ptr @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEaSEOS5_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 8 dereferenceable(80) %4) #6
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_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 @_ZN7History17getCheckpointPathEv(ptr dead_on_unwind nonnull writable sret(%"class.std::stack") align 8 %5, ptr noundef nonnull align 8 dereferenceable(224) %15)
          to label %50 unwind label %67

50:                                               ; preds = %48
  invoke void @_ZN7History18resetModifiedCellsEv(ptr noundef nonnull align 8 dereferenceable(224) %15)
          to label %51 unwind label %.loopexit81

51:                                               ; preds = %50
  invoke void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEC2ERKS5_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(80) %5)
          to label %52 unwind label %.loopexit81

52:                                               ; preds = %51
  %53 = invoke noundef zeroext i1 @_ZN9FloodFill19proceedToCheckpointESt5stackIP4CellSt5dequeIS2_SaIS2_EEE(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %6)
          to label %54 unwind label %69

54:                                               ; preds = %52
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  br i1 %53, label %55, label %71

55:                                               ; preds = %54
  %56 = load ptr, ptr %9, align 8, !tbaa !9
  %57 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %56)
          to label %58 unwind label %.loopexit81

58:                                               ; preds = %55
  br i1 %57, label %59, label %.critedge59, !llvm.loop !40

59:                                               ; preds = %58
  %60 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %60)
          to label %61 unwind label %.loopexit.split-lp82

61:                                               ; preds = %59
  %62 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %62, i32 noundef 0, i32 noundef 0)
          to label %63 unwind label %.loopexit.split-lp82

63:                                               ; preds = %61
  %64 = load ptr, ptr %9, align 8, !tbaa !9
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %64)
          to label %72 unwind label %.loopexit.split-lp82

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

67:                                               ; preds = %48
  %68 = landingpad { ptr, i32 }
          cleanup
  br label %74

.loopexit81:                                      ; preds = %50, %51, %55
  %lpad.loopexit83 = landingpad { ptr, i32 }
          cleanup
  br label %73

.loopexit.split-lp82:                             ; preds = %59, %61, %63
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %73

69:                                               ; preds = %52
  %70 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #6
  br label %73

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

72:                                               ; preds = %63
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_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

73:                                               ; preds = %.loopexit81, %.loopexit.split-lp82, %69
  %.pn53 = phi { ptr, i32 } [ %70, %69 ], [ %lpad.loopexit83, %.loopexit81 ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp82 ]
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #6
  br label %74

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

.preheader72:                                     ; preds = %38, %97
  %75 = call noundef zeroext i1 @_ZNKSt5stackIP4CellSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  br i1 %75, label %.preheader.preheader, label %76

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

.loopexit66:                                      ; preds = %.preheader65, %107, %111, %115, %118, %120, %126
  %lpad.loopexit68 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp67.loopexit:                    ; preds = %97, %95, %93, %92
  %lpad.loopexit73 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp67.loopexit.split-lp:           ; preds = %147, %146, %142, %.critedge4, %125, %123, %.critedge60
  %lpad.loopexit.split-lp74 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

76:                                               ; preds = %.preheader72
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %78 = load ptr, ptr %77, align 8, !tbaa !5
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %79 = invoke noundef zeroext i1 @_ZN4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(32) %78, i32 noundef 0)
          to label %80 unwind label %90

80:                                               ; preds = %76
  br i1 %79, label %81, label %.critedge60

81:                                               ; preds = %80
  %82 = invoke noundef zeroext i1 @_ZN4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(32) %78, i32 noundef 1)
          to label %83 unwind label %90

83:                                               ; preds = %81
  br i1 %82, label %84, label %.critedge60

84:                                               ; preds = %83
  %85 = invoke noundef zeroext i1 @_ZN4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(32) %78, i32 noundef 2)
          to label %86 unwind label %90

86:                                               ; preds = %84
  br i1 %85, label %87, label %.critedge60

87:                                               ; preds = %86
  %88 = invoke noundef zeroext i1 @_ZN4Cell16getWallInspectedEi(ptr noundef nonnull align 8 dereferenceable(32) %78, i32 noundef 3)
          to label %89 unwind label %90

89:                                               ; preds = %87
  br i1 %88, label %92, label %.critedge60

90:                                               ; preds = %87, %84, %81, %76
  %91 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

92:                                               ; preds = %89
  invoke void @_ZN4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(32) %78, i1 noundef zeroext true)
          to label %93 unwind label %.loopexit.split-lp67.loopexit

93:                                               ; preds = %92
  %94 = invoke noundef i32 @_ZN4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(32) %78)
          to label %95 unwind label %.loopexit.split-lp67.loopexit

95:                                               ; preds = %93
  %96 = invoke noundef i32 @_ZN4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(32) %78)
          to label %97 unwind label %.loopexit.split-lp67.loopexit

97:                                               ; preds = %95
  invoke void @_ZN9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(8457) %0, i32 noundef %94, i32 noundef %96)
          to label %.preheader72 unwind label %.loopexit.split-lp67.loopexit

.critedge60:                                      ; preds = %80, %83, %86, %89
  %98 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %78)
          to label %99 unwind label %.loopexit.split-lp67.loopexit.split-lp

99:                                               ; preds = %.critedge60
  %.not = icmp eq ptr %98, null
  br i1 %.not, label %147, label %.preheader65

.preheader65:                                     ; preds = %99, %.preheader65.backedge
  %100 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %78)
          to label %101 unwind label %.loopexit66

101:                                              ; preds = %.preheader65
  %102 = load i32, ptr %10, align 8, !tbaa !36
  %103 = sext i32 %102 to i64
  %104 = load i32, ptr %11, align 4, !tbaa !37
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %103, i64 %105
  %.not49 = icmp eq ptr %100, %106
  br i1 %.not49, label %.critedge4, label %107

107:                                              ; preds = %101
  %108 = load ptr, ptr %9, align 8, !tbaa !9
  %109 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %108)
          to label %110 unwind label %.loopexit66

110:                                              ; preds = %107
  br i1 %109, label %.critedge4, label %111

111:                                              ; preds = %110
  %112 = load ptr, ptr %9, align 8, !tbaa !9
  %113 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %112)
          to label %114 unwind label %.loopexit66

114:                                              ; preds = %111
  br i1 %113, label %.critedge4, label %115

115:                                              ; preds = %114
  %116 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %78)
          to label %117 unwind label %.loopexit66

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

118:                                              ; preds = %117
  %119 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %78)
          to label %120 unwind label %.loopexit66

120:                                              ; preds = %118
  %121 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef %119)
          to label %122 unwind label %.loopexit66

122:                                              ; preds = %120
  br i1 %121, label %123, label %126

123:                                              ; preds = %122
  %124 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %78)
          to label %125 unwind label %.loopexit.split-lp67.loopexit.split-lp

125:                                              ; preds = %123
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef %124)
          to label %.critedge4 unwind label %.loopexit.split-lp67.loopexit.split-lp

126:                                              ; preds = %122
  %127 = invoke noundef zeroext i1 @_ZN9FloodFill14tryUntraversedEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %78)
          to label %128 unwind label %.loopexit66

128:                                              ; preds = %126
  br i1 %127, label %.preheader65.backedge, label %129

.preheader65.backedge:                            ; preds = %128, %136
  br label %.preheader65, !llvm.loop !42

129:                                              ; preds = %128
  %130 = load i32, ptr %10, align 8, !tbaa !36
  %131 = sext i32 %130 to i64
  %132 = load i32, ptr %11, align 4, !tbaa !37
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %131, i64 %133
  %135 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %134)
          to label %136 unwind label %137

136:                                              ; preds = %129
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef %135)
          to label %.preheader65.backedge unwind label %137

137:                                              ; preds = %136, %129
  %138 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.critedge4:                                       ; preds = %110, %101, %117, %114, %125
  %139 = load ptr, ptr %9, align 8, !tbaa !9
  %140 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %139)
          to label %141 unwind label %.loopexit.split-lp67.loopexit.split-lp

141:                                              ; preds = %.critedge4
  br i1 %140, label %147, label %142

142:                                              ; preds = %141
  %143 = load ptr, ptr %9, align 8, !tbaa !9
  %144 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %143)
          to label %145 unwind label %.loopexit.split-lp67.loopexit.split-lp

145:                                              ; preds = %142
  br i1 %144, label %147, label %146

146:                                              ; preds = %145
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %78)
          to label %147 unwind label %.loopexit.split-lp67.loopexit.split-lp

147:                                              ; preds = %141, %145, %146, %99
  invoke void @_ZN9FloodFill23doUpdatesForCurrentCellEPSt5stackIP4CellSt5dequeIS2_SaIS2_EEE(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %2)
          to label %148 unwind label %.loopexit.split-lp67.loopexit.split-lp

148:                                              ; preds = %147
  %149 = load i8, ptr %12, align 8, !tbaa !43, !range !44, !noundef !45
  %150 = trunc nuw i8 %149 to i1
  br i1 %150, label %.backedge85.backedge, label %151

151:                                              ; preds = %148
  %152 = load i32, ptr %10, align 8, !tbaa !36
  %153 = load i32, ptr %11, align 4, !tbaa !37
  %154 = call noundef zeroext i1 @_ZN9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(8457) %0, i32 noundef %152, i32 noundef %153)
  br i1 %154, label %155, label %.backedge85.backedge

155:                                              ; preds = %151
  store i8 1, ptr %12, align 8, !tbaa !43
  br label %.backedge85.backedge

.backedge85.backedge:                             ; preds = %155, %151, %148, %.critedge59
  br label %.backedge85

.preheader:                                       ; preds = %.preheader.preheader, %241
  %indvars.iv = phi i64 [ %indvars.iv.next, %241 ], [ 0, %.preheader.preheader ]
  %156 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 0
  %157 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %156)
          to label %162 unwind label %164

158:                                              ; preds = %241
  %159 = getelementptr inbounds i8, ptr %0, i64 8225
  store i8 1, ptr %159, align 1, !tbaa !46
  %160 = load i32, ptr %10, align 8, !tbaa !36
  %.not50108 = icmp eq i32 %160, 0
  %161 = load i32, ptr %11, align 4
  %.not51109 = icmp eq i32 %161, 0
  %or.cond110 = select i1 %.not50108, i1 %.not51109, i1 false
  br i1 %or.cond110, label %._crit_edge, label %.critedge6

162:                                              ; preds = %.preheader
  br i1 %157, label %166, label %163

163:                                              ; preds = %162
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %156, i32 noundef 256)
          to label %166 unwind label %164

164:                                              ; preds = %240, %236, %235, %231, %230, %226, %225, %221, %220, %216, %215, %211, %210, %206, %205, %201, %200, %196, %195, %191, %190, %186, %185, %181, %180, %176, %175, %171, %170, %166, %163, %.preheader
  %165 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

166:                                              ; preds = %162, %163
  %167 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 1
  %168 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %167)
          to label %169 unwind label %164

169:                                              ; preds = %166
  br i1 %168, label %171, label %170

170:                                              ; preds = %169
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %167, i32 noundef 256)
          to label %171 unwind label %164

171:                                              ; preds = %170, %169
  %172 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 2
  %173 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %172)
          to label %174 unwind label %164

174:                                              ; preds = %171
  br i1 %173, label %176, label %175

175:                                              ; preds = %174
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %172, i32 noundef 256)
          to label %176 unwind label %164

176:                                              ; preds = %175, %174
  %177 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 3
  %178 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %177)
          to label %179 unwind label %164

179:                                              ; preds = %176
  br i1 %178, label %181, label %180

180:                                              ; preds = %179
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %177, i32 noundef 256)
          to label %181 unwind label %164

181:                                              ; preds = %180, %179
  %182 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 4
  %183 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %182)
          to label %184 unwind label %164

184:                                              ; preds = %181
  br i1 %183, label %186, label %185

185:                                              ; preds = %184
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %182, i32 noundef 256)
          to label %186 unwind label %164

186:                                              ; preds = %185, %184
  %187 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 5
  %188 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %187)
          to label %189 unwind label %164

189:                                              ; preds = %186
  br i1 %188, label %191, label %190

190:                                              ; preds = %189
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %187, i32 noundef 256)
          to label %191 unwind label %164

191:                                              ; preds = %190, %189
  %192 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 6
  %193 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %192)
          to label %194 unwind label %164

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

195:                                              ; preds = %194
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %192, i32 noundef 256)
          to label %196 unwind label %164

196:                                              ; preds = %195, %194
  %197 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 7
  %198 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %197)
          to label %199 unwind label %164

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

200:                                              ; preds = %199
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %197, i32 noundef 256)
          to label %201 unwind label %164

201:                                              ; preds = %200, %199
  %202 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 8
  %203 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %202)
          to label %204 unwind label %164

204:                                              ; preds = %201
  br i1 %203, label %206, label %205

205:                                              ; preds = %204
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %202, i32 noundef 256)
          to label %206 unwind label %164

206:                                              ; preds = %205, %204
  %207 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 9
  %208 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %207)
          to label %209 unwind label %164

209:                                              ; preds = %206
  br i1 %208, label %211, label %210

210:                                              ; preds = %209
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %207, i32 noundef 256)
          to label %211 unwind label %164

211:                                              ; preds = %210, %209
  %212 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 10
  %213 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %212)
          to label %214 unwind label %164

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

215:                                              ; preds = %214
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %212, i32 noundef 256)
          to label %216 unwind label %164

216:                                              ; preds = %215, %214
  %217 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 11
  %218 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %217)
          to label %219 unwind label %164

219:                                              ; preds = %216
  br i1 %218, label %221, label %220

220:                                              ; preds = %219
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %217, i32 noundef 256)
          to label %221 unwind label %164

221:                                              ; preds = %220, %219
  %222 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 12
  %223 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %222)
          to label %224 unwind label %164

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

225:                                              ; preds = %224
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %222, i32 noundef 256)
          to label %226 unwind label %164

226:                                              ; preds = %225, %224
  %227 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 13
  %228 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %227)
          to label %229 unwind label %164

229:                                              ; preds = %226
  br i1 %228, label %231, label %230

230:                                              ; preds = %229
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %227, i32 noundef 256)
          to label %231 unwind label %164

231:                                              ; preds = %230, %229
  %232 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 14
  %233 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %232)
          to label %234 unwind label %164

234:                                              ; preds = %231
  br i1 %233, label %236, label %235

235:                                              ; preds = %234
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %232, i32 noundef 256)
          to label %236 unwind label %164

236:                                              ; preds = %235, %234
  %237 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %indvars.iv, i64 15
  %238 = invoke noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32) %237)
          to label %239 unwind label %164

239:                                              ; preds = %236
  br i1 %238, label %241, label %240

240:                                              ; preds = %239
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %237, i32 noundef 256)
          to label %241 unwind label %164

241:                                              ; preds = %240, %239
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 16
  br i1 %exitcond.not, label %158, label %.preheader, !llvm.loop !47

.critedge6:                                       ; preds = %158, %.backedge
  %242 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %7)
          to label %243 unwind label %.loopexit

243:                                              ; preds = %.critedge6
  br i1 %242, label %244, label %245

244:                                              ; preds = %243
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %7)
          to label %.backedge unwind label %.loopexit

245:                                              ; preds = %243
  %246 = invoke noundef zeroext i1 @_ZN9FloodFill14tryUntraversedEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %7)
          to label %247 unwind label %.loopexit

247:                                              ; preds = %245
  br i1 %246, label %.backedge, label %248

248:                                              ; preds = %247
  %249 = load i32, ptr %10, align 8, !tbaa !36
  %250 = sext i32 %249 to i64
  %251 = load i32, ptr %11, align 4, !tbaa !37
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %7, i64 0, i64 %250, i64 %252
  %254 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %253)
          to label %255 unwind label %.loopexit

255:                                              ; preds = %248
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef %254)
          to label %.backedge unwind label %.loopexit

.backedge:                                        ; preds = %244, %255, %247
  %256 = load i32, ptr %10, align 8, !tbaa !36
  %.not50 = icmp eq i32 %256, 0
  %257 = load i32, ptr %11, align 4
  %.not51 = icmp eq i32 %257, 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, %158
  %258 = load i32, ptr %13, align 8, !tbaa !38
  %259 = icmp eq i32 %258, 2
  br i1 %259, label %260, label %261

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

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

.loopexit80:                                      ; preds = %45, %260, %261, %72, %32
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_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, %90, %137, %164, %74, %65, %34
  %.pn56 = phi { ptr, i32 } [ %.pn53.pn, %74 ], [ %66, %65 ], [ %165, %164 ], [ %35, %34 ], [ %91, %90 ], [ %138, %137 ], [ %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 @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_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
}

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

declare void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #5

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

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

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

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

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

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

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

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

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

declare noundef i32 @_ZN4Cell4getXEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

declare noundef i32 @_ZN4Cell4getYEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

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

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

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

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

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

declare void @_ZN7History18getCheckpointStackEv(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 @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEEaSEOS5_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

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

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

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

declare noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

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

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

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

declare noundef zeroext i1 @_ZN4Cell11getExploredEv(ptr noundef nonnull align 8 dereferenceable(32)) 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 = !{!"_ZTS9FloodFill", !11, i64 0, !6, i64 8, !7, i64 16, !12, i64 8208, !12, i64 8212, !12, i64 8216, !12, i64 8220, !13, i64 8224, !13, i64 8225, !14, i64 8232, !13, i64 8456}
!11 = !{!"_ZTS10IAlgorithm"}
!12 = !{!"int", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTS7History", !12, i64 0, !12, i64 4, !6, i64 8, !15, i64 16, !22, i64 96, !28, i64 176, !33, i64 200}
!15 = !{!"_ZTSSt5stackIP4CellSt5dequeIS1_SaIS1_EEE", !16, i64 0}
!16 = !{!"_ZTSSt5dequeIP4CellSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt11_Deque_baseIP4CellSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE11_Deque_implE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !21, i64 16, !21, i64 48}
!20 = !{!"long", !7, i64 0}
!21 = !{!"_ZTSSt15_Deque_iteratorIP4CellRS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!"_ZTSSt5queueISt5stackIP4CellSt5dequeIS2_SaIS2_EEES3_IS6_SaIS6_EEE", !23, i64 0}
!23 = !{!"_ZTSSt5dequeISt5stackIP4CellS_IS2_SaIS2_EEESaIS5_EE", !24, i64 0}
!24 = !{!"_ZTSSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE11_Deque_implE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE16_Deque_impl_dataE", !6, i64 0, !20, i64 8, !27, i64 16, !27, i64 48}
!27 = !{!"_ZTSSt15_Deque_iteratorISt5stackIP4CellSt5dequeIS2_SaIS2_EEERS6_PS6_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_I7CellmodSaIS1_EEESaIS3_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EE10_List_implE", !31, i64 0}
!36 = !{!10, !12, i64 8208}
!37 = !{!10, !12, i64 8212}
!38 = !{!10, !12, i64 8216}
!39 = !{!10, !13, i64 8456}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = distinct !{!42, !41}
!43 = !{!10, !13, i64 8224}
!44 = !{i8 0, i8 2}
!45 = !{}
!46 = !{!10, !13, i64 8225}
!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