; LLVM IR from mackorone/mms :: old/v2/src/mouse/mackAlgoTwo (MackAlgoTwo)

; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.mackAlgoTwo::MackAlgoTwo" = type <{ %class.IMouseAlgorithm, ptr, i8, i8, i8, i8, i8, [3 x i8] }>
%class.IMouseAlgorithm = type { ptr }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.63 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [2 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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: 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) #1

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2 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 noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #6

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext, i8 noundef zeroext) #3

declare void @_ZN3sim14MouseInterface12setTileColorEiic(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef, i32 noundef, i8 noundef signext) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK11mackAlgoTwo11MackAlgoTwo24colorVisitedCellsDelayMsEv(ptr noundef nonnull align 8 dereferenceable(21)) #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo12generatePathEh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i8, align 1
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca i8, align 1
  %13 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i8 %1, ptr %4, align 1, !tbaa !9
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  store i8 0, ptr %5, align 1, !tbaa !9
  br label %15

15:                                               ; preds = %36, %2
  %16 = load i8, ptr %5, align 1, !tbaa !9
  %17 = zext i8 %16 to i32
  %18 = icmp slt i32 %17, 16
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  br label %41

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #7
  store i8 0, ptr %7, align 1, !tbaa !9
  br label %21

21:                                               ; preds = %30, %20
  %22 = load i8, ptr %7, align 1, !tbaa !9
  %23 = zext i8 %22 to i32
  %24 = icmp slt i32 %23, 16
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #7
  br label %35

26:                                               ; preds = %21
  %27 = load i8, ptr %5, align 1, !tbaa !9
  %28 = load i8, ptr %7, align 1, !tbaa !9
  %29 = call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %27, i8 noundef zeroext %28)
  call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %29, i1 noundef zeroext false)
  br label %30

30:                                               ; preds = %26
  %31 = load i8, ptr %7, align 1, !tbaa !9
  %32 = zext i8 %31 to i32
  %33 = add nsw i32 %32, 1
  %34 = trunc i32 %33 to i8
  store i8 %34, ptr %7, align 1, !tbaa !9
  br label %21, !llvm.loop !10

35:                                               ; preds = %25
  br label %36

36:                                               ; preds = %35
  %37 = load i8, ptr %5, align 1, !tbaa !9
  %38 = zext i8 %37 to i32
  %39 = add nsw i32 %38, 1
  %40 = trunc i32 %39 to i8
  store i8 %40, ptr %5, align 1, !tbaa !9
  br label %15, !llvm.loop !12

41:                                               ; preds = %19
  %42 = load i8, ptr %4, align 1, !tbaa !9
  call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %42, i1 noundef zeroext true)
  %43 = load i8, ptr %4, align 1, !tbaa !9
  call void @_ZN11mackAlgoTwo11MackAlgoTwo15setCellDistanceEhj(ptr noundef nonnull align 8 dereferenceable(21) %14, i8 noundef zeroext %43, i32 noundef 0)
  %44 = load i8, ptr %4, align 1, !tbaa !9
  %45 = getelementptr inbounds %"class.mackAlgoTwo::MackAlgoTwo", ptr %14, i32 0, i32 4
  %46 = load i8, ptr %45, align 2, !tbaa !13
  %47 = call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo20getOppositeDirectionEh(ptr noundef nonnull align 8 dereferenceable(21) %14, i8 noundef zeroext %46)
  call void @_ZN11mackAlgoTwo4Maze16setNextDirectionEhh(i8 noundef zeroext %44, i8 noundef zeroext %47)
  %48 = load i8, ptr %4, align 1, !tbaa !9
  call void @_ZN11mackAlgoTwo4Maze9clearNextEh(i8 noundef zeroext %48)
  call void @_ZN11mackAlgoTwo11MackAlgoTwo29resetDestinationCellDistancesEv(ptr noundef nonnull align 8 dereferenceable(21) %14)
  %49 = call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv()
  %50 = zext i8 %49 to i32
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %92, label %52

