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

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

%"class.std::queue.24" = type { %"class.std::deque.25" }
%"class.std::deque.25" = type { %"class.std::_Deque_base.26" }
%"class.std::_Deque_base.26" = type { %"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.30", %"struct.std::_Deque_iterator.30" }
%"struct.std::_Deque_iterator.30" = type { ptr, ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<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.std::__cxx11::list.31" = type { %"class.std::__cxx11::_List_base.32" }
%"class.std::__cxx11::_List_base.32" = type { %"struct.std::__cxx11::_List_base<SimpleCellmod, std::allocator<SimpleCellmod>>::_List_impl" }
%"struct.std::__cxx11::_List_base<SimpleCellmod, std::allocator<SimpleCellmod>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"struct.std::_List_iterator.36" = type { 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" }
%"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" }
%struct.SimpleCellmod = type { ptr, ptr, i32, [4 x i8] }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9FloodFill10bffExploreEPSt5stackIP4CellSt5dequeIS2_SaIS2_EEE(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::queue.24", align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::__cxx11::list.31", align 8
  %13 = alloca %"class.std::__cxx11::list.31", align 8
  %14 = alloca %"struct.std::_List_iterator.36", align 8
  %15 = alloca %"struct.std::_List_iterator.36", align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %19 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 2
  %20 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %19, i64 0, i64 0
  %21 = getelementptr inbounds [16 x %class.Cell], ptr %20, i64 0, i64 0
  store ptr %21, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 80, ptr %6) #5
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEEC2IS7_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
  br label %22

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

23:                                               ; preds = %22
  br label %24

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

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

31:                                               ; preds = %29
  br label %32

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

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

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

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

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

44:                                               ; preds = %103, %100, %94, %89, %85, %82, %79, %74, %72, %70, %68, %58, %53, %50, %48, %36, %35
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %9, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %10, align 4
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  br label %112

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

49:                                               ; preds = %48
  br label %50

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

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

53:                                               ; preds = %52
  %54 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !40
  %56 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %55)
          to label %57 unwind label %44

57:                                               ; preds = %53
  br i1 %56, label %63, label %58

58:                                               ; preds = %57
  %59 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !40
  %61 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %60)
          to label %62 unwind label %44

62:                                               ; preds = %58
  br label %63

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

66:                                               ; preds = %63, %52
  %67 = phi i1 [ false, %52 ], [ %65, %63 ]
  br i1 %67, label %68, label %74

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

70:                                               ; preds = %68
  %71 = load ptr, ptr %69, align 8, !tbaa !5
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %71)
          to label %72 unwind label %44

72:                                               ; preds = %70
  invoke void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %73 unwind label %44

73:                                               ; preds = %72
  br label %50, !llvm.loop !41

74:                                               ; preds = %66
  %75 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !40
  %77 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %76)
          to label %78 unwind label %44

78:                                               ; preds = %74
  br i1 %77, label %79, label %89

79:                                               ; preds = %78
  %80 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %81)
          to label %82 unwind label %44

82:                                               ; preds = %79
  %83 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %84, i32 noundef 0, i32 noundef 0)
          to label %85 unwind label %44

85:                                               ; preds = %82
  %86 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %87)
          to label %88 unwind label %44

88:                                               ; preds = %85
  store i32 1, ptr %11, align 4
  br label %109

89:                                               ; preds = %78
  %90 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %91 = load ptr, ptr %90, align 8, !tbaa !40
  %92 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %91)
          to label %93 unwind label %44

93:                                               ; preds = %89
  br i1 %92, label %94, label %107

94:                                               ; preds = %93
  %95 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  store i32 0, ptr %95, align 8, !tbaa !42
  %96 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  store i32 0, ptr %96, align 4, !tbaa !43
  %97 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 5
  store i32 0, ptr %97, align 8, !tbaa !44
  %98 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %99 = load ptr, ptr %98, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %99)
          to label %100 unwind label %44

100:                                              ; preds = %94
  %101 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %102, i32 noundef 0, i32 noundef 0)
          to label %103 unwind label %44

103:                                              ; preds = %100
  %104 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %105)
          to label %106 unwind label %44

106:                                              ; preds = %103
  store i32 4, ptr %11, align 4
  br label %109, !llvm.loop !45

107:                                              ; preds = %93
  %108 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 11
  store i8 1, ptr %108, align 8, !tbaa !9
  store i32 0, ptr %11, align 4
  br label %109

109:                                              ; preds = %107, %106, %88
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %110 = load i32, ptr %11, align 4
  switch i32 %110, label %410 [
    i32 0, label %111
    i32 4, label %24
  ]

111:                                              ; preds = %109
  br label %24, !llvm.loop !45

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

113:                                              ; preds = %24
  br label %114

114:                                              ; preds = %183, %113
  %115 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  %116 = load i32, ptr %115, align 8, !tbaa !42
  %117 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  %118 = load i32, ptr %117, align 4, !tbaa !43
  %119 = call noundef zeroext i1 @_ZN9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(8457) %18, i32 noundef %116, i32 noundef %118)
  br i1 %119, label %133, label %120

120:                                              ; preds = %114
  %121 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !40
  %123 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %122)
          to label %124 unwind label %150

124:                                              ; preds = %120
  br i1 %123, label %130, label %125

125:                                              ; preds = %124
  %126 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %127 = load ptr, ptr %126, align 8, !tbaa !40
  %128 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %127)
          to label %129 unwind label %150

129:                                              ; preds = %125
  br label %130

130:                                              ; preds = %129, %124
  %131 = phi i1 [ true, %124 ], [ %128, %129 ]
  %132 = xor i1 %131, true
  br label %133

133:                                              ; preds = %130, %114
  %134 = phi i1 [ false, %114 ], [ %132, %130 ]
  br i1 %134, label %135, label %184

135:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #5
  call void @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  %136 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 2
  %137 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  %138 = load i32, ptr %137, align 8, !tbaa !42
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %136, i64 0, i64 %139
  %141 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  %142 = load i32, ptr %141, align 4, !tbaa !43
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [16 x %class.Cell], ptr %140, i64 0, i64 %143
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %12, ptr noundef %144)
          to label %145 unwind label %154

