; LLVM IR from mackorone/mms :: old/v2/src/sim (MazeChecker)

; 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.sim::BasicTile" = type { %"class.std::map.76" }
%"class.std::map.76" = type { %"class.std::_Rb_tree.77" }
%"class.std::_Rb_tree.77" = type { %"struct.std::_Rb_tree<sim::Direction, std::pair<const sim::Direction, bool>, std::_Select1st<std::pair<const sim::Direction, bool>>, std::less<sim::Direction>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<sim::Direction, std::pair<const sim::Direction, bool>, std::_Select1st<std::pair<const sim::Direction, bool>>, std::less<sim::Direction>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }

; 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 noundef zeroext i1 @_ZN3sim11MazeChecker10isEnclosedERKSt6vectorIS1_INS_9BasicTileESaIS2_EESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %0) #1 align 2 {
  %2 = alloca i1, align 1
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %123, %1
  %12 = load i32, ptr %4, align 4, !tbaa !9
  %13 = sext i32 %12 to i64
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = call noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %14) #3
  %16 = icmp ult i64 %13, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %11
  store i32 2, ptr %5, align 4
  br label %126

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

19:                                               ; preds = %117, %18
  %20 = load i32, ptr %6, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %24)
  %26 = call noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %25) #3
  %27 = icmp ult i64 %21, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %19
  store i32 5, ptr %5, align 4
  br label %120

29:                                               ; preds = %19
  %30 = load i32, ptr %4, align 4, !tbaa !9
  %31 = icmp eq i32 %30, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  br i1 %31, label %32, label %45

32:                                               ; preds = %29
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = load i32, ptr %4, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %33, i64 noundef %35)
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %36, i64 noundef %38)
  %40 = getelementptr inbounds %"struct.sim::BasicTile", ptr %39, i32 0, i32 0
  store i32 3, ptr %7, align 4, !tbaa !11
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %40, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %42 = load i8, ptr %41, align 1, !tbaa !13, !range !15, !noundef !16
  %43 = trunc i8 %42 to i1
  %44 = xor i1 %43, true
  br label %45

45:                                               ; preds = %32, %29
  %46 = phi i1 [ false, %29 ], [ %44, %32 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br i1 %46, label %47, label %48

47:                                               ; preds = %45
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %120

48:                                               ; preds = %45
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = icmp eq i32 %49, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  br i1 %50, label %51, label %64

51:                                               ; preds = %48
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = load i32, ptr %4, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %52, i64 noundef %54)
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %55, i64 noundef %57)
  %59 = getelementptr inbounds %"struct.sim::BasicTile", ptr %58, i32 0, i32 0
  store i32 2, ptr %8, align 4, !tbaa !11
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %59, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %61 = load i8, ptr %60, align 1, !tbaa !13, !range !15, !noundef !16
  %62 = trunc i8 %61 to i1
  %63 = xor i1 %62, true
  br label %64

64:                                               ; preds = %51, %48
  %65 = phi i1 [ false, %48 ], [ %63, %51 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br i1 %65, label %66, label %67

66:                                               ; preds = %64
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %120

67:                                               ; preds = %64
  %68 = load i32, ptr %4, align 4, !tbaa !9
  %69 = sext i32 %68 to i64
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = call noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %70) #3
  %72 = sub i64 %71, 1
  %73 = icmp eq i64 %69, %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  br i1 %73, label %74, label %87

74:                                               ; preds = %67
  %75 = load ptr, ptr %3, align 8, !tbaa !5
  %76 = load i32, ptr %4, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %77)
  %79 = load i32, ptr %6, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %78, i64 noundef %80)
  %82 = getelementptr inbounds %"struct.sim::BasicTile", ptr %81, i32 0, i32 0
  store i32 1, ptr %9, align 4, !tbaa !11
  %83 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %82, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %84 = load i8, ptr %83, align 1, !tbaa !13, !range !15, !noundef !16
  %85 = trunc i8 %84 to i1
  %86 = xor i1 %85, true
  br label %87