52:                                               ; preds = %41
  %53 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.63)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %53, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef @.str.64)
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %55, ptr noundef @.str.65)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %56, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef @.str.66)
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %58, i32 noundef 287)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %59, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %60, ptr noundef @.str.67)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef @.str.78)
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %62, ptr noundef @.str.69)
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef @.str.79)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %65, ptr noundef @.str.71)
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #7
  %67 = call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv()
  %68 = zext i8 %67 to i32
  call void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %8, i32 noundef %68) #7
  %69 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %66, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %70 unwind label %83

70:                                               ; preds = %52
  %71 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %69, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %72 unwind label %83

72:                                               ; preds = %70
  %73 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef @.str.72)
          to label %74 unwind label %83

74:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 32, ptr %11) #7
  call void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %11, i32 noundef 0) #7
  %75 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull align 8 dereferenceable(32) %11)
          to label %76 unwind label %87

76:                                               ; preds = %74
  %77 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %75, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %78 unwind label %87

78:                                               ; preds = %76
  %79 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %77, ptr noundef @.str.73)
          to label %80 unwind label %87

80:                                               ; preds = %78
  %81 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %82 unwind label %87

82:                                               ; preds = %80
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  call void @exit(i32 noundef 1) #8
  unreachable

83:                                               ; preds = %72, %70, %52
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %9, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %10, align 4
  br label %91

87:                                               ; preds = %80, %78, %76, %74
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %9, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %10, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %11) #7
  br label %91

91:                                               ; preds = %87, %83
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #7
  br label %147

92:                                               ; preds = %41
  %93 = load i8, ptr %4, align 1, !tbaa !9
  call void @_ZN11mackAlgoTwo4Heap4pushEh(i8 noundef zeroext %93)
  br label %94

94:                                               ; preds = %143, %92
  %95 = call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv()
  %96 = zext i8 %95 to i32
  %97 = icmp slt i32 0, %96
  br i1 %97, label %98, label %144

98:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #7
  %99 = call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap3popEv()
  store i8 %99, ptr %12, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #7
  store i8 0, ptr %13, align 1, !tbaa !9
  br label %100

100:                                              ; preds = %113, %98
  %101 = load i8, ptr %13, align 1, !tbaa !9
  %102 = zext i8 %101 to i32
  %103 = icmp slt i32 %102, 4
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 10, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #7
  br label %118

105:                                              ; preds = %100
  %106 = load i8, ptr %12, align 1, !tbaa !9
  %107 = load i8, ptr %13, align 1, !tbaa !9
  %108 = call noundef zeroext i1 @_ZN11mackAlgoTwo4Maze6isWallEhh(i8 noundef zeroext %106, i8 noundef zeroext %107)
  br i1 %108, label %112, label %109

109:                                              ; preds = %105
  %110 = load i8, ptr %12, align 1, !tbaa !9
  %111 = load i8, ptr %13, align 1, !tbaa !9
  call void @_ZN11mackAlgoTwo11MackAlgoTwo13checkNeighborEhh(ptr noundef nonnull align 8 dereferenceable(21) %14, i8 noundef zeroext %110, i8 noundef zeroext %111)
  br label %112

112:                                              ; preds = %109, %105
  br label %113

113:                                              ; preds = %112
  %114 = load i8, ptr %13, align 1, !tbaa !9
  %115 = zext i8 %114 to i32
  %116 = add nsw i32 %115, 1
  %117 = trunc i32 %116 to i8
  store i8 %117, ptr %13, align 1, !tbaa !9
  br label %100, !llvm.loop !16

118:                                              ; preds = %104
  %119 = call noundef zeroext i1 @_ZNK11mackAlgoTwo11MackAlgoTwo23shouldColorVisitedCellsEv(ptr noundef nonnull align 8 dereferenceable(21) %14)
  br i1 %119, label %120, label %133