145:                                              ; preds = %135
  %146 = call noundef zeroext i1 @_ZN9FloodFill9spaceLeftEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
  br i1 %146, label %147, label %158

147:                                              ; preds = %145
  %148 = call noundef ptr @_ZN9FloodFill11getLeftCellEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %12, ptr noundef %148)
          to label %149 unwind label %154

149:                                              ; preds = %147
  br label %158

150:                                              ; preds = %303, %296, %221, %216, %214, %210, %205, %201, %198, %195, %190, %185, %184, %125, %120
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %9, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %10, align 4
  br label %411

154:                                              ; preds = %181, %177, %176, %175, %174, %169, %168, %165, %160, %147, %135
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %9, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %10, align 4
  call void @_ZNSt7__cxx1110_List_baseI13SimpleCellmodSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %411

158:                                              ; preds = %149, %145
  %159 = call noundef zeroext i1 @_ZN9FloodFill10spaceFrontEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
  br i1 %159, label %160, label %163

160:                                              ; preds = %158
  %161 = call noundef ptr @_ZN9FloodFill12getFrontCellEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %12, ptr noundef %161)
          to label %162 unwind label %154

162:                                              ; preds = %160
  br label %163

163:                                              ; preds = %162, %158
  %164 = call noundef zeroext i1 @_ZN9FloodFill10spaceRightEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
  br i1 %164, label %165, label %168

165:                                              ; preds = %163
  %166 = call noundef ptr @_ZN9FloodFill12getRightCellEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %12, ptr noundef %166)
          to label %167 unwind label %154

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167, %163
  invoke void @_ZN9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
          to label %169 unwind label %154

169:                                              ; preds = %168
  %170 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  %171 = load i32, ptr %170, align 8, !tbaa !42
  %172 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  %173 = load i32, ptr %172, align 4, !tbaa !43
  invoke void @_ZN9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(8457) %18, i32 noundef %171, i32 noundef %173)
          to label %174 unwind label %154

174:                                              ; preds = %169
  invoke void @_ZN9FloodFill16dobffCellUpdatesEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
          to label %175 unwind label %154

175:                                              ; preds = %174
  invoke void @_ZN9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
          to label %176 unwind label %154

176:                                              ; preds = %175
  invoke void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE4pushERKS4_(ptr noundef nonnull align 8 dereferenceable(80) %6, ptr noundef nonnull align 8 dereferenceable(24) %12)
          to label %177 unwind label %154

177:                                              ; preds = %176
  %178 = invoke noundef i64 @_ZNKSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %179 unwind label %154

179:                                              ; preds = %177
  %180 = icmp ugt i64 %178, 8
  br i1 %180, label %181, label %183

181:                                              ; preds = %179
  invoke void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %182 unwind label %154

182:                                              ; preds = %181
  br label %183

183:                                              ; preds = %182, %179
  call void @_ZNSt7__cxx1110_List_baseI13SimpleCellmodSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %12) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #5
  br label %114, !llvm.loop !46

184:                                              ; preds = %133
  invoke void @_ZN9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
          to label %185 unwind label %150

185:                                              ; preds = %184
  %186 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  %187 = load i32, ptr %186, align 8, !tbaa !42
  %188 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  %189 = load i32, ptr %188, align 4, !tbaa !43
  invoke void @_ZN9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(8457) %18, i32 noundef %187, i32 noundef %189)
          to label %190 unwind label %150

190:                                              ; preds = %185
  %191 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %192 = load ptr, ptr %191, align 8, !tbaa !40
  %193 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %192)
          to label %194 unwind label %150

194:                                              ; preds = %190
  br i1 %193, label %195, label %205

195:                                              ; preds = %194
  %196 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %197 = load ptr, ptr %196, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %197)
          to label %198 unwind label %150

198:                                              ; preds = %195
  %199 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %200 = load ptr, ptr %199, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %200, i32 noundef 0, i32 noundef 0)
          to label %201 unwind label %150

201:                                              ; preds = %198
  %202 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %203 = load ptr, ptr %202, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %203)
          to label %204 unwind label %150

204:                                              ; preds = %201
  store i32 1, ptr %11, align 4
  br label %410

205:                                              ; preds = %194
  %206 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %207 = load ptr, ptr %206, align 8, !tbaa !40
  %208 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %207)
          to label %209 unwind label %150

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

210:                                              ; preds = %209
  %211 = invoke noundef i64 @_ZNKSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %212 unwind label %150

212:                                              ; preds = %210
  %213 = icmp eq i64 %211, 8
  br i1 %213, label %214, label %296

214:                                              ; preds = %212
  %215 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %216 unwind label %150

216:                                              ; preds = %214
  %217 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %215) #5
  %218 = getelementptr inbounds %struct.SimpleCellmod, ptr %217, i32 0, i32 0
  %219 = load ptr, ptr %218, align 8, !tbaa !47
  store ptr %219, ptr %5, align 8, !tbaa !5
  invoke void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %220 unwind label %150

220:                                              ; preds = %216
  br label %221

221:                                              ; preds = %292, %220
  %222 = invoke noundef zeroext i1 @_ZNKSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %223 unwind label %150

223:                                              ; preds = %221
  %224 = xor i1 %222, true
  br i1 %224, label %225, label %295

225:                                              ; preds = %223
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #5
  %226 = invoke noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %227 unwind label %237

227:                                              ; preds = %225
  invoke void @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %226)
          to label %228 unwind label %237

228:                                              ; preds = %227
  invoke void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %6)
          to label %229 unwind label %241

229:                                              ; preds = %228
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %230 = call ptr @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %231 = getelementptr inbounds %"struct.std::_List_iterator.36", ptr %14, i32 0, i32 0
  store ptr %230, ptr %231, align 8
  br label %232

232:                                              ; preds = %289, %229
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %233 = call ptr @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  %234 = getelementptr inbounds %"struct.std::_List_iterator.36", ptr %15, i32 0, i32 0
  store ptr %233, ptr %234, align 8
  %235 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI13SimpleCellmodES3_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br i1 %235, label %245, label %236

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

