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

; 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.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::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::queue" = type { %"class.std::deque.0" }
%"class.std::deque.0" = type { %"class.std::_Deque_base.1" }
%"class.std::_Deque_base.1" = type { %"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::stack<Cell *>, std::allocator<std::stack<Cell *>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.5", %"struct.std::_Deque_iterator.5" }
%"struct.std::_Deque_iterator.5" = type { ptr, ptr, ptr, ptr }
%"class.std::__cxx11::list" = type { %"class.std::__cxx11::_List_base" }
%"class.std::__cxx11::_List_base" = type { %"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" }
%"struct.std::__cxx11::_List_base<int, std::allocator<int>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }
%"struct.std::__detail::_List_node_header" = type { %"struct.std::__detail::_List_node_base", i64 }
%"struct.std::__detail::_List_node_base" = type { ptr, ptr }
%"class.std::__cxx11::list.9" = type { %"class.std::__cxx11::_List_base.10" }
%"class.std::__cxx11::_List_base.10" = type { %"struct.std::__cxx11::_List_base<std::__cxx11::list<Cellmod>, std::allocator<std::__cxx11::list<Cellmod>>>::_List_impl" }
%"struct.std::__cxx11::_List_base<std::__cxx11::list<Cellmod>, std::allocator<std::__cxx11::list<Cellmod>>>::_List_impl" = type { %"struct.std::__detail::_List_node_header" }

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9FloodFill10initializeEv(ptr noundef nonnull align 8 dereferenceable(8457) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %10

10:                                               ; preds = %64, %1
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = icmp slt i32 %11, 8
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %67

14:                                               ; preds = %10
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %15 = load i32, ptr %3, align 4, !tbaa !9
  %16 = sub nsw i32 14, %15
  store i32 %16, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %17

17:                                               ; preds = %60, %14
  %18 = load i32, ptr %6, align 4, !tbaa !9
  %19 = icmp slt i32 %18, 8
  br i1 %19, label %21, label %20

20:                                               ; preds = %17
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %63

21:                                               ; preds = %17
  %22 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %22, i64 0, i64 %24
  %26 = load i32, ptr %3, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [16 x %class.Cell], ptr %25, i64 0, i64 %27
  %29 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef %29)
  %30 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %30, i64 0, i64 %32
  %34 = load i32, ptr %3, align 4, !tbaa !9
  %35 = sub nsw i32 15, %34
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [16 x %class.Cell], ptr %33, i64 0, i64 %36
  %38 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %37, i32 noundef %38)
  %39 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = sub nsw i32 15, %40
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %39, i64 0, i64 %42
  %44 = load i32, ptr %3, align 4, !tbaa !9
  %45 = sub nsw i32 15, %44
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [16 x %class.Cell], ptr %43, i64 0, i64 %46
  %48 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %47, i32 noundef %48)
  %49 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %50 = load i32, ptr %6, align 4, !tbaa !9
  %51 = sub nsw i32 15, %50
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %49, i64 0, i64 %52
  %54 = load i32, ptr %3, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [16 x %class.Cell], ptr %53, i64 0, i64 %55
  %57 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %56, i32 noundef %57)
  %58 = load i32, ptr %5, align 4, !tbaa !9
  %59 = sub nsw i32 %58, 1
  store i32 %59, ptr %5, align 4, !tbaa !9
  br label %60

60:                                               ; preds = %21
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = add nsw i32 %61, 1
  store i32 %62, ptr %6, align 4, !tbaa !9
  br label %17, !llvm.loop !11

63:                                               ; preds = %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %64

64:                                               ; preds = %63
  %65 = load i32, ptr %3, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %3, align 4, !tbaa !9
  br label %10, !llvm.loop !13

67:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %175, %67
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = icmp slt i32 %69, 16
  br i1 %70, label %72, label %71

71:                                               ; preds = %68
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %178

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %73

73:                                               ; preds = %171, %72
  %74 = load i32, ptr %8, align 4, !tbaa !9
  %75 = icmp slt i32 %74, 16
  br i1 %75, label %77, label %76

76:                                               ; preds = %73
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %174

