; LLVM IR from Karansutradhar/Maze-Solver-Robot-Depth-First-Search :: Final_Project/src/Algorithm/algorithm.ll (ZN2fp9Algorithm10IsExploredESt5arrayIiLm2EE)

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

%"struct.std::array.1" = type { [2 x i32] }
%"class.fp::Algorithm" = type { i8, i8, i8, %"class.fp::Maze", i8, %"struct.std::array.1", %"struct.std::array.1", %"class.std::stack", %"class.std::shared_ptr", %"class.std::stack", %"struct.std::array.2", %"struct.std::array.2", %"struct.std::array", %"struct.std::array", %"struct.std::array.1", %"struct.std::array.1", %"struct.std::array.1", %"struct.std::array.1", %"struct.std::array.1" }
%"class.fp::Maze" = type { %"struct.std::array", %"struct.std::array", %"struct.std::array", %"struct.std::array" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::array<int, 2>, std::allocator<std::array<int, 2>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::array.2" = type { [16 x %"struct.std::array.3"] }
%"struct.std::array.3" = type { [16 x %"struct.fp::Node"] }
%"struct.fp::Node" = type { i32, %"struct.std::array.1" }
%"struct.std::array" = type { [16 x %"struct.std::array.0"] }
%"struct.std::array.0" = type { [16 x i8] }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2fp9Algorithm10IsExploredESt5arrayIiLm2EE(ptr noundef nonnull align 8 dereferenceable(7920) %0, i64 %1) #0 align 2 {
  %3 = alloca %"struct.std::array.1", align 4
  %4 = alloca ptr, align 8
  %5 = getelementptr inbounds %"struct.std::array.1", ptr %3, i32 0, i32 0
  store i64 %1, ptr %5, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8
  %7 = getelementptr inbounds %"class.fp::Algorithm", ptr %6, i32 0, i32 12
  %8 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm2EE2atEm(ptr noundef nonnull align 4 dereferenceable(8) %3, i64 noundef 0)
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = sext i32 %9 to i64
  %11 = call noundef nonnull align 1 dereferenceable(16) ptr @_ZNSt5arrayIS_IbLm16EELm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(256) %7, i64 noundef %10)
  %12 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm2EE2atEm(ptr noundef nonnull align 4 dereferenceable(8) %3, i64 noundef 1)
  %13 = load i32, ptr %12, align 4, !tbaa !9
  %14 = sext i32 %13 to i64
  %15 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5arrayIbLm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(16) %11, i64 noundef %14)
  %16 = load i8, ptr %15, align 1, !tbaa !11, !range !13, !noundef !14
  %17 = trunc i8 %16 to i1
  ret i1 %17
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(16) ptr @_ZNSt5arrayIS_IbLm16EELm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(256), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm2EE2atEm(ptr noundef nonnull align 4 dereferenceable(8), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5arrayIbLm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(16), i64 noundef) #0 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = !{i8 0, i8 2}
!14 = !{}


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

%"struct.std::array.1" = type { [2 x i32] }

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN2fp9Algorithm10IsExploredESt5arrayIiLm2EE(ptr noundef nonnull align 8 dereferenceable(7920) %0, i64 %1) local_unnamed_addr #0 align 2 {
  %3 = alloca %"struct.std::array.1", align 8
  store i64 %1, ptr %3, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 7368
  %5 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm2EE2atEm(ptr noundef nonnull align 4 dereferenceable(8) %3, i64 noundef 0)
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = sext i32 %6 to i64
  %8 = call noundef nonnull align 1 dereferenceable(16) ptr @_ZNSt5arrayIS_IbLm16EELm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(256) %4, i64 noundef %7)
  %9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt5arrayIiLm2EE2atEm(ptr noundef nonnull align 4 dereferenceable(8) %3, i64 noundef 1)
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5arrayIbLm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(16) %8, i64 noundef %11)
  %13 = load i8, ptr %12, align 1, !tbaa !9, !range !11, !noundef !12
  %14 = trunc nuw i8 %13 to i1
  ret i1 %14
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(16) ptr @_ZNSt5arrayIS_IbLm16EELm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(256), i64 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt5arrayIbLm16EE2atEm(ptr noundef nonnull align 1 dereferenceable(16), i64 noundef) local_unnamed_addr #0 align 2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InstCombinePass,SROAPass