87:                                               ; preds = %74, %67
  %88 = phi i1 [ false, %67 ], [ %86, %74 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br i1 %88, label %89, label %90

89:                                               ; preds = %87
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %120

90:                                               ; preds = %87
  %91 = load i32, ptr %6, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = load ptr, ptr %3, align 8, !tbaa !5
  %94 = load i32, ptr %4, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %93, i64 noundef %95)
  %97 = call noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #3
  %98 = sub i64 %97, 1
  %99 = icmp eq i64 %92, %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  br i1 %99, label %100, label %113

100:                                              ; preds = %90
  %101 = load ptr, ptr %3, align 8, !tbaa !5
  %102 = load i32, ptr %4, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef %103)
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106)
  %108 = getelementptr inbounds %"struct.sim::BasicTile", ptr %107, i32 0, i32 0
  store i32 0, ptr %10, align 4, !tbaa !11
  %109 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %108, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %110 = load i8, ptr %109, align 1, !tbaa !13, !range !15, !noundef !16
  %111 = trunc i8 %110 to i1
  %112 = xor i1 %111, true
  br label %113

113:                                              ; preds = %100, %90
  %114 = phi i1 [ false, %90 ], [ %112, %100 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br i1 %114, label %115, label %116

115:                                              ; preds = %113
  store i1 false, ptr %2, align 1
  store i32 1, ptr %5, align 4
  br label %120

116:                                              ; preds = %113
  br label %117

117:                                              ; preds = %116
  %118 = load i32, ptr %6, align 4, !tbaa !9
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %6, align 4, !tbaa !9
  br label %19, !llvm.loop !17

120:                                              ; preds = %115, %89, %66, %47, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  %121 = load i32, ptr %5, align 4
  switch i32 %121, label %126 [
    i32 5, label %122
  ]

122:                                              ; preds = %120
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %4, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %4, align 4, !tbaa !9
  br label %11, !llvm.loop !19

126:                                              ; preds = %120, %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  %127 = load i32, ptr %5, align 4
  switch i32 %127, label %131 [
    i32 2, label %128
    i32 1, label %129
  ]

128:                                              ; preds = %126
  store i1 true, ptr %2, align 1
  br label %129

129:                                              ; preds = %128, %126
  %130 = load i1, ptr %2, align 1
  ret i1 %130

131:                                              ; preds = %126
  unreachable
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

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


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress 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 noundef zeroext i1 @_ZN3sim11MazeChecker10isEnclosedERKSt6vectorIS1_INS_9BasicTileESaIS2_EESaIS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = tail call noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  %7 = icmp eq i64 %6, 0
  br i1 %7, label %.thread, label %.preheader

.preheader:                                       ; preds = %1, %._crit_edge
  %indvars.iv53 = phi i64 [ %indvars.iv.next54, %._crit_edge ], [ 0, %1 ]
  %8 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %9 = call noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %8) #3
  %.not43.not = icmp eq i64 %9, 0
  br i1 %.not43.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  %10 = icmp eq i64 %indvars.iv53, 0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  br i1 %10, label %11, label %.critedge.peel

.critedge.peel:                                   ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br label %17

11:                                               ; preds = %.lr.ph
  %12 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0)
  %13 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %12, i64 noundef 0)
  store i32 3, ptr %2, align 4, !tbaa !5
  %14 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %13, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %15 = load i8, ptr %14, align 1, !tbaa !9, !range !11, !noundef !12
  %16 = trunc nuw i8 %15 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br i1 %16, label %17, label %.thread

17:                                               ; preds = %.critedge.peel, %11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %18 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %19 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %18, i64 noundef 0)
  store i32 2, ptr %3, align 4, !tbaa !5
  %20 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %19, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %21 = load i8, ptr %20, align 1, !tbaa !9, !range !11, !noundef !12
  %22 = trunc nuw i8 %21 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  br i1 %22, label %23, label %.thread

23:                                               ; preds = %17
  %24 = call noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  %25 = add i64 %24, -1
  %26 = icmp eq i64 %25, %indvars.iv53
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  br i1 %26, label %27, label %.critedge4.peel

.critedge4.peel:                                  ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %33