237:                                              ; preds = %227, %225
  %238 = landingpad { ptr, i32 }
          cleanup
  %239 = extractvalue { ptr, i32 } %238, 0
  store ptr %239, ptr %9, align 8
  %240 = extractvalue { ptr, i32 } %238, 1
  store i32 %240, ptr %10, align 4
  br label %294

241:                                              ; preds = %228
  %242 = landingpad { ptr, i32 }
          cleanup
  %243 = extractvalue { ptr, i32 } %242, 0
  store ptr %243, ptr %9, align 8
  %244 = extractvalue { ptr, i32 } %242, 1
  store i32 %244, ptr %10, align 4
  br label %293

245:                                              ; preds = %232
  %246 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %247 = getelementptr inbounds %struct.SimpleCellmod, ptr %246, i32 0, i32 0
  %248 = load ptr, ptr %247, align 8, !tbaa !47
  %249 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %250 = getelementptr inbounds %struct.SimpleCellmod, ptr %249, i32 0, i32 1
  %251 = load ptr, ptr %250, align 8, !tbaa !49
  invoke void @_ZN4Cell7setPrevEPS_(ptr noundef nonnull align 8 dereferenceable(32) %248, ptr noundef %251)
          to label %252 unwind label %264

252:                                              ; preds = %245
  %253 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %254 = getelementptr inbounds %struct.SimpleCellmod, ptr %253, i32 0, i32 0
  %255 = load ptr, ptr %254, align 8, !tbaa !47
  %256 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %257 = getelementptr inbounds %struct.SimpleCellmod, ptr %256, i32 0, i32 2
  %258 = load i32, ptr %257, align 8, !tbaa !50
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %255, i32 noundef %258)
          to label %259 unwind label %264

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

260:                                              ; preds = %281, %259
  %261 = load i32, ptr %16, align 4, !tbaa !51
  %262 = icmp slt i32 %261, 4
  br i1 %262, label %268, label %263

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

264:                                              ; preds = %252, %245
  %265 = landingpad { ptr, i32 }
          cleanup
  %266 = extractvalue { ptr, i32 } %265, 0
  store ptr %266, ptr %9, align 8
  %267 = extractvalue { ptr, i32 } %265, 1
  store i32 %267, ptr %10, align 4
  br label %291

268:                                              ; preds = %260
  %269 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %270 = getelementptr inbounds %struct.SimpleCellmod, ptr %269, i32 0, i32 0
  %271 = load ptr, ptr %270, align 8, !tbaa !47
  %272 = load i32, ptr %16, align 4, !tbaa !51
  %273 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  %274 = getelementptr inbounds %struct.SimpleCellmod, ptr %273, i32 0, i32 3
  %275 = load i32, ptr %16, align 4, !tbaa !51
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [4 x i8], ptr %274, i64 0, i64 %276
  %278 = load i8, ptr %277, align 1, !tbaa !52, !range !36, !noundef !37
  %279 = trunc i8 %278 to i1
  invoke void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %271, i32 noundef %272, i1 noundef zeroext %279)
          to label %280 unwind label %284

280:                                              ; preds = %268
  br label %281

281:                                              ; preds = %280
  %282 = load i32, ptr %16, align 4, !tbaa !51
  %283 = add nsw i32 %282, 1
  store i32 %283, ptr %16, align 4, !tbaa !51
  br label %260, !llvm.loop !53

284:                                              ; preds = %268
  %285 = landingpad { ptr, i32 }
          cleanup
  %286 = extractvalue { ptr, i32 } %285, 0
  store ptr %286, ptr %9, align 8
  %287 = extractvalue { ptr, i32 } %285, 1
  store i32 %287, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %291

288:                                              ; preds = %263
  br label %289

289:                                              ; preds = %288
  %290 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorI13SimpleCellmodEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #5
  br label %232, !llvm.loop !54

291:                                              ; preds = %284, %264
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %293

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

293:                                              ; preds = %291, %241
  call void @_ZNSt7__cxx1110_List_baseI13SimpleCellmodSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %294

294:                                              ; preds = %293, %237
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #5
  br label %411

295:                                              ; preds = %223
  br label %296

296:                                              ; preds = %295, %212
  %297 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  store i32 0, ptr %297, align 8, !tbaa !42
  %298 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  store i32 0, ptr %298, align 4, !tbaa !43
  %299 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 5
  store i32 0, ptr %299, align 8, !tbaa !44
  %300 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 11
  store i8 0, ptr %300, align 8, !tbaa !9
  %301 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %302 = load ptr, ptr %301, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %302)
          to label %303 unwind label %150

303:                                              ; preds = %296
  %304 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %305 = load ptr, ptr %304, align 8, !tbaa !40
  invoke void @_ZN3sim14MouseInterface11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %305)
          to label %306 unwind label %150

306:                                              ; preds = %303
  br label %22, !llvm.loop !56

307:                                              ; preds = %209
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %308 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 2
  %309 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  %310 = load i32, ptr %309, align 8, !tbaa !42
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %308, i64 0, i64 %311
  %313 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  %314 = load i32, ptr %313, align 4, !tbaa !43
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds [16 x %class.Cell], ptr %312, i64 0, i64 %315
  store ptr %316, ptr %17, align 8, !tbaa !5
  br label %317

317:                                              ; preds = %327, %307
  %318 = load ptr, ptr %17, align 8, !tbaa !5
  %319 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %318)
          to label %320 unwind label %328

320:                                              ; preds = %317
  %321 = icmp ne ptr %319, null
  br i1 %321, label %322, label %332

322:                                              ; preds = %320
  %323 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %323, ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %324 unwind label %328

324:                                              ; preds = %322
  %325 = load ptr, ptr %17, align 8, !tbaa !5
  %326 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %325)
          to label %327 unwind label %328

327:                                              ; preds = %324
  store ptr %326, ptr %17, align 8, !tbaa !5
  br label %317, !llvm.loop !57

