; LLVM IR from mackorone/mms :: old/v2/src/mouse/mackAlgo (MackAlgo)

; 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.mackAlgo::MackAlgo" = type <{ %class.IMouseAlgorithm, ptr, [16 x [16 x %"class.mackAlgo::Cell"]], i32, i32, i32, i8, [3 x i8], i32, [4 x i8] }>
%class.IMouseAlgorithm = type { ptr }
%"class.mackAlgo::Cell" = type <{ ptr, i32, i32, [4 x i8], [4 x i8], i32, [4 x i8], ptr, i32, i32, float, i8, [3 x i8] }>

@_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 @_ZN8mackAlgo8MackAlgo5solveEiibcPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(14372) %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.mackAlgo::MackAlgo", 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 %151

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 %151

46:                                               ; preds = %38
  %47 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 3
  store i32 0, ptr %47, align 8, !tbaa !17
  %48 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 4
  store i32 0, ptr %48, align 4, !tbaa !18
  %49 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 5
  store i32 0, ptr %49, align 8, !tbaa !19
  %50 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 6
  store i8 1, ptr %50, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %51

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

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

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

56:                                               ; preds = %114, %55
  %57 = load i32, ptr %15, align 4, !tbaa !9
  %58 = icmp slt i32 %57, 16
  br i1 %58, label %60, label %59

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

60:                                               ; preds = %56
  %61 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 2
  %62 = load i32, ptr %13, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [16 x [16 x %"class.mackAlgo::Cell"]], ptr %61, i64 0, i64 %63
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [16 x %"class.mackAlgo::Cell"], ptr %64, i64 0, i64 %66
  %68 = load ptr, ptr %12, align 8, !tbaa !5
  call void @_ZN8mackAlgo4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(53) %67, ptr noundef %68)
  %69 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 2
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [16 x [16 x %"class.mackAlgo::Cell"]], ptr %69, i64 0, i64 %71
  %73 = load i32, ptr %15, align 4, !tbaa !9
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [16 x %"class.mackAlgo::Cell"], ptr %72, i64 0, i64 %74
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = load i32, ptr %15, align 4, !tbaa !9
  call void @_ZN8mackAlgo4Cell11setPositionEii(ptr noundef nonnull align 8 dereferenceable(53) %75, i32 noundef %76, i32 noundef %77)
  %78 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 2
  %79 = load i32, ptr %13, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [16 x [16 x %"class.mackAlgo::Cell"]], ptr %78, i64 0, i64 %80
  %82 = load i32, ptr %15, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [16 x %"class.mackAlgo::Cell"], ptr %81, i64 0, i64 %83
  %85 = load i32, ptr %15, align 4, !tbaa !9
  %86 = icmp eq i32 %85, 15
  call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %84, i32 noundef 0, i1 noundef zeroext %86)
  %87 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 2
  %88 = load i32, ptr %13, align 4, !tbaa !9
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [16 x [16 x %"class.mackAlgo::Cell"]], ptr %87, i64 0, i64 %89
  %91 = load i32, ptr %15, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [16 x %"class.mackAlgo::Cell"], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = icmp eq i32 %94, 15
  call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %93, i32 noundef 1, i1 noundef zeroext %95)
  %96 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 2
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [16 x [16 x %"class.mackAlgo::Cell"]], ptr %96, i64 0, i64 %98
  %100 = load i32, ptr %15, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [16 x %"class.mackAlgo::Cell"], ptr %99, i64 0, i64 %101
  %103 = load i32, ptr %15, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 0
  call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %102, i32 noundef 2, i1 noundef zeroext %104)
  %105 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 2
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [16 x [16 x %"class.mackAlgo::Cell"]], ptr %105, i64 0, i64 %107
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [16 x %"class.mackAlgo::Cell"], ptr %108, i64 0, i64 %110
  %112 = load i32, ptr %13, align 4, !tbaa !9
  %113 = icmp eq i32 %112, 0
  call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %111, i32 noundef 3, i1 noundef zeroext %113)
  br label %114

114:                                              ; preds = %60
  %115 = load i32, ptr %15, align 4, !tbaa !9
  %116 = add nsw i32 %115, 1
  store i32 %116, ptr %15, align 4, !tbaa !9
  br label %56, !llvm.loop !21

117:                                              ; preds = %59
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %13, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %13, align 4, !tbaa !9
  br label %51, !llvm.loop !23

121:                                              ; preds = %54
  br label %122