120:                                              ; preds = %118
  %121 = getelementptr inbounds %"class.mackAlgoTwo::MackAlgoTwo", ptr %14, i32 0, i32 1
  %122 = load ptr, ptr %121, align 8, !tbaa !17
  %123 = call noundef zeroext i8 @_ZNK11mackAlgoTwo11MackAlgoTwo24colorVisitedCellsDelayMsEv(ptr noundef nonnull align 8 dereferenceable(21) %14)
  %124 = zext i8 %123 to i32
  call void @_ZN3sim14MouseInterface5delayEi(ptr noundef nonnull align 8 dereferenceable(296) %122, i32 noundef %124)
  %125 = getelementptr inbounds %"class.mackAlgoTwo::MackAlgoTwo", ptr %14, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !17
  %127 = load i8, ptr %12, align 1, !tbaa !9
  %128 = call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getXEh(i8 noundef zeroext %127)
  %129 = zext i8 %128 to i32
  %130 = load i8, ptr %12, align 1, !tbaa !9
  %131 = call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getYEh(i8 noundef zeroext %130)
  %132 = zext i8 %131 to i32
  call void @_ZN3sim14MouseInterface12setTileColorEiic(ptr noundef nonnull align 8 dereferenceable(296) %126, i32 noundef %129, i32 noundef %132, i8 noundef signext 89)
  br label %133

133:                                              ; preds = %120, %118
  %134 = load i8, ptr %12, align 1, !tbaa !9
  %135 = zext i8 %134 to i32
  %136 = call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo25getClosestDestinationCellEv(ptr noundef nonnull align 8 dereferenceable(21) %14)
  %137 = zext i8 %136 to i32
  %138 = icmp eq i32 %135, %137
  br i1 %138, label %139, label %140

139:                                              ; preds = %133
  call void @_ZN11mackAlgoTwo4Heap5clearEv()
  store i32 9, ptr %6, align 4
  br label %141

140:                                              ; preds = %133
  store i32 0, ptr %6, align 4
  br label %141

141:                                              ; preds = %140, %139
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #7
  %142 = load i32, ptr %6, align 4
  switch i32 %142, label %152 [
    i32 0, label %143
    i32 9, label %144
  ]

143:                                              ; preds = %141
  br label %94, !llvm.loop !18

144:                                              ; preds = %141, %94
  %145 = call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo25getClosestDestinationCellEv(ptr noundef nonnull align 8 dereferenceable(21) %14)
  %146 = call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo17reverseLinkedListEh(ptr noundef nonnull align 8 dereferenceable(21) %14, i8 noundef zeroext %145)
  ret i8 %146

147:                                              ; preds = %91
  %148 = load ptr, ptr %9, align 8
  %149 = load i32, ptr %10, align 4
  %150 = insertvalue { ptr, i32 } poison, ptr %148, 0
  %151 = insertvalue { ptr, i32 } %150, i32 %149, 1
  resume { ptr, i32 } %151

152:                                              ; preds = %141
  unreachable
}

declare void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext, i1 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11mackAlgoTwo11MackAlgoTwo15setCellDistanceEhj(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext, i32 noundef) #2 align 2