328:                                              ; preds = %406, %404, %395, %390, %386, %375, %368, %363, %357, %347, %342, %324, %322, %317
  %329 = landingpad { ptr, i32 }
          cleanup
  %330 = extractvalue { ptr, i32 } %329, 0
  store ptr %330, ptr %9, align 8
  %331 = extractvalue { ptr, i32 } %329, 1
  store i32 %331, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %411

332:                                              ; preds = %320
  %333 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 8
  store i8 1, ptr %333, align 1, !tbaa !58
  br label %334

334:                                              ; preds = %389, %374, %332
  %335 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  %336 = load i32, ptr %335, align 8, !tbaa !42
  %337 = icmp ne i32 %336, 0
  br i1 %337, label %342, label %338

338:                                              ; preds = %334
  %339 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  %340 = load i32, ptr %339, align 4, !tbaa !43
  %341 = icmp ne i32 %340, 0
  br i1 %341, label %342, label %355

342:                                              ; preds = %338, %334
  %343 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %344 = load ptr, ptr %343, align 8, !tbaa !40
  %345 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %344)
          to label %346 unwind label %328

346:                                              ; preds = %342
  br i1 %345, label %352, label %347

347:                                              ; preds = %346
  %348 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %349 = load ptr, ptr %348, align 8, !tbaa !40
  %350 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %349)
          to label %351 unwind label %328

351:                                              ; preds = %347
  br label %352

352:                                              ; preds = %351, %346
  %353 = phi i1 [ true, %346 ], [ %350, %351 ]
  %354 = xor i1 %353, true
  br label %355

355:                                              ; preds = %352, %338
  %356 = phi i1 [ false, %338 ], [ %354, %352 ]
  br i1 %356, label %357, label %390

357:                                              ; preds = %355
  %358 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 2
  %359 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %358, i64 0, i64 0
  %360 = getelementptr inbounds [16 x %class.Cell], ptr %359, i64 0, i64 0
  %361 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %360)
          to label %362 unwind label %328

362:                                              ; preds = %357
  br i1 %361, label %363, label %368

363:                                              ; preds = %362
  %364 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 2
  %365 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %364, i64 0, i64 0
  %366 = getelementptr inbounds [16 x %class.Cell], ptr %365, i64 0, i64 0
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %366)
          to label %367 unwind label %328

367:                                              ; preds = %363
  br label %389

368:                                              ; preds = %362
  %369 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 2
  %370 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %369, i64 0, i64 0
  %371 = getelementptr inbounds [16 x %class.Cell], ptr %370, i64 0, i64 0
  %372 = invoke noundef zeroext i1 @_ZN9FloodFill14tryUntraversedEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %371)
          to label %373 unwind label %328

373:                                              ; preds = %368
  br i1 %372, label %374, label %375

374:                                              ; preds = %373
  br label %334, !llvm.loop !59

375:                                              ; preds = %373
  %376 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 2
  %377 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 3
  %378 = load i32, ptr %377, align 8, !tbaa !42
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %376, i64 0, i64 %379
  %381 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 4
  %382 = load i32, ptr %381, align 4, !tbaa !43
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds [16 x %class.Cell], ptr %380, i64 0, i64 %383
  %385 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %384)
          to label %386 unwind label %328

386:                                              ; preds = %375
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %18, ptr noundef %385)
          to label %387 unwind label %328

387:                                              ; preds = %386
  br label %388

388:                                              ; preds = %387
  br label %389

389:                                              ; preds = %388, %367
  br label %334, !llvm.loop !59

390:                                              ; preds = %355
  %391 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %392 = load ptr, ptr %391, align 8, !tbaa !40
  %393 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %392)
          to label %394 unwind label %328

394:                                              ; preds = %390
  br i1 %393, label %409, label %395

395:                                              ; preds = %394
  %396 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 1
  %397 = load ptr, ptr %396, align 8, !tbaa !40
  %398 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %397)
          to label %399 unwind label %328

399:                                              ; preds = %395
  br i1 %398, label %409, label %400

400:                                              ; preds = %399
  %401 = getelementptr inbounds %class.FloodFill, ptr %18, i32 0, i32 5
  %402 = load i32, ptr %401, align 8, !tbaa !44
  %403 = icmp eq i32 %402, 2
  br i1 %403, label %404, label %406

404:                                              ; preds = %400
  invoke void @_ZN9FloodFill10turnAroundEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
          to label %405 unwind label %328

405:                                              ; preds = %404
  br label %408

406:                                              ; preds = %400
  invoke void @_ZN9FloodFill9turnRightEv(ptr noundef nonnull align 8 dereferenceable(8457) %18)
          to label %407 unwind label %328

407:                                              ; preds = %406
  br label %408

408:                                              ; preds = %407, %405
  br label %409

409:                                              ; preds = %408, %399, %394
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %410

410:                                              ; preds = %409, %204, %109
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void

411:                                              ; preds = %328, %294, %154, %150, %112
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %6) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  br label %412

412:                                              ; preds = %411
  %413 = load ptr, ptr %9, align 8
  %414 = load i32, ptr %10, align 4
  %415 = insertvalue { ptr, i32 } poison, ptr %413, 0
  %416 = insertvalue { ptr, i32 } %415, i32 %414, 1
  resume { ptr, i32 } %416
}

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare void @_ZN4Cell7setPrevEPS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #4

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

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

; 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

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


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

