; LLVM IR from mackorone/mms :: old/v2/src/sim/Maze.ll (ZN3sim4Maze17getBlankBasicMazeEii)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.79" = type { %"struct.std::_Vector_base.80" }
%"struct.std::_Vector_base.80" = type { %"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.132" = type { %"struct.std::_Vector_base.133" }
%"struct.std::_Vector_base.133" = type { %"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.sim::BasicTile" = type { %"class.std::map.100" }
%"class.std::map.100" = type { %"class.std::_Rb_tree.101" }
%"class.std::_Rb_tree.101" = 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair.140" = type <{ i32, i8, [3 x i8] }>
%"struct.std::pair.137" = type <{ %"struct.std::_Rb_tree_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_iterator" = type { ptr }

@_ZN3simL10DIRECTIONSE = external hidden global %"class.std::vector", align 8

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim4Maze17getBlankBasicMazeEii(ptr dead_on_unwind noalias writable sret(%"class.std::vector.79") align 8 %0, i32 noundef %1, i32 noundef %2) #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i1, align 1
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"class.std::vector.132", align 8
  %11 = alloca i32, align 4
  %12 = alloca %"struct.sim::BasicTile", align 8
  %13 = alloca ptr, align 8
  %14 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca i32, align 4
  %17 = alloca %"struct.std::pair.140", align 4
  %18 = alloca i8, align 1
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca %"struct.std::pair.137", align 8
  store ptr %0, ptr %4, align 8
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  store i1 false, ptr %7, align 1
  call void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %72, %3
  %23 = load i32, ptr %8, align 4, !tbaa !5
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = icmp slt i32 %23, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %22
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %80

27:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #4
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %28

28:                                               ; preds = %62, %27
  %29 = load i32, ptr %11, align 4, !tbaa !5
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = icmp slt i32 %29, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %70

33:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #4
  call void @_ZN3sim9BasicTileC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr @_ZN3simL10DIRECTIONSE, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %34 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #4
  %35 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %14, i32 0, i32 0
  store ptr %34, ptr %35, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %36 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #4
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  br label %38

38:                                               ; preds = %54, %33
  %39 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %14, ptr noundef nonnull align 8 dereferenceable(8) %15) #4
  br i1 %39, label %41, label %40

40:                                               ; preds = %38
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %60

41:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  %43 = load i32, ptr %42, align 4, !tbaa !11
  store i32 %43, ptr %16, align 4, !tbaa !11
  %44 = getelementptr inbounds %"struct.sim::BasicTile", ptr %12, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #4
  store i8 0, ptr %18, align 1, !tbaa !13
  %45 = invoke i64 @_ZSt9make_pairIRN3sim9DirectionEbESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 1 dereferenceable(1) %18)
          to label %46 unwind label %56

46:                                               ; preds = %41
  %47 = trunc i64 %45 to i40
  store i40 %47, ptr %17, align 4
  %48 = invoke { ptr, i8 } @_ZNSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE6insertIS4_IS1_bEEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %44, ptr noundef nonnull align 4 dereferenceable(5) %17)
          to label %49 unwind label %56

49:                                               ; preds = %46
  %50 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 0
  %51 = extractvalue { ptr, i8 } %48, 0
  store ptr %51, ptr %50, align 8
  %52 = getelementptr inbounds { ptr, i8 }, ptr %21, i32 0, i32 1
  %53 = extractvalue { ptr, i8 } %48, 1
  store i8 %53, ptr %52, align 8
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %54

54:                                               ; preds = %49
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  br label %38

56:                                               ; preds = %46, %41
  %57 = landingpad { ptr, i32 }
          cleanup
  %58 = extractvalue { ptr, i32 } %57, 0
  store ptr %58, ptr %19, align 8
  %59 = extractvalue { ptr, i32 } %57, 1
  store i32 %59, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %69