declare void @_ZN11mackAlgoTwo4Maze16setNextDirectionEhh(i8 noundef zeroext, i8 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo20getOppositeDirectionEh(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext) #2 align 2

declare void @_ZN11mackAlgoTwo4Maze9clearNextEh(i8 noundef zeroext) #3

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

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv() #3

declare void @_ZN11mackAlgoTwo4Heap4pushEh(i8 noundef zeroext) #3

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Heap3popEv() #3

declare noundef zeroext i1 @_ZN11mackAlgoTwo4Maze6isWallEhh(i8 noundef zeroext, i8 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11mackAlgoTwo11MackAlgoTwo13checkNeighborEhh(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext, i8 noundef zeroext) #2 align 2

declare void @_ZN3sim14MouseInterface5delayEi(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef) #3

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getXEh(i8 noundef zeroext) #3

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getYEh(i8 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo25getClosestDestinationCellEv(ptr noundef nonnull align 8 dereferenceable(21)) #2 align 2

declare void @_ZN11mackAlgoTwo4Heap5clearEv() #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo17reverseLinkedListEh(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext) #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { noreturn nounwind "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 #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}
!13 = !{!14, !7, i64 18}
!14 = !{!"_ZTSN11mackAlgoTwo11MackAlgoTwoE", !15, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !7, i64 20}
!15 = !{!"_ZTS15IMouseAlgorithm"}
!16 = distinct !{!16, !11}
!17 = !{!14, !6, i64 8}
!18 = distinct !{!18, !11}


; 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.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.63 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [92 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.78 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.79 = external hidden unnamed_addr constant [2 x i8], align 1

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: 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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind noalias writable sret(%"class.std::__cxx11::basic_string") align 8, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #5 align 2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #6

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #3

declare void @_ZN3sim14MouseInterface12setTileColorEiic(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef, i32 noundef, i8 noundef signext) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZNK11mackAlgoTwo11MackAlgoTwo24colorVisitedCellsDelayMsEv(ptr noundef nonnull align 8 dereferenceable(21)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo12generatePathEh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.std::__cxx11::basic_string", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  br label %.preheader

.preheader:                                       ; preds = %2, %.preheader
  %.02337 = phi i8 [ 0, %2 ], [ %narrow32, %.preheader ]
  %5 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 0)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %5, i1 noundef zeroext false)
  %6 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 1)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %6, i1 noundef zeroext false)
  %7 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 2)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %7, i1 noundef zeroext false)
  %8 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 3)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %8, i1 noundef zeroext false)
  %9 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 4)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %9, i1 noundef zeroext false)
  %10 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 5)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %10, i1 noundef zeroext false)
  %11 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 6)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %11, i1 noundef zeroext false)
  %12 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 7)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %12, i1 noundef zeroext false)
  %13 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 8)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %13, i1 noundef zeroext false)
  %14 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 9)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %14, i1 noundef zeroext false)
  %15 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 10)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %15, i1 noundef zeroext false)
  %16 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 11)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %16, i1 noundef zeroext false)
  %17 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 12)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %17, i1 noundef zeroext false)
  %18 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 13)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %18, i1 noundef zeroext false)
  %19 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 14)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %19, i1 noundef zeroext false)
  %20 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze7getCellEhh(i8 noundef zeroext %.02337, i8 noundef zeroext 15)
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %20, i1 noundef zeroext false)
  %narrow32 = add nuw nsw i8 %.02337, 1
  %exitcond.not = icmp eq i8 %narrow32, 16
  br i1 %exitcond.not, label %21, label %.preheader, !llvm.loop !5

21:                                               ; preds = %.preheader
  tail call void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext %1, i1 noundef zeroext true)
  tail call void @_ZN11mackAlgoTwo11MackAlgoTwo15setCellDistanceEhj(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %1, i32 noundef 0)
  %22 = getelementptr inbounds i8, ptr %0, i64 18
  %23 = load i8, ptr %22, align 2, !tbaa !7
  %24 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo20getOppositeDirectionEh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %23)
  tail call void @_ZN11mackAlgoTwo4Maze16setNextDirectionEhh(i8 noundef zeroext %1, i8 noundef zeroext %24)
  tail call void @_ZN11mackAlgoTwo4Maze9clearNextEh(i8 noundef zeroext %1)
  tail call void @_ZN11mackAlgoTwo11MackAlgoTwo29resetDestinationCellDistancesEv(ptr noundef nonnull align 8 dereferenceable(21) %0)
  %25 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv()
  %26 = icmp eq i8 %25, 0
  br i1 %26, label %63, label %27

27:                                               ; preds = %21
  %28 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.63)
  %29 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %28, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %30 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull @.str.64)
  %31 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull @.str.65)
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %33 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %32, ptr noundef nonnull @.str.66)
  %34 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %33, i32 noundef 287)
  %35 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %36 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %35, ptr noundef nonnull @.str.67)
  %37 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull @.str.78)
  %38 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %37, ptr noundef nonnull @.str.69)
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %38, ptr noundef nonnull @.str.79)
  %40 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %39, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %41 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef nonnull @.str.71)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #7
  %42 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv()
  %43 = zext i8 %42 to i32
  call void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %3, i32 noundef %43) #7
  %44 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull align 8 dereferenceable(32) %3)
          to label %45 unwind label %58