%"class.std::queue.24" = type { %"class.std::deque.25" }
%"class.std::deque.25" = type { %"class.std::_Deque_base.26" }
%"class.std::_Deque_base.26" = type { %"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::__cxx11::list<SimpleCellmod>, std::allocator<std::__cxx11::list<SimpleCellmod>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.30", %"struct.std::_Deque_iterator.30" }
%"struct.std::_Deque_iterator.30" = type { ptr, ptr, ptr, ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<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.std::__cxx11::list.31" = type { %"class.std::__cxx11::_List_base.32" }
%"class.std::__cxx11::_List_base.32" = type { %"struct.std::__cxx11::_List_base<SimpleCellmod, std::allocator<SimpleCellmod>>::_List_impl" }
%"struct.std::__cxx11::_List_base<SimpleCellmod, std::allocator<SimpleCellmod>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"struct.std::_List_iterator.36" = type { 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 @_ZN9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(8457)) local_unnamed_addr #2 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 @_ZN9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(8457)) 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9FloodFill10bffExploreEPSt5stackIP4CellSt5dequeIS2_SaIS2_EEE(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::queue.24", align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::stack", align 8
  %6 = alloca %"class.std::__cxx11::list.31", align 8
  %7 = alloca %"class.std::__cxx11::list.31", align 8
  %8 = alloca %"struct.std::_List_iterator.36", align 8
  %9 = alloca %"struct.std::_List_iterator.36", align 8
  %10 = alloca ptr, align 8
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #5
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEEC2IS7_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %12 = getelementptr inbounds i8, ptr %0, i64 8456
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = getelementptr inbounds i8, ptr %0, i64 8208
  %15 = getelementptr inbounds i8, ptr %0, i64 8212
  %16 = getelementptr inbounds i8, ptr %0, i64 8216
  br label %17

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

.preheader44:                                     ; preds = %61, %17
  %20 = load i32, ptr %14, align 8, !tbaa !37
  %21 = load i32, ptr %15, align 4, !tbaa !38
  %22 = call noundef zeroext i1 @_ZN9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(8457) %0, i32 noundef %20, i32 noundef %21)
  br i1 %22, label %.critedge2, label %.lr.ph90

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

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

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

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

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

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

.loopexit36:                                      ; preds = %.lr.ph85, %33, %37
  %lpad.loopexit38 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp37

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

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

.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp: ; preds = %46, %47, %49
  %lpad.loopexit.split-lp50 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp37

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

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

.lr.ph85:                                         ; preds = %._crit_edge, %40
  %30 = load ptr, ptr %13, align 8, !tbaa !42
  %31 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %30)
          to label %32 unwind label %.loopexit36

32:                                               ; preds = %.lr.ph85
  br i1 %31, label %.critedge, label %33

33:                                               ; preds = %32
  %34 = load ptr, ptr %13, align 8, !tbaa !42
  %35 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %34)
          to label %36 unwind label %.loopexit36

36:                                               ; preds = %33
  br i1 %35, label %.critedge, label %37

37:                                               ; preds = %36
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %39 = load ptr, ptr %38, align 8, !tbaa !39
  invoke void @_ZN9FloodFill11moveOneCellEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef %39)
          to label %40 unwind label %.loopexit36

40:                                               ; preds = %37
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  %41 = call noundef zeroext i1 @_ZNKSt5stackIP4CellSt5dequeIS1_SaIS1_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %5)
  br i1 %41, label %.critedge, label %.lr.ph85, !llvm.loop !43

.critedge:                                        ; preds = %36, %40, %32, %._crit_edge
  %42 = load ptr, ptr %13, align 8, !tbaa !42
  %43 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %42)
          to label %44 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit

44:                                               ; preds = %.critedge
  %45 = load ptr, ptr %13, align 8, !tbaa !42
  br i1 %43, label %46, label %51

46:                                               ; preds = %44
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %45)
          to label %47 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp

47:                                               ; preds = %46
  %48 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %48, i32 noundef 0, i32 noundef 0)
          to label %49 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp

49:                                               ; preds = %47
  %50 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %50)
          to label %.thread unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit.split-lp

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

51:                                               ; preds = %44
  %52 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %45)
          to label %53 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit

53:                                               ; preds = %51
  br i1 %52, label %54, label %60

54:                                               ; preds = %53
  store i32 0, ptr %14, align 8, !tbaa !37
  store i32 0, ptr %15, align 4, !tbaa !38
  store i32 0, ptr %16, align 8, !tbaa !44
  %55 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %55)
          to label %56 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit

56:                                               ; preds = %54
  %57 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %57, i32 noundef 0, i32 noundef 0)
          to label %58 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit

58:                                               ; preds = %56
  %59 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %59)
          to label %61 unwind label %.loopexit.split-lp37.loopexit.split-lp.loopexit, !llvm.loop !45

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

61:                                               ; preds = %58, %60
  call void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %5) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %62 = load i8, ptr %12, align 8, !tbaa !5, !range !35, !noundef !36
  %63 = trunc nuw i8 %62 to i1
  br i1 %63, label %.preheader44, label %.lr.ph89

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

.lr.ph90:                                         ; preds = %.preheader44, %103
  %65 = load ptr, ptr %13, align 8, !tbaa !42
  %66 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %65)
          to label %67 unwind label %.loopexit45

67:                                               ; preds = %.lr.ph90
  br i1 %66, label %.critedge2, label %68

68:                                               ; preds = %67
  %69 = load ptr, ptr %13, align 8, !tbaa !42
  %70 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %69)
          to label %71 unwind label %.loopexit45

71:                                               ; preds = %68
  br i1 %70, label %.critedge2, label %72

72:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %73 = load i32, ptr %14, align 8, !tbaa !37
  %74 = sext i32 %73 to i64
  %75 = load i32, ptr %15, align 4, !tbaa !38
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %11, i64 0, i64 %74, i64 %76
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %6, ptr noundef nonnull %77)
          to label %78 unwind label %82

78:                                               ; preds = %72
  %79 = call noundef zeroext i1 @_ZN9FloodFill9spaceLeftEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
  br i1 %79, label %80, label %84

80:                                               ; preds = %78
  %81 = call noundef ptr @_ZN9FloodFill11getLeftCellEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %6, ptr noundef %81)
          to label %84 unwind label %82

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

.loopexit.split-lp46.loopexit:                    ; preds = %185, %.loopexit43, %120, %110, %107, %.critedge2
  %lpad.loopexit52 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp46

.loopexit.split-lp46.loopexit.split-lp:           ; preds = %118, %116, %115
  %lpad.loopexit.split-lp53 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp46

82:                                               ; preds = %98, %97, %96, %93, %92, %90, %86, %80, %72
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1110_List_baseI13SimpleCellmodSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %.loopexit.split-lp46

