; LLVM IR from TharushaDinujaya/MicroMouse :: src/solver.ll (Z13resetFloodMapPA14_i)

; 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"

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

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

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

6:                                                ; preds = %27, %1
  %7 = load i32, ptr %3, align 4, !tbaa !9
  %8 = icmp slt i32 %7, 14
  br i1 %8, label %10, label %9

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

10:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #2
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %23, %10
  %12 = load i32, ptr %5, align 4, !tbaa !9
  %13 = icmp slt i32 %12, 14
  br i1 %13, label %15, label %14

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

15:                                               ; preds = %11
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = sext i32 %17 to i64
  %19 = getelementptr inbounds [14 x i32], ptr %16, i64 %18
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [14 x i32], ptr %19, i64 0, i64 %21
  store i32 9999, ptr %22, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %15
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %5, align 4, !tbaa !9
  br label %11, !llvm.loop !11

26:                                               ; preds = %14
  br label %27

27:                                               ; preds = %26
  %28 = load i32, ptr %3, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  store i32 %29, ptr %3, align 4, !tbaa !9
  br label %6, !llvm.loop !13

30:                                               ; preds = %9
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds [14 x i32], ptr %31, i64 7
  %33 = getelementptr inbounds [14 x i32], ptr %32, i64 0, i64 7
  store i32 0, ptr %33, align 4, !tbaa !9
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds [14 x i32], ptr %34, i64 8
  %36 = getelementptr inbounds [14 x i32], ptr %35, i64 0, i64 7
  store i32 0, ptr %36, align 4, !tbaa !9
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds [14 x i32], ptr %37, i64 7
  %39 = getelementptr inbounds [14 x i32], ptr %38, i64 0, i64 8
  store i32 0, ptr %39, align 4, !tbaa !9
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds [14 x i32], ptr %40, i64 8
  %42 = getelementptr inbounds [14 x i32], ptr %41, i64 0, i64 8
  store i32 0, ptr %42, align 4, !tbaa !9
  ret void
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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"

; Function Attrs: mustprogress nofree norecurse nosync nounwind memory(argmem: write) uwtable
define dso_local void @_Z13resetFloodMapPA14_i(ptr nocapture noundef writeonly %0) local_unnamed_addr #0 {
.preheader:
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %0, align 4, !tbaa !5
  %1 = getelementptr inbounds i8, ptr %0, i64 16
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %1, align 4, !tbaa !5
  %2 = getelementptr inbounds i8, ptr %0, i64 32
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %2, align 4, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 9999, ptr %3, align 4, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 52
  store i32 9999, ptr %4, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %5, align 4, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %6, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 88
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %7, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 9999, ptr %8, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 108
  store i32 9999, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 112
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %10, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %11, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 144
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %12, align 4, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 160
  store i32 9999, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 164
  store i32 9999, ptr %14, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 168
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 184
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %16, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %0, i64 200
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %17, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 216
  store i32 9999, ptr %18, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 220
  store i32 9999, ptr %19, align 4, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 224
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %20, align 4, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %0, i64 240
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %21, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 256
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %22, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 272
  store i32 9999, ptr %23, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %0, i64 276
  store i32 9999, ptr %24, align 4, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %0, i64 280
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %25, align 4, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %0, i64 296
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %26, align 4, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %0, i64 312
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %27, align 4, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %0, i64 328
  store i32 9999, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %0, i64 332
  store i32 9999, ptr %29, align 4, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %0, i64 336
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %30, align 4, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %0, i64 352
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %31, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %0, i64 368
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %32, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %0, i64 384
  store i32 9999, ptr %33, align 4, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %0, i64 388
  store i32 9999, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %0, i64 392
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %35, align 4, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %0, i64 408
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %36, align 4, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 424
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %0, i64 440
  store i32 9999, ptr %38, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %0, i64 444
  store i32 9999, ptr %39, align 4, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %0, i64 448
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %40, align 4, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %0, i64 464
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %41, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %0, i64 480
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %42, align 4, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %0, i64 496
  store i32 9999, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds i8, ptr %0, i64 500
  store i32 9999, ptr %44, align 4, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %0, i64 504
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %45, align 4, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %0, i64 520
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %46, align 4, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %0, i64 536
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %47, align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %0, i64 552
  store i32 9999, ptr %48, align 4, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %0, i64 556
  store i32 9999, ptr %49, align 4, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %0, i64 560
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %50, align 4, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %0, i64 576
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %51, align 4, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %0, i64 592
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %52, align 4, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %0, i64 608
  store i32 9999, ptr %53, align 4, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %0, i64 612
  store i32 9999, ptr %54, align 4, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %0, i64 616
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %55, align 4, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %0, i64 632
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %56, align 4, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %0, i64 648
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %57, align 4, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %0, i64 664
  store i32 9999, ptr %58, align 4, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %0, i64 668
  store i32 9999, ptr %59, align 4, !tbaa !5
  %60 = getelementptr inbounds i8, ptr %0, i64 672
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %60, align 4, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %0, i64 688
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %61, align 4, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %0, i64 704
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %62, align 4, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %0, i64 720
  store i32 9999, ptr %63, align 4, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %0, i64 724
  store i32 9999, ptr %64, align 4, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %0, i64 728
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %65, align 4, !tbaa !5
  %66 = getelementptr inbounds i8, ptr %0, i64 744
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %66, align 4, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %0, i64 760
  store <4 x i32> <i32 9999, i32 9999, i32 9999, i32 9999>, ptr %67, align 4, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %0, i64 776
  store i32 9999, ptr %68, align 4, !tbaa !5
  %69 = getelementptr inbounds i8, ptr %0, i64 780
  store i32 9999, ptr %69, align 4, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %0, i64 420
  store i32 0, ptr %70, align 4, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %0, i64 476
  store i32 0, ptr %71, align 4, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %0, i64 424
  store i32 0, ptr %72, align 4, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %0, i64 480
  store i32 0, ptr %73, align 4, !tbaa !5
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind memory(argmem: write) 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, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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