45:                                               ; preds = %27
  %46 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %44, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %47 unwind label %58

47:                                               ; preds = %45
  %48 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull @.str.72)
          to label %49 unwind label %58

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #7
  call void @_ZNSt7__cxx119to_stringEi(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %4, i32 noundef 0) #7
  %50 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsIcSt11char_traitsIcESaIcEERSt13basic_ostreamIT_T0_ES7_RKNSt7__cxx1112basic_stringIS4_S5_T1_EE(ptr noundef nonnull align 8 dereferenceable(8) %48, ptr noundef nonnull align 8 dereferenceable(32) %4)
          to label %51 unwind label %60

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %53 unwind label %60

53:                                               ; preds = %51
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @.str.73)
          to label %55 unwind label %60

55:                                               ; preds = %53
  %56 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %54, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %57 unwind label %60

57:                                               ; preds = %55
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  call void @exit(i32 noundef 1) #8
  unreachable

58:                                               ; preds = %47, %45, %27
  %59 = landingpad { ptr, i32 }
          cleanup
  br label %62

60:                                               ; preds = %55, %53, %51, %49
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #7
  br label %62

62:                                               ; preds = %60, %58
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %59, %58 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %3) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #7
  resume { ptr, i32 } %.pn

63:                                               ; preds = %21
  tail call void @_ZN11mackAlgoTwo4Heap4pushEh(i8 noundef zeroext %1)
  %64 = getelementptr inbounds i8, ptr %0, i64 8
  br label %65

65:                                               ; preds = %91, %63
  %66 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv()
  %.not = icmp eq i8 %66, 0
  br i1 %.not, label %.loopexit, label %67

67:                                               ; preds = %65
  %68 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Heap3popEv()
  %69 = tail call noundef zeroext i1 @_ZN11mackAlgoTwo4Maze6isWallEhh(i8 noundef zeroext %68, i8 noundef zeroext 0)
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  tail call void @_ZN11mackAlgoTwo11MackAlgoTwo13checkNeighborEhh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %68, i8 noundef zeroext 0)
  br label %71

71:                                               ; preds = %67, %70
  %72 = tail call noundef zeroext i1 @_ZN11mackAlgoTwo4Maze6isWallEhh(i8 noundef zeroext %68, i8 noundef zeroext 1)
  br i1 %72, label %74, label %73

73:                                               ; preds = %71
  tail call void @_ZN11mackAlgoTwo11MackAlgoTwo13checkNeighborEhh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %68, i8 noundef zeroext 1)
  br label %74

74:                                               ; preds = %73, %71
  %75 = tail call noundef zeroext i1 @_ZN11mackAlgoTwo4Maze6isWallEhh(i8 noundef zeroext %68, i8 noundef zeroext 2)
  br i1 %75, label %77, label %76

76:                                               ; preds = %74
  tail call void @_ZN11mackAlgoTwo11MackAlgoTwo13checkNeighborEhh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %68, i8 noundef zeroext 2)
  br label %77

77:                                               ; preds = %76, %74
  %78 = tail call noundef zeroext i1 @_ZN11mackAlgoTwo4Maze6isWallEhh(i8 noundef zeroext %68, i8 noundef zeroext 3)
  br i1 %78, label %80, label %79

79:                                               ; preds = %77
  tail call void @_ZN11mackAlgoTwo11MackAlgoTwo13checkNeighborEhh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %68, i8 noundef zeroext 3)
  br label %80

80:                                               ; preds = %79, %77
  %81 = tail call noundef zeroext i1 @_ZNK11mackAlgoTwo11MackAlgoTwo23shouldColorVisitedCellsEv(ptr noundef nonnull align 8 dereferenceable(21) %0)
  br i1 %81, label %82, label %91

