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

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

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.62 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [18 x i8], align 1

; 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 @_ZN9floodFill9FloodFill5solveEiibcPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3, i8 noundef signext %4, ptr noundef %5) unnamed_addr #1 align 2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  %16 = zext i1 %3 to i8
  store i8 %16, ptr %10, align 1, !tbaa !11
  store i8 %4, ptr %11, align 1, !tbaa !13
  store ptr %5, ptr %12, align 8, !tbaa !5
  %17 = load ptr, ptr %7, align 8
  %18 = load ptr, ptr %12, align 8, !tbaa !5
  %19 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 1
  store ptr %18, ptr %19, align 8, !tbaa !14
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = icmp ne i32 16, %20
  br i1 %21, label %25, label %22

22:                                               ; preds = %6
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = icmp ne i32 16, %23
  br i1 %24, label %25, label %38

25:                                               ; preds = %22, %6
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.62)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %26, i32 noundef 16)
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef @.str.63)
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %28, i32 noundef 16)
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef @.str.64)
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %30, i32 noundef %31)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef @.str.63)
  %34 = load i32, ptr %9, align 4, !tbaa !9
  %35 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef %34)
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef @.str.65)
  %37 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %90

38:                                               ; preds = %22
  %39 = load i8, ptr %11, align 1, !tbaa !13
  %40 = sext i8 %39 to i32
  %41 = icmp ne i32 110, %40
  br i1 %41, label %42, label %46

42:                                               ; preds = %38
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.66)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef @.str.67)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %90

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

47:                                               ; preds = %86, %46
  %48 = load i32, ptr %13, align 4, !tbaa !9
  %49 = icmp slt i32 %48, 16
  br i1 %49, label %51, label %50

50:                                               ; preds = %47
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %89

51:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %52

52:                                               ; preds = %82, %51
  %53 = load i32, ptr %15, align 4, !tbaa !9
  %54 = icmp slt i32 %53, 16
  br i1 %54, label %56, label %55

55:                                               ; preds = %52
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %85

56:                                               ; preds = %52
  %57 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %57, i64 0, i64 %59
  %61 = load i32, ptr %15, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %60, i64 0, i64 %62
  %64 = load i32, ptr %13, align 4, !tbaa !9
  call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %63, i32 noundef %64)
  %65 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %66 = load i32, ptr %13, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %15, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %68, i64 0, i64 %70
  %72 = load i32, ptr %15, align 4, !tbaa !9
  call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %71, i32 noundef %72)
  %73 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 2
  %74 = load i32, ptr %13, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %73, i64 0, i64 %75
  %77 = load i32, ptr %15, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [16 x %"class.floodFill::Cell"], ptr %76, i64 0, i64 %78
  %80 = getelementptr inbounds %"class.floodFill::FloodFill", ptr %17, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !14
  call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %79, ptr noundef %81)
  br label %82

82:                                               ; preds = %56
  %83 = load i32, ptr %15, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %15, align 4, !tbaa !9
  br label %52, !llvm.loop !39

85:                                               ; preds = %55
  br label %86

86:                                               ; preds = %85
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %13, align 4, !tbaa !9
  br label %47, !llvm.loop !41

89:                                               ; preds = %50
  call void @_ZN9floodFill9FloodFill13justFloodFillEv(ptr noundef nonnull align 8 dereferenceable(10505) %17)
  br label %90

90:                                               ; preds = %89, %42, %25
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

declare void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #3

declare void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40), i32 noundef) #3