77:                                               ; preds = %73
  %78 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %79 = load i32, ptr %8, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %78, i64 0, i64 %80
  %82 = load i32, ptr %7, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [16 x %class.Cell], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %7, align 4, !tbaa !9
  %86 = icmp eq i32 %85, 0
  call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %84, i32 noundef 2, i1 noundef zeroext %86)
  %87 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %88 = load i32, ptr %8, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %87, i64 0, i64 %89
  %91 = load i32, ptr %7, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [16 x %class.Cell], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = icmp eq i32 %94, 15
  call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %93, i32 noundef 0, i1 noundef zeroext %95)
  %96 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %97 = load i32, ptr %8, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %7, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [16 x %class.Cell], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %8, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 0
  call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %102, i32 noundef 3, i1 noundef zeroext %104)
  %105 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %106 = load i32, ptr %8, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %105, i64 0, i64 %107
  %109 = load i32, ptr %7, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [16 x %class.Cell], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %8, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 15
  call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %111, i32 noundef 1, i1 noundef zeroext %113)
  %114 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %115 = load i32, ptr %8, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %114, i64 0, i64 %116
  %118 = load i32, ptr %7, align 4, !tbaa !9
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [16 x %class.Cell], ptr %117, i64 0, i64 %119
  %121 = load i32, ptr %7, align 4, !tbaa !9
  %122 = icmp eq i32 %121, 0
  call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %120, i32 noundef 2, i1 noundef zeroext %122)
  %123 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %124 = load i32, ptr %8, align 4, !tbaa !9
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %123, i64 0, i64 %125
  %127 = load i32, ptr %7, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [16 x %class.Cell], ptr %126, i64 0, i64 %128
  %130 = load i32, ptr %7, align 4, !tbaa !9
  %131 = icmp eq i32 %130, 15
  call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %129, i32 noundef 0, i1 noundef zeroext %131)
  %132 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %133 = load i32, ptr %8, align 4, !tbaa !9
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %132, i64 0, i64 %134
  %136 = load i32, ptr %7, align 4, !tbaa !9
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [16 x %class.Cell], ptr %135, i64 0, i64 %137
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = icmp eq i32 %139, 0
  call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %138, i32 noundef 3, i1 noundef zeroext %140)
  %141 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %142 = load i32, ptr %8, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %141, i64 0, i64 %143
  %145 = load i32, ptr %7, align 4, !tbaa !9
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [16 x %class.Cell], ptr %144, i64 0, i64 %146
  %148 = load i32, ptr %8, align 4, !tbaa !9
  %149 = icmp eq i32 %148, 15
  call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %147, i32 noundef 1, i1 noundef zeroext %149)
  %150 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %151 = load i32, ptr %8, align 4, !tbaa !9
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %150, i64 0, i64 %152
  %154 = load i32, ptr %7, align 4, !tbaa !9
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [16 x %class.Cell], ptr %153, i64 0, i64 %155
  call void @_ZN4Cell7setPrevEPS_(ptr noundef nonnull align 8 dereferenceable(32) %156, ptr noundef null)
  %157 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %158 = load i32, ptr %8, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %157, i64 0, i64 %159
  %161 = load i32, ptr %7, align 4, !tbaa !9
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [16 x %class.Cell], ptr %160, i64 0, i64 %162
  call void @_ZN4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(32) %163, i1 noundef zeroext false)
  %164 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %165 = load i32, ptr %8, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %164, i64 0, i64 %166
  %168 = load i32, ptr %7, align 4, !tbaa !9
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [16 x %class.Cell], ptr %167, i64 0, i64 %169
  call void @_ZN4Cell12setTraversedEb(ptr noundef nonnull align 8 dereferenceable(32) %170, i1 noundef zeroext false)
  br label %171

171:                                              ; preds = %77
  %172 = load i32, ptr %8, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %8, align 4, !tbaa !9
  br label %73, !llvm.loop !14

174:                                              ; preds = %76
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %7, align 4, !tbaa !9
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %7, align 4, !tbaa !9
  br label %68, !llvm.loop !15