82:                                               ; preds = %80
  %83 = load ptr, ptr %64, align 8, !tbaa !13
  %84 = tail call noundef zeroext i8 @_ZNK11mackAlgoTwo11MackAlgoTwo24colorVisitedCellsDelayMsEv(ptr noundef nonnull align 8 dereferenceable(21) %0)
  %85 = zext i8 %84 to i32
  tail call void @_ZN3sim14MouseInterface5delayEi(ptr noundef nonnull align 8 dereferenceable(296) %83, i32 noundef %85)
  %86 = load ptr, ptr %64, align 8, !tbaa !13
  %87 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getXEh(i8 noundef zeroext %68)
  %88 = zext i8 %87 to i32
  %89 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getYEh(i8 noundef zeroext %68)
  %90 = zext i8 %89 to i32
  tail call void @_ZN3sim14MouseInterface12setTileColorEiic(ptr noundef nonnull align 8 dereferenceable(296) %86, i32 noundef %88, i32 noundef %90, i8 noundef signext 89)
  br label %91

91:                                               ; preds = %82, %80
  %92 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo25getClosestDestinationCellEv(ptr noundef nonnull align 8 dereferenceable(21) %0)
  %93 = icmp eq i8 %68, %92
  br i1 %93, label %.thread, label %65

.thread:                                          ; preds = %91
  tail call void @_ZN11mackAlgoTwo4Heap5clearEv()
  br label %.loopexit

.loopexit:                                        ; preds = %65, %.thread
  %94 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo25getClosestDestinationCellEv(ptr noundef nonnull align 8 dereferenceable(21) %0)
  %95 = tail call noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo17reverseLinkedListEh(ptr noundef nonnull align 8 dereferenceable(21) %0, i8 noundef zeroext %94)
  ret i8 %95
}

declare void @_ZN11mackAlgoTwo4Maze13setDiscoveredEhb(i8 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11mackAlgoTwo11MackAlgoTwo15setCellDistanceEhj(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext, i32 noundef) local_unnamed_addr #2 align 2

declare void @_ZN11mackAlgoTwo4Maze16setNextDirectionEhh(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo20getOppositeDirectionEh(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext) local_unnamed_addr #2 align 2

declare void @_ZN11mackAlgoTwo4Maze9clearNextEh(i8 noundef zeroext) local_unnamed_addr #3

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

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Heap4sizeEv() local_unnamed_addr #3

declare void @_ZN11mackAlgoTwo4Heap4pushEh(i8 noundef zeroext) local_unnamed_addr #3

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Heap3popEv() local_unnamed_addr #3

declare noundef zeroext i1 @_ZN11mackAlgoTwo4Maze6isWallEhh(i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN11mackAlgoTwo11MackAlgoTwo13checkNeighborEhh(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2 align 2

declare void @_ZN3sim14MouseInterface5delayEi(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef) local_unnamed_addr #3

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getXEh(i8 noundef zeroext) local_unnamed_addr #3

declare noundef zeroext i8 @_ZN11mackAlgoTwo4Maze4getYEh(i8 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo25getClosestDestinationCellEv(ptr noundef nonnull align 8 dereferenceable(21)) local_unnamed_addr #2 align 2

declare void @_ZN11mackAlgoTwo4Heap5clearEv() local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN11mackAlgoTwo11MackAlgoTwo17reverseLinkedListEh(ptr noundef nonnull align 8 dereferenceable(21), i8 noundef zeroext) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { noreturn nounwind "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 #7 = { nounwind }
attributes #8 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !11, i64 18}
!8 = !{!"_ZTSN11mackAlgoTwo11MackAlgoTwoE", !9, i64 0, !10, i64 8, !11, i64 16, !11, i64 17, !11, i64 18, !11, i64 19, !11, i64 20}
!9 = !{!"_ZTS15IMouseAlgorithm"}
!10 = !{!"any pointer", !11, i64 0}
!11 = !{!"omnipotent char", !12, i64 0}
!12 = !{!"Simple C++ TBAA"}
!13 = !{!8, !10, i64 8}


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