declare void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9floodFill9FloodFill13justFloodFillEv(ptr noundef nonnull align 8 dereferenceable(10505)) #1 align 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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!15, !6, i64 8}
!15 = !{!"_ZTSN9floodFill9FloodFillE", !16, i64 0, !6, i64 8, !7, i64 16, !10, i64 10256, !10, i64 10260, !10, i64 10264, !10, i64 10268, !12, i64 10272, !12, i64 10273, !17, i64 10280, !12, i64 10504}
!16 = !{!"_ZTS15IMouseAlgorithm"}
!17 = !{!"_ZTSN9floodFill7HistoryE", !10, i64 0, !10, i64 4, !6, i64 8, !18, i64 16, !25, i64 96, !31, i64 176, !36, i64 200}
!18 = !{!"_ZTSSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE", !19, i64 0}
!19 = !{!"_ZTSSt5dequeIPN9floodFill4CellESaIS2_EE", !20, i64 0}
!20 = !{!"_ZTSSt11_Deque_baseIPN9floodFill4CellESaIS2_EE", !21, i64 0}
!21 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE11_Deque_implE", !22, i64 0}
!22 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE16_Deque_impl_dataE", !6, i64 0, !23, i64 8, !24, i64 16, !24, i64 48}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSSt15_Deque_iteratorIPN9floodFill4CellERS2_PS2_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = !{!"_ZTSSt5queueISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEES4_IS7_SaIS7_EEE", !26, i64 0}
!26 = !{!"_ZTSSt5dequeISt5stackIPN9floodFill4CellES_IS3_SaIS3_EEESaIS6_EE", !27, i64 0}
!27 = !{!"_ZTSSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE", !28, i64 0}
!28 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE11_Deque_implE", !29, i64 0}
!29 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE16_Deque_impl_dataE", !6, i64 0, !23, i64 8, !30, i64 16, !30, i64 48}
!30 = !{!"_ZTSSt15_Deque_iteratorISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEERS7_PS7_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!31 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !32, i64 0}
!32 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !33, i64 0}
!33 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !34, i64 0}
!34 = !{!"_ZTSNSt8__detail17_List_node_headerE", !35, i64 0, !23, i64 16}
!35 = !{!"_ZTSNSt8__detail15_List_node_baseE", !6, i64 0, !6, i64 8}
!36 = !{!"_ZTSNSt7__cxx114listINS0_IN9floodFill7CellmodESaIS2_EEESaIS4_EEE", !37, i64 0}
!37 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EEE", !38, i64 0}
!38 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EE10_List_implE", !34, i64 0}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = distinct !{!41, !40}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.floodFill::Cell" = type { i32, i32, i32, i8, i8, [4 x i8], [4 x i8], ptr, ptr }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.62 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [87 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9floodFill9FloodFill5solveEiibcPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(10505) %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3, i8 noundef signext %4, ptr noundef %5) unnamed_addr #0 align 2 {
  %7 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %5, ptr %7, align 8, !tbaa !5
  %8 = icmp ne i32 %1, 16
  %9 = icmp ne i32 %2, 16
  %or.cond = or i1 %8, %9
  br i1 %or.cond, label %10, label %21

10:                                               ; preds = %6
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.62)
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %11, i32 noundef 16)
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @.str.63)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %13, i32 noundef 16)
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull @.str.64)
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %15, i32 noundef %1)
  %17 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull @.str.63)
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %17, i32 noundef %2)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @.str.65)
  %20 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %61

21:                                               ; preds = %6
  %.not = icmp eq i8 %4, 110
  br i1 %.not, label %.preheader20, label %23

.preheader20:                                     ; preds = %21
  %22 = getelementptr inbounds i8, ptr %0, i64 16
  br label %.preheader

23:                                               ; preds = %21
  %24 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.66)
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull @.str.67)
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %61

.preheader:                                       ; preds = %.preheader20, %.preheader
  %indvars.iv = phi i64 [ 0, %.preheader20 ], [ %indvars.iv.next, %.preheader ]
  %27 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 0
  %28 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %27, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %27, i32 noundef 0)
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %27, ptr noundef %29)
  %30 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 1
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %30, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %30, i32 noundef 1)
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %30, ptr noundef %31)
  %32 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 2
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %32, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %32, i32 noundef 2)
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %32, ptr noundef %33)
  %34 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 3
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %34, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %34, i32 noundef 3)
  %35 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %34, ptr noundef %35)
  %36 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 4
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %36, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %36, i32 noundef 4)
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %36, ptr noundef %37)
  %38 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 5
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %38, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %38, i32 noundef 5)
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %38, ptr noundef %39)
  %40 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 6
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %40, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %40, i32 noundef 6)
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %40, ptr noundef %41)
  %42 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 7
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %42, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %42, i32 noundef 7)
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %42, ptr noundef %43)
  %44 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 8
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %44, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %44, i32 noundef 8)
  %45 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %44, ptr noundef %45)
  %46 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 9
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %46, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %46, i32 noundef 9)
  %47 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %46, ptr noundef %47)
  %48 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 10
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %48, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %48, i32 noundef 10)
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %48, ptr noundef %49)
  %50 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 11
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %50, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %50, i32 noundef 11)
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %50, ptr noundef %51)
  %52 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 12
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %52, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %52, i32 noundef 12)
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %52, ptr noundef %53)
  %54 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 13
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %54, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %54, i32 noundef 13)
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %54, ptr noundef %55)
  %56 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 14
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %56, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %56, i32 noundef 14)
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %56, ptr noundef %57)
  %58 = getelementptr inbounds [16 x [16 x %"class.floodFill::Cell"]], ptr %22, i64 0, i64 %indvars.iv, i64 15
  tail call void @_ZN9floodFill4Cell4setXEi(ptr noundef nonnull align 8 dereferenceable(40) %58, i32 noundef %28)
  tail call void @_ZN9floodFill4Cell4setYEi(ptr noundef nonnull align 8 dereferenceable(40) %58, i32 noundef 15)
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  tail call void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40) %58, ptr noundef %59)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 16
  br i1 %exitcond.not, label %60, label %.preheader, !llvm.loop !35