60:                                               ; preds = %40
  invoke void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 8 dereferenceable(48) %12)
          to label %61 unwind label %65

61:                                               ; preds = %60
  call void @_ZN3sim9BasicTileD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #4
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %11, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %11, align 4, !tbaa !5
  br label %28, !llvm.loop !15

65:                                               ; preds = %60
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %19, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %20, align 4
  br label %69

69:                                               ; preds = %65, %56
  call void @_ZN3sim9BasicTileD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %79

70:                                               ; preds = %32
  invoke void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %71 unwind label %75

71:                                               ; preds = %70
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %8, align 4, !tbaa !5
  %74 = add nsw i32 %73, 1
  store i32 %74, ptr %8, align 4, !tbaa !5
  br label %22, !llvm.loop !17

75:                                               ; preds = %70
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %19, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %20, align 4
  br label %79

79:                                               ; preds = %75, %69
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %84

80:                                               ; preds = %26
  store i1 true, ptr %7, align 1
  store i32 1, ptr %9, align 4
  %81 = load i1, ptr %7, align 1
  br i1 %81, label %83, label %82

82:                                               ; preds = %80
  call void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  br label %83

83:                                               ; preds = %82, %80
  ret void

84:                                               ; preds = %79
  %85 = load ptr, ptr %19, align 8
  %86 = load i32, ptr %20, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3sim9BasicTileC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE6insertIS4_IS1_bEEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(5)) #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3sim9BasicTileD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

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 = { 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 = { 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 #4 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN3sim9DirectionE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::Direction, std::allocator<sim::Direction>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.79" = type { %"struct.std::_Vector_base.80" }
%"struct.std::_Vector_base.80" = type { %"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<sim::BasicTile>, std::allocator<std::vector<sim::BasicTile>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.132" = type { %"struct.std::_Vector_base.133" }
%"struct.std::_Vector_base.133" = type { %"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl" }
%"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl" = type { %"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl_data" }
%"struct.std::_Vector_base<sim::BasicTile, std::allocator<sim::BasicTile>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.sim::BasicTile" = type { %"class.std::map.100" }
%"class.std::map.100" = type { %"class.std::_Rb_tree.101" }
%"class.std::_Rb_tree.101" = 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 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair.140" = type <{ i32, i8, [3 x i8] }>

@_ZN3simL10DIRECTIONSE = external hidden global %"class.std::vector", align 8

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sim4Maze17getBlankBasicMazeEii(ptr dead_on_unwind noalias nonnull writable sret(%"class.std::vector.79") align 8 %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::vector.132", align 8
  %5 = alloca %"struct.sim::BasicTile", align 8
  %6 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.std::pair.140", align 8
  %10 = alloca i8, align 1
  tail call void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  %11 = icmp sgt i32 %1, 0
  br i1 %11, label %.lr.ph20, label %._crit_edge21

.lr.ph20:                                         ; preds = %3
  %12 = icmp sgt i32 %2, 0
  br i1 %12, label %.lr.ph16.us, label %.lr.ph20.split

.lr.ph16.us:                                      ; preds = %.lr.ph20, %13
  %.018.us = phi i32 [ %14, %13 ], [ 0, %.lr.ph20 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  br label %15

13:                                               ; preds = %._crit_edge17.us
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  %14 = add nuw nsw i32 %.018.us, 1
  %exitcond30.not = icmp eq i32 %14, %1
  br i1 %exitcond30.not, label %._crit_edge21, label %.lr.ph16.us, !llvm.loop !5

15:                                               ; preds = %.lr.ph16.us, %19
  %.01114.us = phi i32 [ 0, %.lr.ph16.us ], [ %20, %19 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #4
  call void @_ZN3sim9BasicTileC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #4
  %16 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #4
  store ptr %16, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  %17 = call ptr @_ZNKSt6vectorIN3sim9DirectionESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN3simL10DIRECTIONSE) #4
  store ptr %17, ptr %7, align 8
  %18 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %18, label %.lr.ph.us, label %._crit_edge.us

._crit_edge.us:                                   ; preds = %27, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  invoke void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %4, ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %19 unwind label %.split23.us

19:                                               ; preds = %._crit_edge.us
  call void @_ZN3sim9BasicTileD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  %20 = add nuw nsw i32 %.01114.us, 1
  %exitcond29.not = icmp eq i32 %20, %2
  br i1 %exitcond29.not, label %._crit_edge17.us, label %15, !llvm.loop !7

.lr.ph.us:                                        ; preds = %15, %27
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %22 = load i32, ptr %21, align 4, !tbaa !8
  store i32 %22, ptr %8, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #4
  store i8 0, ptr %10, align 1, !tbaa !12
  %23 = invoke i64 @_ZSt9make_pairIRN3sim9DirectionEbESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS4_INS5_IT0_E4typeEE6__typeEEOS6_OSB_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %24 unwind label %.split26.us

24:                                               ; preds = %.lr.ph.us
  %25 = trunc i64 %23 to i40
  store i40 %25, ptr %9, align 8
  %26 = invoke { ptr, i8 } @_ZNSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE6insertIS4_IS1_bEEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(5) %9)
          to label %27 unwind label %.split26.us

27:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  %28 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %6) #4
  %29 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7) #4
  br i1 %29, label %.lr.ph.us, label %._crit_edge.us

._crit_edge17.us:                                 ; preds = %19
  invoke void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %13 unwind label %.split.us

.split.us:                                        ; preds = %._crit_edge17.us
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %37

.split23.us:                                      ; preds = %._crit_edge.us
  %31 = landingpad { ptr, i32 }
          cleanup
  br label %33

.split26.us:                                      ; preds = %24, %.lr.ph.us
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #4
  br label %33

.lr.ph20.split:                                   ; preds = %.lr.ph20, %34
  %.018 = phi i32 [ %35, %34 ], [ 0, %.lr.ph20 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  invoke void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EE9push_backERKS3_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(24) %4)
          to label %34 unwind label %.split

33:                                               ; preds = %.split23.us, %.split26.us
  %.pn = phi { ptr, i32 } [ %32, %.split26.us ], [ %31, %.split23.us ]
  call void @_ZN3sim9BasicTileD2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #4
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #4
  br label %37

34:                                               ; preds = %.lr.ph20.split
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  %35 = add nuw nsw i32 %.018, 1
  %exitcond.not = icmp eq i32 %35, %1
  br i1 %exitcond.not, label %._crit_edge21, label %.lr.ph20.split, !llvm.loop !5

.split:                                           ; preds = %.lr.ph20.split
  %36 = landingpad { ptr, i32 }
          cleanup
  br label %37

37:                                               ; preds = %.split, %.split.us, %33
  %.pn.pn = phi { ptr, i32 } [ %.pn, %33 ], [ %36, %.split ], [ %30, %.split.us ]
  call void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @_ZNSt6vectorIS_IN3sim9BasicTileESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #4
  resume { ptr, i32 } %.pn.pn

._crit_edge21:                                    ; preds = %34, %13, %3
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN9__gnu_cxxneIPKN3sim9DirectionESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3sim9BasicTileC2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3mapIN3sim9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE6insertIS4_IS1_bEEENSt9enable_ifIXsr16is_constructibleIS6_T_EE5valueES4_ISt17_Rb_tree_iteratorIS6_EbEE4typeEOSC_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 4 dereferenceable(5)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3sim9BasicTileD2Ev(ptr noundef nonnull align 8 dereferenceable(48)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIN3sim9BasicTileESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #1 align 2

attributes #0 = { mustprogress 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 = { 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 = { 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 #4 = { 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 = distinct !{!7, !6}
!8 = !{!9, !9, i64 0}
!9 = !{!"_ZTSN3sim9DirectionE", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !10, i64 0}


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