122:                                              ; preds = %150, %121
  call void @_ZN8mackAlgo8MackAlgo9readWallsEv(ptr noundef nonnull align 8 dereferenceable(14372) %17)
  %123 = call noundef zeroext i1 @_ZN8mackAlgo8MackAlgo4moveEv(ptr noundef nonnull align 8 dereferenceable(14372) %17)
  br i1 %123, label %125, label %124

124:                                              ; preds = %122
  br label %151

125:                                              ; preds = %122
  %126 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 6
  %127 = load i8, ptr %126, align 4, !tbaa !20, !range !24, !noundef !25
  %128 = trunc i8 %127 to i1
  br i1 %128, label %129, label %135

129:                                              ; preds = %125
  %130 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 3
  %131 = load i32, ptr %130, align 8, !tbaa !17
  %132 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 4
  %133 = load i32, ptr %132, align 4, !tbaa !18
  %134 = call noundef zeroext i1 @_ZN8mackAlgo8MackAlgo6inGoalEii(ptr noundef nonnull align 8 dereferenceable(14372) %17, i32 noundef %131, i32 noundef %133)
  br i1 %134, label %143, label %150

135:                                              ; preds = %125
  %136 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 3
  %137 = load i32, ptr %136, align 8, !tbaa !17
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %139, label %150

139:                                              ; preds = %135
  %140 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 4
  %141 = load i32, ptr %140, align 4, !tbaa !18
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %143, label %150

143:                                              ; preds = %139, %129
  %144 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 6
  %145 = load i8, ptr %144, align 4, !tbaa !20, !range !24, !noundef !25
  %146 = trunc i8 %145 to i1
  %147 = xor i1 %146, true
  %148 = getelementptr inbounds %"class.mackAlgo::MackAlgo", ptr %17, i32 0, i32 6
  %149 = zext i1 %147 to i8
  store i8 %149, ptr %148, align 4, !tbaa !20
  br label %150

150:                                              ; preds = %143, %139, %135, %129
  br label %122, !llvm.loop !26

151:                                              ; preds = %124, %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 @_ZN8mackAlgo4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(53), ptr noundef) #3

declare void @_ZN8mackAlgo4Cell11setPositionEii(ptr noundef nonnull align 8 dereferenceable(53), i32 noundef, i32 noundef) #3

declare void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53), i32 noundef, i1 noundef zeroext) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8mackAlgo8MackAlgo6inGoalEii(ptr noundef nonnull align 8 dereferenceable(14372), i32 noundef, i32 noundef) #4 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 = { 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 = { 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 = !{!"_ZTSN8mackAlgo8MackAlgoE", !16, i64 0, !6, i64 8, !7, i64 16, !10, i64 14352, !10, i64 14356, !10, i64 14360, !12, i64 14364, !10, i64 14368}
!16 = !{!"_ZTS15IMouseAlgorithm"}
!17 = !{!15, !10, i64 14352}
!18 = !{!15, !10, i64 14356}
!19 = !{!15, !10, i64 14360}
!20 = !{!15, !12, i64 14364}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = !{i8 0, i8 2}
!25 = !{}
!26 = distinct !{!26, !22}


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

@_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 @_ZN8mackAlgo8MackAlgo5solveEiibcPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(14372) %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 %20

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)
  br label %.loopexit.sink.split

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

21:                                               ; preds = %20
  %22 = 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)
  %23 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %22, ptr noundef nonnull @.str.67)
  br label %.loopexit.sink.split

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %0, i64 14352
  store i32 0, ptr %25, align 8, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %0, i64 14356
  store i32 0, ptr %26, align 4, !tbaa !14
  %27 = getelementptr inbounds i8, ptr %0, i64 14360
  store i32 0, ptr %27, align 8, !tbaa !15
  %28 = getelementptr inbounds i8, ptr %0, i64 14364
  store i8 1, ptr %28, align 4, !tbaa !16
  %29 = getelementptr inbounds i8, ptr %0, i64 16
  br label %.preheader33

.preheader33:                                     ; preds = %24, %34
  %indvars.iv37 = phi i64 [ 0, %24 ], [ %indvars.iv.next38, %34 ]
  %30 = icmp eq i64 %indvars.iv37, 15
  %31 = icmp eq i64 %indvars.iv37, 0
  %32 = trunc nuw nsw i64 %indvars.iv37 to i32
  br label %35

.preheader:                                       ; preds = %34
  tail call void @_ZN8mackAlgo8MackAlgo9readWallsEv(ptr noundef nonnull align 8 dereferenceable(14372) %0)
  %33 = tail call noundef zeroext i1 @_ZN8mackAlgo8MackAlgo4moveEv(ptr noundef nonnull align 8 dereferenceable(14372) %0)
  br i1 %33, label %.lr.ph, label %.loopexit