60:                                               ; preds = %.preheader
  tail call void @_ZN9floodFill9FloodFill13justFloodFillEv(ptr noundef nonnull align 8 dereferenceable(10505) %0)
  br label %61

61:                                               ; preds = %60, %23, %10
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

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

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

declare void @_ZN9floodFill4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef) local_unnamed_addr #2

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

!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, !8, i64 8}
!6 = !{!"_ZTSN9floodFill9FloodFillE", !7, i64 0, !8, i64 8, !9, i64 16, !11, i64 10256, !11, i64 10260, !11, i64 10264, !11, i64 10268, !12, i64 10272, !12, i64 10273, !13, i64 10280, !12, i64 10504}
!7 = !{!"_ZTS15IMouseAlgorithm"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"bool", !9, i64 0}
!13 = !{!"_ZTSN9floodFill7HistoryE", !11, i64 0, !11, i64 4, !8, i64 8, !14, i64 16, !21, i64 96, !27, i64 176, !32, i64 200}
!14 = !{!"_ZTSSt5stackIPN9floodFill4CellESt5dequeIS2_SaIS2_EEE", !15, i64 0}
!15 = !{!"_ZTSSt5dequeIPN9floodFill4CellESaIS2_EE", !16, i64 0}
!16 = !{!"_ZTSSt11_Deque_baseIPN9floodFill4CellESaIS2_EE", !17, i64 0}
!17 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE11_Deque_implE", !18, i64 0}
!18 = !{!"_ZTSNSt11_Deque_baseIPN9floodFill4CellESaIS2_EE16_Deque_impl_dataE", !8, i64 0, !19, i64 8, !20, i64 16, !20, i64 48}
!19 = !{!"long", !9, i64 0}
!20 = !{!"_ZTSSt15_Deque_iteratorIPN9floodFill4CellERS2_PS2_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!21 = !{!"_ZTSSt5queueISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEES4_IS7_SaIS7_EEE", !22, i64 0}
!22 = !{!"_ZTSSt5dequeISt5stackIPN9floodFill4CellES_IS3_SaIS3_EEESaIS6_EE", !23, i64 0}
!23 = !{!"_ZTSSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE", !24, i64 0}
!24 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE11_Deque_implE", !25, i64 0}
!25 = !{!"_ZTSNSt11_Deque_baseISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEESaIS7_EE16_Deque_impl_dataE", !8, i64 0, !19, i64 8, !26, i64 16, !26, i64 48}
!26 = !{!"_ZTSSt15_Deque_iteratorISt5stackIPN9floodFill4CellESt5dequeIS3_SaIS3_EEERS7_PS7_E", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24}
!27 = !{!"_ZTSNSt7__cxx114listIiSaIiEEE", !28, i64 0}
!28 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEEE", !29, i64 0}
!29 = !{!"_ZTSNSt7__cxx1110_List_baseIiSaIiEE10_List_implE", !30, i64 0}
!30 = !{!"_ZTSNSt8__detail17_List_node_headerE", !31, i64 0, !19, i64 16}
!31 = !{!"_ZTSNSt8__detail15_List_node_baseE", !8, i64 0, !8, i64 8}
!32 = !{!"_ZTSNSt7__cxx114listINS0_IN9floodFill7CellmodESaIS2_EEESaIS4_EEE", !33, i64 0}
!33 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EEE", !34, i64 0}
!34 = !{!"_ZTSNSt7__cxx1110_List_baseINS_4listIN9floodFill7CellmodESaIS3_EEESaIS5_EE10_List_implE", !30, i64 0}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.mustprogress"}


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