84:                                               ; preds = %80, %78
  %85 = call noundef zeroext i1 @_ZN9FloodFill10spaceFrontEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
  br i1 %85, label %86, label %88

86:                                               ; preds = %84
  %87 = call noundef ptr @_ZN9FloodFill12getFrontCellEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %6, ptr noundef %87)
          to label %88 unwind label %82

88:                                               ; preds = %86, %84
  %89 = call noundef zeroext i1 @_ZN9FloodFill10spaceRightEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
  br i1 %89, label %90, label %92

90:                                               ; preds = %88
  %91 = call noundef ptr @_ZN9FloodFill12getRightCellEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
  invoke void @_ZN9FloodFill21bffAppendModifiedCellEPNSt7__cxx114listI13SimpleCellmodSaIS2_EEEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %6, ptr noundef %91)
          to label %92 unwind label %82

92:                                               ; preds = %90, %88
  invoke void @_ZN9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
          to label %93 unwind label %82

93:                                               ; preds = %92
  %94 = load i32, ptr %14, align 8, !tbaa !37
  %95 = load i32, ptr %15, align 4, !tbaa !38
  invoke void @_ZN9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(8457) %0, i32 noundef %94, i32 noundef %95)
          to label %96 unwind label %82

96:                                               ; preds = %93
  invoke void @_ZN9FloodFill16dobffCellUpdatesEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
          to label %97 unwind label %82

97:                                               ; preds = %96
  invoke void @_ZN9FloodFill15moveTowardsGoalEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
          to label %98 unwind label %82

98:                                               ; preds = %97
  invoke void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE4pushERKS4_(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(24) %6)
          to label %99 unwind label %82

99:                                               ; preds = %98
  %100 = call noundef i64 @_ZNKSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %101 = icmp ugt i64 %100, 8
  br i1 %101, label %102, label %103

102:                                              ; preds = %99
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br label %103

103:                                              ; preds = %102, %99
  call void @_ZNSt7__cxx1110_List_baseI13SimpleCellmodSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %104 = load i32, ptr %14, align 8, !tbaa !37
  %105 = load i32, ptr %15, align 4, !tbaa !38
  %106 = call noundef zeroext i1 @_ZN9FloodFill6inGoalEii(ptr noundef nonnull align 8 dereferenceable(8457) %0, i32 noundef %104, i32 noundef %105)
  br i1 %106, label %.critedge2, label %.lr.ph90, !llvm.loop !46

.critedge2:                                       ; preds = %71, %103, %67, %.preheader44
  invoke void @_ZN9FloodFill5wallsEv(ptr noundef nonnull align 8 dereferenceable(8457) %0)
          to label %107 unwind label %.loopexit.split-lp46.loopexit

107:                                              ; preds = %.critedge2
  %108 = load i32, ptr %14, align 8, !tbaa !37
  %109 = load i32, ptr %15, align 4, !tbaa !38
  invoke void @_ZN9FloodFill5floodEii(ptr noundef nonnull align 8 dereferenceable(8457) %0, i32 noundef %108, i32 noundef %109)
          to label %110 unwind label %.loopexit.split-lp46.loopexit

110:                                              ; preds = %107
  %111 = load ptr, ptr %13, align 8, !tbaa !42
  %112 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %111)
          to label %113 unwind label %.loopexit.split-lp46.loopexit

113:                                              ; preds = %110
  %114 = load ptr, ptr %13, align 8, !tbaa !42
  br i1 %112, label %115, label %120

115:                                              ; preds = %113
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %114)
          to label %116 unwind label %.loopexit.split-lp46.loopexit.split-lp

116:                                              ; preds = %115
  %117 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface11resetColorsEii(ptr noundef nonnull align 8 dereferenceable(40) %117, i32 noundef 0, i32 noundef 0)
          to label %118 unwind label %.loopexit.split-lp46.loopexit.split-lp

118:                                              ; preds = %116
  %119 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface12resetHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %119)
          to label %241 unwind label %.loopexit.split-lp46.loopexit.split-lp

120:                                              ; preds = %113
  %121 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %114)
          to label %122 unwind label %.loopexit.split-lp46.loopexit

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

123:                                              ; preds = %122
  %124 = call noundef i64 @_ZNKSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %125 = icmp eq i64 %124, 8
  br i1 %125, label %126, label %.loopexit43

126:                                              ; preds = %123
  %127 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %128 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %127) #5
  %129 = load ptr, ptr %128, align 8, !tbaa !47
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %130 = call noundef zeroext i1 @_ZNKSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %130, label %.loopexit43, label %.lr.ph104

.lr.ph104:                                        ; preds = %126, %._crit_edge102
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  %131 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE5frontEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  invoke void @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EEC2ERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) %131)
          to label %132 unwind label %137

132:                                              ; preds = %.lr.ph104
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %133 = call ptr @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %133, ptr %8, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %134 = call ptr @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %134, ptr %9, align 8
  %135 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI13SimpleCellmodES3_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %135, label %.lr.ph101, label %._crit_edge102

._crit_edge102:                                   ; preds = %176, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt7__cxx1110_List_baseI13SimpleCellmodSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  %136 = call noundef zeroext i1 @_ZNKSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  br i1 %136, label %.loopexit43, label %.lr.ph104, !llvm.loop !49

137:                                              ; preds = %.lr.ph104
  %138 = landingpad { ptr, i32 }
          cleanup
  br label %183

.lr.ph101:                                        ; preds = %132, %176
  %139 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %140 = load ptr, ptr %139, align 8, !tbaa !47
  %141 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %142 = getelementptr inbounds i8, ptr %141, i64 8
  %143 = load ptr, ptr %142, align 8, !tbaa !50
  invoke void @_ZN4Cell7setPrevEPS_(ptr noundef nonnull align 8 dereferenceable(32) %140, ptr noundef %143)
          to label %144 unwind label %156