27:                                               ; preds = %23
  %28 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %29 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %28, i64 noundef 0)
  store i32 1, ptr %4, align 4, !tbaa !5
  %30 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %31 = load i8, ptr %30, align 1, !tbaa !9, !range !11, !noundef !12
  %32 = trunc nuw i8 %31 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br i1 %32, label %33, label %.thread

33:                                               ; preds = %27, %.critedge4.peel
  %34 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %35 = call noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %34) #3
  %36 = icmp eq i64 %35, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  br i1 %36, label %37, label %.critedge6.peel

.critedge6.peel:                                  ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %43

37:                                               ; preds = %33
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %39 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %38, i64 noundef 0)
  store i32 0, ptr %5, align 4, !tbaa !5
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %39, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %41 = load i8, ptr %40, align 1, !tbaa !9, !range !11, !noundef !12
  %42 = trunc nuw i8 %41 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br i1 %42, label %43, label %.thread

43:                                               ; preds = %37, %.critedge6.peel
  %44 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %45 = call noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %44) #3
  %.not.peel = icmp ugt i64 %45, 1
  br i1 %.not.peel, label %.peel.next, label %._crit_edge

.peel.next:                                       ; preds = %43, %73
  %indvars.iv = phi i64 [ %indvars.iv.next, %73 ], [ 1, %43 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  br i1 %10, label %46, label %.critedge

46:                                               ; preds = %.peel.next
  %47 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0)
  %48 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %47, i64 noundef %indvars.iv)
  store i32 3, ptr %2, align 4, !tbaa !5
  %49 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %48, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %50 = load i8, ptr %49, align 1, !tbaa !9, !range !11, !noundef !12
  %51 = trunc nuw i8 %50 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br i1 %51, label %52, label %.thread

.critedge:                                        ; preds = %.peel.next
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br label %52

52:                                               ; preds = %.critedge, %46
  %53 = call noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  %54 = add i64 %53, -1
  %55 = icmp eq i64 %54, %indvars.iv53
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  br i1 %55, label %56, label %.critedge4

56:                                               ; preds = %52
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %58 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %57, i64 noundef %indvars.iv)
  store i32 1, ptr %4, align 4, !tbaa !5
  %59 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %58, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %60 = load i8, ptr %59, align 1, !tbaa !9, !range !11, !noundef !12
  %61 = trunc nuw i8 %60 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br i1 %61, label %62, label %.thread

.critedge4:                                       ; preds = %52
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  br label %62

62:                                               ; preds = %.critedge4, %56
  %63 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %64 = call noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #3
  %65 = add i64 %64, -1
  %66 = icmp eq i64 %65, %indvars.iv
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  br i1 %66, label %67, label %.critedge6

67:                                               ; preds = %62
  %68 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %69 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %68, i64 noundef %indvars.iv)
  store i32 0, ptr %5, align 4, !tbaa !5
  %70 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %69, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %71 = load i8, ptr %70, align 1, !tbaa !9, !range !11, !noundef !12
  %72 = trunc nuw i8 %71 to i1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br i1 %72, label %73, label %.thread

.critedge6:                                       ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %73

73:                                               ; preds = %67, %.critedge6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %74 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %indvars.iv53)
  %75 = call noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %74) #3
  %.not = icmp ugt i64 %75, %indvars.iv.next
  br i1 %.not, label %.peel.next, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %73, %43, %.preheader
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %76 = call noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #3
  %.not56 = icmp ugt i64 %76, %indvars.iv.next54
  br i1 %.not56, label %.preheader, label %.thread, !llvm.loop !16

.thread:                                          ; preds = %._crit_edge, %11, %17, %27, %37, %46, %56, %67, %1
  %77 = phi i1 [ true, %1 ], [ false, %67 ], [ false, %56 ], [ false, %46 ], [ true, %._crit_edge ], [ false, %11 ], [ false, %17 ], [ false, %27 ], [ false, %37 ]
  ret i1 %77
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(48) ptr @_ZNKSt6vectorIN3sim9BasicTileESaIS1_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNKSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #1 align 2

attributes #0 = { mustprogress 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 = { 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 #3 = { 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 = !{!"_ZTSN3sim9DirectionE", !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 = !{}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.peeled.count", i32 1}
!16 = distinct !{!16, !14}


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