178:                                              ; preds = %71
  %179 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 3
  store i32 0, ptr %179, align 8, !tbaa !16
  %180 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 4
  store i32 0, ptr %180, align 4, !tbaa !42
  %181 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 5
  store i32 0, ptr %181, align 8, !tbaa !43
  %182 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 6
  store i32 0, ptr %182, align 4, !tbaa !44
  %183 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 8
  store i8 0, ptr %183, align 1, !tbaa !45
  %184 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 7
  store i8 0, ptr %184, align 8, !tbaa !46
  %185 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 11
  store i8 1, ptr %185, align 8, !tbaa !47
  %186 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 10
  %187 = getelementptr inbounds %class.FloodFill, ptr %9, i32 0, i32 2
  %188 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %187, i64 0, i64 0
  %189 = getelementptr inbounds [16 x %class.Cell], ptr %188, i64 0, i64 0
  call void @_ZN7History10initializeEiP4Cell(ptr noundef nonnull align 8 dereferenceable(224) %186, i32 noundef 8, ptr noundef %189)
  ret void
}

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

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

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

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

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

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

declare void @_ZN7History10initializeEiP4Cell(ptr noundef nonnull align 8 dereferenceable(224), i32 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = distinct !{!15, !12}
!16 = !{!17, !10, i64 8208}
!17 = !{!"_ZTS9FloodFill", !18, i64 0, !6, i64 8, !7, i64 16, !10, i64 8208, !10, i64 8212, !10, i64 8216, !10, i64 8220, !19, i64 8224, !19, i64 8225, !20, i64 8232, !19, i64 8456}
!18 = !{!"_ZTS10IAlgorithm"}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"_ZTS7History", !10, i64 0, !10, i64 4, !6, i64 8, !21, i64 16, !28, i64 96, !34, i64 176, !39, i64 200}
!21 = !{!"_ZTSSt5stackIP4CellSt5dequeIS1_SaIS1_EEE", !22, i64 0}
!22 = !{!"_ZTSSt5dequeIP4CellSaIS1_EE", !23, i64 0}
!23 = !{!"_ZTSSt11_Deque_baseIP4CellSaIS1_EE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE11_Deque_implE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE16_Deque_impl_dataE", !6, i64 0, !26, i64 8, !27, i64 16, !27, i64 48}
!26 = !{!"long", !7, i64 0}
!27 = !{!"_ZTSSt15_Deque_iteratorIP4CellRS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!28 = !{!"_ZTSSt5queueISt5stackIP4CellSt5dequeIS2_SaIS2_EEES3_IS6_SaIS6_EEE", !29, i64 0}
!29 = !{!"_ZTSSt5dequeISt5stackIP4CellS_IS2_SaIS2_EEESaIS5_EE", !30, i64 0}
!30 = !{!"_ZTSSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE", !31, i64 0}
!31 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE11_Deque_implE", !32, i64 0}
!32 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE16_Deque_impl_dataE", !6, i64 0, !26, i64 8, !33, i64 16, !33, i64 48}
!33 = !{!"_ZTSSt15_Deque_iteratorISt5stackIP4CellSt5dequeIS2_SaIS2_EEERS6_PS6_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!34 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !36, i64 0}
!36 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !37, i64 0}
!37 = !{!"_ZTSNSt8__detail17_List_node_headerE", !38, i64 0, !26, i64 16}
!38 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!39 = !{!"_ZTSNSt7__cxx114listINS0_I7CellmodSaIS1_EEESaIS3_EEE", !40, i64 0}
!40 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EEE", !41, i64 0}
!41 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EE10_List_implE", !37, i64 0}
!42 = !{!17, !10, i64 8212}
!43 = !{!17, !10, i64 8216}
!44 = !{!17, !10, i64 8220}
!45 = !{!17, !19, i64 8225}
!46 = !{!17, !19, i64 8224}
!47 = !{!17, !19, i64 8456}


; 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.Cell = type { i32, i32, i32, i8, i8, [4 x i8], [4 x i8], ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9FloodFill10initializeEv(ptr noundef nonnull align 8 dereferenceable(8457) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 16
  br label %3

3:                                                ; preds = %1, %3
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %3 ]
  %4 = sub nuw nsw i64 15, %indvars.iv
  %5 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 0, i64 %indvars.iv
  %6 = trunc i64 %indvars.iv to i32
  %7 = sub i32 14, %6
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %5, i32 noundef %7)
  %8 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 0, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %8, i32 noundef %7)
  %9 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 15, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %9, i32 noundef %7)
  %10 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 15, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %10, i32 noundef %7)
  %11 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 1, i64 %indvars.iv
  %12 = trunc i64 %indvars.iv to i32
  %13 = sub i32 13, %12
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %11, i32 noundef %13)
  %14 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 1, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %14, i32 noundef %13)
  %15 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 14, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef %13)
  %16 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 14, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %16, i32 noundef %13)
  %17 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 2, i64 %indvars.iv
  %18 = trunc i64 %indvars.iv to i32
  %19 = sub i32 12, %18
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %17, i32 noundef %19)
  %20 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 2, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %20, i32 noundef %19)
  %21 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 13, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %21, i32 noundef %19)
  %22 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 13, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %22, i32 noundef %19)
  %23 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 3, i64 %indvars.iv
  %24 = trunc i64 %indvars.iv to i32
  %25 = sub i32 11, %24
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %23, i32 noundef %25)
  %26 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 3, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %26, i32 noundef %25)
  %27 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 12, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %27, i32 noundef %25)
  %28 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 12, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef %25)
  %29 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 4, i64 %indvars.iv
  %30 = trunc i64 %indvars.iv to i32
  %31 = sub i32 10, %30
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %29, i32 noundef %31)
  %32 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 4, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %32, i32 noundef %31)
  %33 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 11, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %33, i32 noundef %31)
  %34 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 11, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %34, i32 noundef %31)
  %35 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 5, i64 %indvars.iv
  %36 = trunc i64 %indvars.iv to i32
  %37 = sub i32 9, %36
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %35, i32 noundef %37)
  %38 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 5, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %38, i32 noundef %37)
  %39 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 10, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %39, i32 noundef %37)
  %40 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 10, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %40, i32 noundef %37)
  %41 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 6, i64 %indvars.iv
  %42 = trunc i64 %indvars.iv to i32
  %43 = sub i32 8, %42
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %41, i32 noundef %43)
  %44 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 6, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %44, i32 noundef %43)
  %45 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 9, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %45, i32 noundef %43)
  %46 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 9, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %46, i32 noundef %43)
  %47 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 7, i64 %indvars.iv
  %48 = trunc i64 %indvars.iv to i32
  %49 = sub i32 7, %48
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %47, i32 noundef %49)
  %50 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 7, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %50, i32 noundef %49)
  %51 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 8, i64 %4
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %51, i32 noundef %49)
  %52 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 8, i64 %indvars.iv
  tail call void @_ZN4Cell11setDistanceEi(ptr noundef nonnull align 8 dereferenceable(32) %52, i32 noundef %49)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 8
  br i1 %exitcond.not, label %.preheader, label %3, !llvm.loop !5