144:                                              ; preds = %.lr.ph101
  %145 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %146 = load ptr, ptr %145, align 8, !tbaa !47
  %147 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %148 = getelementptr inbounds i8, ptr %147, i64 16
  %149 = load i32, ptr %148, align 8, !tbaa !51
  invoke void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %146, i32 noundef %149)
          to label %.preheader.preheader unwind label %156

.preheader.preheader:                             ; preds = %144
  %150 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %151 = load ptr, ptr %150, align 8, !tbaa !47
  %152 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %153 = getelementptr inbounds i8, ptr %152, i64 20
  %154 = load i8, ptr %153, align 4, !tbaa !52, !range !35, !noundef !36
  %155 = trunc nuw i8 %154 to i1
  invoke void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %151, i32 noundef 0, i1 noundef zeroext %155)
          to label %.preheader.1 unwind label %180

156:                                              ; preds = %144, %.lr.ph101
  %157 = landingpad { ptr, i32 }
          cleanup
  br label %182

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

.preheader.2:                                     ; preds = %.preheader.1
  %164 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %165 = load ptr, ptr %164, align 8, !tbaa !47
  %166 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %167 = getelementptr inbounds i8, ptr %166, i64 22
  %168 = load i8, ptr %167, align 2, !tbaa !52, !range !35, !noundef !36
  %169 = trunc nuw i8 %168 to i1
  invoke void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %165, i32 noundef 2, i1 noundef zeroext %169)
          to label %.preheader.3 unwind label %180

.preheader.3:                                     ; preds = %.preheader.2
  %170 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %171 = load ptr, ptr %170, align 8, !tbaa !47
  %172 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt14_List_iteratorI13SimpleCellmodEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  %173 = getelementptr inbounds i8, ptr %172, i64 23
  %174 = load i8, ptr %173, align 1, !tbaa !52, !range !35, !noundef !36
  %175 = trunc nuw i8 %174 to i1
  invoke void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %171, i32 noundef 3, i1 noundef zeroext %175)
          to label %176 unwind label %180

176:                                              ; preds = %.preheader.3
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt14_List_iteratorI13SimpleCellmodEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  %178 = call ptr @_ZNSt7__cxx114listI13SimpleCellmodSaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  store ptr %178, ptr %9, align 8
  %179 = call noundef zeroext i1 @_ZStneRKSt14_List_iteratorI13SimpleCellmodES3_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  br i1 %179, label %.lr.ph101, label %._crit_edge102, !llvm.loop !53

180:                                              ; preds = %.preheader.3, %.preheader.2, %.preheader.1, %.preheader.preheader
  %181 = landingpad { ptr, i32 }
          cleanup
  br label %182

182:                                              ; preds = %180, %156
  %.pn = phi { ptr, i32 } [ %181, %180 ], [ %157, %156 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @_ZNSt7__cxx1110_List_baseI13SimpleCellmodSaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  br label %183

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

.loopexit43:                                      ; preds = %._crit_edge102, %126, %123
  %.120 = phi ptr [ %.019, %123 ], [ %129, %126 ], [ %129, %._crit_edge102 ]
  store i32 0, ptr %14, align 8, !tbaa !37
  store i32 0, ptr %15, align 4, !tbaa !38
  store i32 0, ptr %16, align 8, !tbaa !44
  store i8 0, ptr %12, align 8, !tbaa !5
  %184 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface13resetPositionEv(ptr noundef nonnull align 8 dereferenceable(40) %184)
          to label %185 unwind label %.loopexit.split-lp46.loopexit

185:                                              ; preds = %.loopexit43
  %186 = load ptr, ptr %13, align 8, !tbaa !42
  invoke void @_ZN3sim14MouseInterface11undoHonoredEv(ptr noundef nonnull align 8 dereferenceable(40) %186)
          to label %17 unwind label %.loopexit.split-lp46.loopexit, !llvm.loop !54

187:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %188 = load i32, ptr %14, align 8, !tbaa !37
  %189 = sext i32 %188 to i64
  %190 = load i32, ptr %15, align 4, !tbaa !38
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %11, i64 0, i64 %189, i64 %191
  br label %193

193:                                              ; preds = %197, %187
  %storemerge = phi ptr [ %192, %187 ], [ %199, %197 ]
  store ptr %storemerge, ptr %10, align 8, !tbaa !39
  %194 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %storemerge)
          to label %195 unwind label %.loopexit.split-lp.loopexit

195:                                              ; preds = %193
  %.not = icmp eq ptr %194, null
  br i1 %.not, label %200, label %196

196:                                              ; preds = %195
  invoke void @_ZNSt5stackIP4CellSt5dequeIS1_SaIS1_EEE4pushERKS1_(ptr noundef nonnull align 8 dereferenceable(80) %1, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %197 unwind label %.loopexit.split-lp.loopexit

197:                                              ; preds = %196
  %198 = load ptr, ptr %10, align 8, !tbaa !39
  %199 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %198)
          to label %193 unwind label %.loopexit.split-lp.loopexit, !llvm.loop !55

.loopexit:                                        ; preds = %.lr.ph109, %207, %211, %214, %215, %218, %225
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %197, %196, %193
  %lpad.loopexit33 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %239, %238, %231, %.critedge4
  %lpad.loopexit.split-lp34 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

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

200:                                              ; preds = %195
  %201 = getelementptr inbounds i8, ptr %0, i64 8225
  store i8 1, ptr %201, align 1, !tbaa !56
  %202 = load i32, ptr %14, align 8, !tbaa !37
  %.not21105 = icmp eq i32 %202, 0
  %203 = load i32, ptr %15, align 4
  %.not22106 = icmp eq i32 %203, 0
  %or.cond107 = select i1 %.not21105, i1 %.not22106, i1 false
  br i1 %or.cond107, label %.critedge4, label %.lr.ph109

.lr.ph109:                                        ; preds = %200, %.backedge
  %204 = load ptr, ptr %13, align 8, !tbaa !42
  %205 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %204)
          to label %206 unwind label %.loopexit

206:                                              ; preds = %.lr.ph109
  br i1 %205, label %.critedge4, label %207