34:                                               ; preds = %35
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %exitcond40.not = icmp eq i64 %indvars.iv.next38, 16
  br i1 %exitcond40.not, label %.preheader, label %.preheader33, !llvm.loop !17

35:                                               ; preds = %.preheader33, %35
  %indvars.iv = phi i64 [ 0, %.preheader33 ], [ %indvars.iv.next, %35 ]
  %36 = getelementptr inbounds [16 x [16 x %"class.mackAlgo::Cell"]], ptr %29, i64 0, i64 %indvars.iv37, i64 %indvars.iv
  tail call void @_ZN8mackAlgo4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(53) %36, ptr noundef %5)
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @_ZN8mackAlgo4Cell11setPositionEii(ptr noundef nonnull align 8 dereferenceable(53) %36, i32 noundef %32, i32 noundef %37)
  %38 = icmp eq i64 %indvars.iv, 15
  tail call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %36, i32 noundef 0, i1 noundef zeroext %38)
  tail call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %36, i32 noundef 1, i1 noundef zeroext %30)
  %39 = icmp eq i64 %indvars.iv, 0
  tail call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %36, i32 noundef 2, i1 noundef zeroext %39)
  tail call void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53) %36, i32 noundef 3, i1 noundef zeroext %31)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 16
  br i1 %exitcond.not, label %34, label %35, !llvm.loop !19

.lr.ph:                                           ; preds = %.preheader, %53
  %40 = load i8, ptr %28, align 4, !tbaa !16, !range !20, !noundef !21
  %41 = trunc nuw i8 %40 to i1
  %42 = load i32, ptr %25, align 8, !tbaa !13
  br i1 %41, label %43, label %46

43:                                               ; preds = %.lr.ph
  %44 = load i32, ptr %26, align 4, !tbaa !14
  %45 = tail call noundef zeroext i1 @_ZN8mackAlgo8MackAlgo6inGoalEii(ptr noundef nonnull align 8 dereferenceable(14372) %0, i32 noundef %42, i32 noundef %44)
  br i1 %45, label %._crit_edge, label %53

._crit_edge:                                      ; preds = %43
  %.pre = load i8, ptr %28, align 4, !tbaa !16, !range !20
  br label %50

46:                                               ; preds = %.lr.ph
  %47 = icmp eq i32 %42, 0
  %48 = load i32, ptr %26, align 4
  %49 = icmp eq i32 %48, 0
  %or.cond32 = select i1 %47, i1 %49, i1 false
  br i1 %or.cond32, label %50, label %53

50:                                               ; preds = %._crit_edge, %46
  %51 = phi i8 [ %.pre, %._crit_edge ], [ %40, %46 ]
  %52 = xor i8 %51, 1
  store i8 %52, ptr %28, align 4, !tbaa !16
  br label %53

53:                                               ; preds = %50, %46, %43
  tail call void @_ZN8mackAlgo8MackAlgo9readWallsEv(ptr noundef nonnull align 8 dereferenceable(14372) %0)
  %54 = tail call noundef zeroext i1 @_ZN8mackAlgo8MackAlgo4moveEv(ptr noundef nonnull align 8 dereferenceable(14372) %0)
  br i1 %54, label %.lr.ph, label %.loopexit, !llvm.loop !22

.loopexit.sink.split:                             ; preds = %10, %21
  %.sink = phi ptr [ %23, %21 ], [ %19, %10 ]
  %55 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %.sink, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %.loopexit

.loopexit:                                        ; preds = %53, %.loopexit.sink.split, %.preheader
  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 @_ZN8mackAlgo4Cell17setMouseInterfaceEPN3sim14MouseInterfaceE(ptr noundef nonnull align 8 dereferenceable(53), ptr noundef) local_unnamed_addr #2

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

declare void @_ZN8mackAlgo4Cell7setWallEib(ptr noundef nonnull align 8 dereferenceable(53), i32 noundef, i1 noundef zeroext) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN8mackAlgo8MackAlgo6inGoalEii(ptr noundef nonnull align 8 dereferenceable(14372), i32 noundef, i32 noundef) local_unnamed_addr #3 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" }
attributes #3 = { 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" }

!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 = !{!"_ZTSN8mackAlgo8MackAlgoE", !7, i64 0, !8, i64 8, !9, i64 16, !11, i64 14352, !11, i64 14356, !11, i64 14360, !12, i64 14364, !11, i64 14368}
!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 = !{!6, !11, i64 14352}
!14 = !{!6, !11, i64 14356}
!15 = !{!6, !11, i64 14360}
!16 = !{!6, !12, i64 14364}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !18}


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