.preheader:                                       ; preds = %3, %59
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %59 ], [ 0, %3 ]
  %53 = icmp eq i64 %indvars.iv68, 0
  %54 = icmp eq i64 %indvars.iv68, 15
  br label %60

55:                                               ; preds = %59
  %56 = getelementptr inbounds i8, ptr %0, i64 8208
  %57 = getelementptr inbounds i8, ptr %0, i64 8456
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(18) %56, i8 0, i64 18, i1 false)
  store i8 1, ptr %57, align 8, !tbaa !7
  %58 = getelementptr inbounds i8, ptr %0, i64 8232
  tail call void @_ZN7History10initializeEiP4Cell(ptr noundef nonnull align 8 dereferenceable(224) %58, i32 noundef 8, ptr noundef nonnull %2)
  ret void

59:                                               ; preds = %60
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %exitcond71.not = icmp eq i64 %indvars.iv.next69, 16
  br i1 %exitcond71.not, label %55, label %.preheader, !llvm.loop !37

60:                                               ; preds = %.preheader, %60
  %indvars.iv64 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next65, %60 ]
  %61 = getelementptr inbounds [16 x [16 x %class.Cell]], ptr %2, i64 0, i64 %indvars.iv64, i64 %indvars.iv68
  tail call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 2, i1 noundef zeroext %53)
  tail call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 0, i1 noundef zeroext %54)
  %62 = icmp eq i64 %indvars.iv64, 0
  tail call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 3, i1 noundef zeroext %62)
  %63 = icmp eq i64 %indvars.iv64, 15
  tail call void @_ZN4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 1, i1 noundef zeroext %63)
  tail call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 2, i1 noundef zeroext %53)
  tail call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 0, i1 noundef zeroext %54)
  tail call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 3, i1 noundef zeroext %62)
  tail call void @_ZN4Cell16setWallInspectedEib(ptr noundef nonnull align 8 dereferenceable(32) %61, i32 noundef 1, i1 noundef zeroext %63)
  tail call void @_ZN4Cell7setPrevEPS_(ptr noundef nonnull align 8 dereferenceable(32) %61, ptr noundef null)
  tail call void @_ZN4Cell11setExploredEb(ptr noundef nonnull align 8 dereferenceable(32) %61, i1 noundef zeroext false)
  tail call void @_ZN4Cell12setTraversedEb(ptr noundef nonnull align 8 dereferenceable(32) %61, i1 noundef zeroext false)
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %exitcond67.not = icmp eq i64 %indvars.iv.next65, 16
  br i1 %exitcond67.not, label %59, label %60, !llvm.loop !38
}

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

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

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

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

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

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