207:                                              ; preds = %206
  %208 = load ptr, ptr %13, align 8, !tbaa !42
  %209 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %208)
          to label %210 unwind label %.loopexit

210:                                              ; preds = %207
  br i1 %209, label %.critedge4, label %211

211:                                              ; preds = %210
  %212 = invoke noundef zeroext i1 @_ZN9FloodFill13isOneCellAwayEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %11)
          to label %213 unwind label %.loopexit

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

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

215:                                              ; preds = %213
  %216 = invoke noundef zeroext i1 @_ZN9FloodFill14tryUntraversedEP4Cell(ptr noundef nonnull align 8 dereferenceable(8457) %0, ptr noundef nonnull %11)
          to label %217 unwind label %.loopexit

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

218:                                              ; preds = %217
  %219 = load i32, ptr %14, align 8, !tbaa !37
  %220 = sext i32 %219 to i64
  %221 = load i32, ptr %15, align 4, !tbaa !38
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %11, i64 0, i64 %220, i64 %222
  %224 = invoke noundef ptr @_ZN4Cell7getPrevEv(ptr noundef nonnull align 8 dereferenceable(32) %223)
          to label %225 unwind label %.loopexit

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

.backedge:                                        ; preds = %214, %225, %217
  %226 = load i32, ptr %14, align 8, !tbaa !37
  %.not21 = icmp eq i32 %226, 0
  %227 = load i32, ptr %15, align 4
  %.not22 = icmp eq i32 %227, 0
  %or.cond = select i1 %.not21, i1 %.not22, i1 false
  br i1 %or.cond, label %.critedge4, label %.lr.ph109, !llvm.loop !57

.critedge4:                                       ; preds = %210, %.backedge, %206, %200
  %228 = load ptr, ptr %13, align 8, !tbaa !42
  %229 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface13undoRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %228)
          to label %230 unwind label %.loopexit.split-lp.loopexit.split-lp

230:                                              ; preds = %.critedge4
  br i1 %229, label %240, label %231

231:                                              ; preds = %230
  %232 = load ptr, ptr %13, align 8, !tbaa !42
  %233 = invoke noundef zeroext i1 @_ZN3sim14MouseInterface14resetRequestedEv(ptr noundef nonnull align 8 dereferenceable(40) %232)
          to label %234 unwind label %.loopexit.split-lp.loopexit.split-lp

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

235:                                              ; preds = %234
  %236 = load i32, ptr %16, align 8, !tbaa !44
  %237 = icmp eq i32 %236, 2
  br i1 %237, label %238, label %239

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

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

240:                                              ; preds = %238, %239, %234, %230
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  br label %241

241:                                              ; preds = %.thread, %118, %240
  call void @_ZNSt5queueINSt7__cxx114listI13SimpleCellmodSaIS2_EEESt5dequeIS4_SaIS4_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  ret void

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare void @_ZN4Cell7setPrevEPS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #4

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

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

; 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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !12, i64 8456}
!6 = !{!"_ZTS9FloodFill", !7, i64 0, !8, i64 8, !9, i64 16, !11, i64 8208, !11, i64 8212, !11, i64 8216, !11, i64 8220, !12, i64 8224, !12, i64 8225, !13, i64 8232, !12, i64 8456}
!7 = !{!"_ZTS10IAlgorithm"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTS7History", !11, i64 0, !11, i64 4, !8, i64 8, !14, i64 16, !21, i64 96, !27, i64 176, !32, i64 200}
!14 = !{!"_ZTSSt5stackIP4CellSt5dequeIS1_SaIS1_EEE", !15, i64 0}
!15 = !{!"_ZTSSt5dequeIP4CellSaIS1_EE", !16, i64 0}
!16 = !{!"_ZTSSt11_Deque_baseIP4CellSaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE11_Deque_implE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE16_Deque_impl_dataE", !8, i64 0, !19, i64 8, !20, i64 16, !20, i64 48}
!19 = !{!"long", !9, i64 0}
!20 = !{!"_ZTSSt15_Deque_iteratorIP4CellRS1_PS1_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!21 = !{!"_ZTSSt5queueISt5stackIP4CellSt5dequeIS2_SaIS2_EEES3_IS6_SaIS6_EEE", !22, i64 0}
!22 = !{!"_ZTSSt5dequeISt5stackIP4CellS_IS2_SaIS2_EEESaIS5_EE", !23, i64 0}
!23 = !{!"_ZTSSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE11_Deque_implE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE16_Deque_impl_dataE", !8, i64 0, !19, i64 8, !26, i64 16, !26, i64 48}
!26 = !{!"_ZTSSt15_Deque_iteratorISt5stackIP4CellSt5dequeIS2_SaIS2_EEERS6_PS6_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!27 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !28, i64 0}
!28 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !30, i64 0}
!30 = !{!"_ZTSNSt8__detail17_List_node_headerE", !31, i64 0, !19, i64 16}
!31 = !{!"_ZTSNSt8__detail15_List_node_baseE", !8, i64 0, !8, i64 8}
!32 = !{!"_ZTSNSt7__cxx114listINS0_I7CellmodSaIS1_EEESaIS3_EEE", !33, i64 0}
!33 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EE10_List_implE", !30, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = !{!6, !11, i64 8208}
!38 = !{!6, !11, i64 8212}
!39 = !{!8, !8, i64 0}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = !{!6, !8, i64 8}
!43 = distinct !{!43, !41}
!44 = !{!6, !11, i64 8216}
!45 = distinct !{!45, !41}
!46 = distinct !{!46, !41}
!47 = !{!48, !8, i64 0}
!48 = !{!"_ZTS13SimpleCellmod", !8, i64 0, !8, i64 8, !11, i64 16, !9, i64 20}
!49 = distinct !{!49, !41}
!50 = !{!48, !8, i64 8}
!51 = !{!48, !11, i64 16}
!52 = !{!12, !12, i64 0}
!53 = distinct !{!53, !41}
!54 = distinct !{!54, !41}
!55 = distinct !{!55, !41}
!56 = !{!6, !12, i64 8225}
!57 = distinct !{!57, !41}


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