declare void @_ZN7History10initializeEiP4Cell(ptr noundef nonnull align 8 dereferenceable(224), i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !14, i64 8456}
!8 = !{!"_ZTS9FloodFill", !9, i64 0, !10, i64 8, !11, i64 16, !13, i64 8208, !13, i64 8212, !13, i64 8216, !13, i64 8220, !14, i64 8224, !14, i64 8225, !15, i64 8232, !14, i64 8456}
!9 = !{!"_ZTS10IAlgorithm"}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!"int", !11, i64 0}
!14 = !{!"bool", !11, i64 0}
!15 = !{!"_ZTS7History", !13, i64 0, !13, i64 4, !10, i64 8, !16, i64 16, !23, i64 96, !29, i64 176, !34, i64 200}
!16 = !{!"_ZTSSt5stackIP4CellSt5dequeIS1_SaIS1_EEE", !17, i64 0}
!17 = !{!"_ZTSSt5dequeIP4CellSaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt11_Deque_baseIP4CellSaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE11_Deque_implE", !20, i64 0}
!20 = !{!"_ZTSNSt11_Deque_baseIP4CellSaIS1_EE16_Deque_impl_dataE", !10, i64 0, !21, i64 8, !22, i64 16, !22, i64 48}
!21 = !{!"long", !11, i64 0}
!22 = !{!"_ZTSSt15_Deque_iteratorIP4CellRS1_PS1_E", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!23 = !{!"_ZTSSt5queueISt5stackIP4CellSt5dequeIS2_SaIS2_EEES3_IS6_SaIS6_EEE", !24, i64 0}
!24 = !{!"_ZTSSt5dequeISt5stackIP4CellS_IS2_SaIS2_EEESaIS5_EE", !25, i64 0}
!25 = !{!"_ZTSSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE", !26, i64 0}
!26 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE11_Deque_implE", !27, i64 0}
!27 = !{!"_ZTSNSt11_Deque_baseISt5stackIP4CellSt5dequeIS2_SaIS2_EEESaIS6_EE16_Deque_impl_dataE", !10, i64 0, !21, i64 8, !28, i64 16, !28, i64 48}
!28 = !{!"_ZTSSt15_Deque_iteratorISt5stackIP4CellSt5dequeIS2_SaIS2_EEERS6_PS6_E", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24}
!29 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !30, i64 0}
!30 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !31, i64 0}
!31 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !32, i64 0}
!32 = !{!"_ZTSNSt8__detail17_List_node_headerE", !33, i64 0, !21, i64 16}
!33 = !{!"_ZTSNSt8__detail15_List_node_baseE", !10, i64 0, !10, i64 8}
!34 = !{!"_ZTSNSt7__cxx114listINS0_I7CellmodSaIS1_EEESaIS3_EEE", !35, i64 0}
!35 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EEE", !36, i64 0}
!36 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listI7CellmodSaIS2_EEESaIS4_EE10_List_implE", !32, i64 0}
!37 = distinct !{!37, !6}
!38 = distinct !{!38, !6}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,SROAPass,SimplifyCFGPass,TailCallElimPass