; LLVM IR from mackorone/mms :: old/v2/src/maze/tomasz (TomaszMazeGenerator)

; 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::initializer_list.63" = type { ptr, i64 }
%"class.tomasz::TomaszMazeGenerator" = type { %class.IMazeAlgorithm, double, double, i32, i32, %"class.std::vector.55", %"class.std::stack", i32, i32, i32, ptr }
%class.IMazeAlgorithm = type { ptr }
%"class.std::vector.55" = type { %"struct.std::_Vector_base.56" }
%"struct.std::_Vector_base.56" = type { %"struct.std::_Vector_base<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>, std::allocator<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>, std::allocator<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>, std::allocator<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>, std::allocator<std::vector<tomasz::TomaszMazeGenerator::TomMazeGenTile>>>::_Vector_impl_data" = type { ptr, ptr, 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<tomasz::TomaszMazeGenerator::TomMazeGenTile *, std::allocator<tomasz::TomaszMazeGenerator::TomMazeGenTile *>>::_Deque_impl" }
%"struct.std::_Deque_base<tomasz::TomaszMazeGenerator::TomMazeGenTile *, std::allocator<tomasz::TomaszMazeGenerator::TomMazeGenTile *>>::_Deque_impl" = type { %"struct.std::_Deque_base<tomasz::TomaszMazeGenerator::TomMazeGenTile *, std::allocator<tomasz::TomaszMazeGenerator::TomMazeGenTile *>>::_Deque_impl_data" }
%"struct.std::_Deque_base<tomasz::TomaszMazeGenerator::TomMazeGenTile *, std::allocator<tomasz::TomaszMazeGenerator::TomMazeGenTile *>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile" = type { i32, i32, i32, i8, i8, %"class.std::map.64" }
%"class.std::map.64" = type { %"class.std::_Rb_tree.65" }
%"class.std::_Rb_tree.65" = type { %"struct.std::_Rb_tree<tomasz::Direction, std::pair<const tomasz::Direction, bool>, std::_Select1st<std::pair<const tomasz::Direction, bool>>, std::less<tomasz::Direction>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<tomasz::Direction, std::pair<const tomasz::Direction, bool>, std::_Select1st<std::pair<const tomasz::Direction, bool>>, std::less<tomasz::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 void @_ZN6tomasz19TomaszMazeGenerator18convertToBasicMazeEPN3sim13MazeInterfaceE(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.std::initializer_list.63", align 8
  %10 = alloca [4 x i8], align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i8, align 1
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %105, %2
  %20 = load i32, ptr %5, align 4, !tbaa !9
  %21 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %18, i32 0, i32 7
  %22 = load i32, ptr %21, align 8, !tbaa !11
  %23 = icmp slt i32 %20, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %19
  store i32 2, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %108

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

26:                                               ; preds = %101, %25
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %18, i32 0, i32 8
  %29 = load i32, ptr %28, align 4, !tbaa !27
  %30 = icmp slt i32 %27, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %26
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %104

32:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i8 110, ptr %10, align 1, !tbaa !28
  %33 = getelementptr inbounds i8, ptr %10, i64 1
  store i8 101, ptr %33, align 1, !tbaa !28
  %34 = getelementptr inbounds i8, ptr %10, i64 2
  store i8 115, ptr %34, align 1, !tbaa !28
  %35 = getelementptr inbounds i8, ptr %10, i64 3
  store i8 119, ptr %35, align 1, !tbaa !28
  %36 = getelementptr inbounds %"class.std::initializer_list.63", ptr %9, i32 0, i32 0
  store ptr %10, ptr %36, align 8, !tbaa !29
  %37 = getelementptr inbounds %"class.std::initializer_list.63", ptr %9, i32 0, i32 1
  store i64 4, ptr %37, align 8, !tbaa !31
  store ptr %9, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = call noundef ptr @_ZNKSt16initializer_listIcE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %38) #4
  store ptr %39, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = call noundef ptr @_ZNKSt16initializer_listIcE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %40) #4
  store ptr %41, ptr %12, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %97, %32
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = icmp ne ptr %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 8, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %100

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #4
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = load i8, ptr %48, align 1, !tbaa !28
  store i8 %49, ptr %13, align 1, !tbaa !28
  %50 = load i8, ptr %13, align 1, !tbaa !28
  %51 = sext i8 %50 to i32
  switch i32 %51, label %96 [
    i32 110, label %52
    i32 101, label %63
    i32 115, label %74
    i32 119, label %85
  ]

52:                                               ; preds = %47
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = load i32, ptr %5, align 4, !tbaa !9
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = load i32, ptr %7, align 4, !tbaa !9
  %58 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %18, i32 noundef %56, i32 noundef %57, i32 noundef 4)
  %59 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %58, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !32
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %59, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %61 = load i8, ptr %60, align 1, !tbaa !33, !range !35, !noundef !36
  %62 = trunc i8 %61 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %53, i32 noundef %54, i32 noundef %55, i8 noundef signext 110, i1 noundef zeroext %62)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %96

63:                                               ; preds = %47
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = load i32, ptr %5, align 4, !tbaa !9
  %66 = load i32, ptr %7, align 4, !tbaa !9
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %18, i32 noundef %67, i32 noundef %68, i32 noundef 4)
  %70 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %69, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 1, ptr %15, align 4, !tbaa !32
  %71 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %70, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %72 = load i8, ptr %71, align 1, !tbaa !33, !range !35, !noundef !36
  %73 = trunc i8 %72 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %64, i32 noundef %65, i32 noundef %66, i8 noundef signext 101, i1 noundef zeroext %73)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %96

74:                                               ; preds = %47
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %77 = load i32, ptr %7, align 4, !tbaa !9
  %78 = load i32, ptr %5, align 4, !tbaa !9
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %18, i32 noundef %78, i32 noundef %79, i32 noundef 4)
  %81 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %80, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 2, ptr %16, align 4, !tbaa !32
  %82 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %81, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %83 = load i8, ptr %82, align 1, !tbaa !33, !range !35, !noundef !36
  %84 = trunc i8 %83 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %75, i32 noundef %76, i32 noundef %77, i8 noundef signext 115, i1 noundef zeroext %84)
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %96

85:                                               ; preds = %47
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load i32, ptr %5, align 4, !tbaa !9
  %88 = load i32, ptr %7, align 4, !tbaa !9
  %89 = load i32, ptr %5, align 4, !tbaa !9
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %18, i32 noundef %89, i32 noundef %90, i32 noundef 4)
  %92 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %91, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  store i32 3, ptr %17, align 4, !tbaa !32
  %93 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %92, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %94 = load i8, ptr %93, align 1, !tbaa !33, !range !35, !noundef !36
  %95 = trunc i8 %94 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %86, i32 noundef %87, i32 noundef %88, i8 noundef signext 119, i1 noundef zeroext %95)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %96

96:                                               ; preds = %85, %74, %63, %52, %47
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #4
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr %11, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %98, i32 1
  store ptr %99, ptr %11, align 8, !tbaa !5
  br label %42

100:                                              ; preds = %46
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %7, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %7, align 4, !tbaa !9
  br label %26, !llvm.loop !37

104:                                              ; preds = %31
  br label %105

105:                                              ; preds = %104
  %106 = load i32, ptr %5, align 4, !tbaa !9
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %5, align 4, !tbaa !9
  br label %19, !llvm.loop !39

108:                                              ; preds = %24
  ret void
}

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

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

declare void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef, i8 noundef signext, i1 noundef zeroext) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_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 = { "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 = !{!"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, !10, i64 136}
!12 = !{!"_ZTSN6tomasz19TomaszMazeGeneratorE", !13, i64 0, !14, i64 8, !14, i64 16, !10, i64 24, !10, i64 28, !15, i64 32, !19, i64 56, !10, i64 136, !10, i64 140, !26, i64 144, !6, i64 152}
!13 = !{!"_ZTS14IMazeAlgorithm"}
!14 = !{!"double", !7, i64 0}
!15 = !{!"_ZTSSt6vectorIS_IN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS2_EESaIS4_EE", !16, i64 0}
!16 = !{!"_ZTSSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE12_Vector_implE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTSSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE", !20, i64 0}
!20 = !{!"_ZTSSt5dequeIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE", !22, i64 0}
!22 = !{!"_ZTSNSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE11_Deque_implE", !23, i64 0}
!23 = !{!"_ZTSNSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE16_Deque_impl_dataE", !6, i64 0, !24, i64 8, !25, i64 16, !25, i64 48}
!24 = !{!"long", !7, i64 0}
!25 = !{!"_ZTSSt15_Deque_iteratorIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileERS3_PS3_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!26 = !{!"_ZTSN6tomasz9DirectionE", !7, i64 0}
!27 = !{!12, !10, i64 140}
!28 = !{!7, !7, i64 0}
!29 = !{!30, !6, i64 0}
!30 = !{!"_ZTSSt16initializer_listIcE", !6, i64 0, !24, i64 8}
!31 = !{!30, !24, i64 8}
!32 = !{!26, !26, i64 0}
!33 = !{!34, !34, i64 0}
!34 = !{!"bool", !7, i64 0}
!35 = !{i8 0, i8 2}
!36 = !{}
!37 = distinct !{!37, !38}
!38 = !{!"llvm.loop.mustprogress"}
!39 = distinct !{!39, !38}


; 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::initializer_list.63" = type { ptr, i64 }

; 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 void @_ZN6tomasz19TomaszMazeGenerator18convertToBasicMazeEPN3sim13MazeInterfaceE(ptr noundef nonnull align 8 dereferenceable(160) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = alloca %"class.std::initializer_list.63", align 8
  %4 = alloca [4 x i8], align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = getelementptr inbounds i8, ptr %0, i64 136
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.preheader.lr.ph, label %._crit_edge39

.preheader.lr.ph:                                 ; preds = %2
  %12 = getelementptr inbounds i8, ptr %0, i64 140
  %13 = getelementptr inbounds i8, ptr %3, i64 8
  %14 = load i32, ptr %12, align 4, !tbaa !25
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader, label %._crit_edge39

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge37
  %16 = phi i32 [ %19, %._crit_edge37 ], [ %10, %.preheader.lr.ph ]
  %17 = phi i32 [ %20, %._crit_edge37 ], [ %14, %.preheader.lr.ph ]
  %.038 = phi i32 [ %21, %._crit_edge37 ], [ 0, %.preheader.lr.ph ]
  %18 = icmp sgt i32 %17, 0
  br i1 %18, label %.lr.ph36, label %._crit_edge37

._crit_edge39:                                    ; preds = %._crit_edge37, %.preheader.lr.ph, %2
  ret void

._crit_edge37.loopexit:                           ; preds = %._crit_edge
  %.pre = load i32, ptr %9, align 8, !tbaa !5
  br label %._crit_edge37

._crit_edge37:                                    ; preds = %._crit_edge37.loopexit, %.preheader
  %19 = phi i32 [ %.pre, %._crit_edge37.loopexit ], [ %16, %.preheader ]
  %20 = phi i32 [ %26, %._crit_edge37.loopexit ], [ %17, %.preheader ]
  %21 = add nuw nsw i32 %.038, 1
  %22 = icmp slt i32 %21, %19
  br i1 %22, label %.preheader, label %._crit_edge39, !llvm.loop !26

.lr.ph36:                                         ; preds = %.preheader, %._crit_edge
  %.03235 = phi i32 [ %25, %._crit_edge ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  store <4 x i8> <i8 110, i8 101, i8 115, i8 119>, ptr %4, align 4, !tbaa !29
  store ptr %4, ptr %3, align 8, !tbaa !30
  store i64 4, ptr %13, align 8, !tbaa !32
  %23 = call noundef ptr @_ZNKSt16initializer_listIcE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  %24 = call noundef ptr @_ZNKSt16initializer_listIcE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  %.not33 = icmp eq ptr %23, %24
  br i1 %.not33, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %53, %.lr.ph36
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  %25 = add nuw nsw i32 %.03235, 1
  %26 = load i32, ptr %12, align 4, !tbaa !25
  %27 = icmp slt i32 %25, %26
  br i1 %27, label %.lr.ph36, label %._crit_edge37.loopexit, !llvm.loop !33

.lr.ph:                                           ; preds = %.lr.ph36, %53
  %.03134 = phi ptr [ %54, %53 ], [ %23, %.lr.ph36 ]
  %28 = load i8, ptr %.03134, align 1, !tbaa !29
  switch i8 %28, label %53 [
    i8 110, label %29
    i8 101, label %35
    i8 115, label %41
    i8 119, label %47
  ]

29:                                               ; preds = %.lr.ph
  %30 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %.038, i32 noundef %.03235, i32 noundef 4)
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #4
  store i32 0, ptr %5, align 4, !tbaa !34
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %31, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %33 = load i8, ptr %32, align 1, !tbaa !35, !range !37, !noundef !38
  %34 = trunc nuw i8 %33 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %.038, i32 noundef %.03235, i8 noundef signext 110, i1 noundef zeroext %34)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #4
  br label %53

35:                                               ; preds = %.lr.ph
  %36 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %.038, i32 noundef %.03235, i32 noundef 4)
  %37 = getelementptr inbounds i8, ptr %36, i64 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 1, ptr %6, align 4, !tbaa !34
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %37, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %39 = load i8, ptr %38, align 1, !tbaa !35, !range !37, !noundef !38
  %40 = trunc nuw i8 %39 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %.038, i32 noundef %.03235, i8 noundef signext 101, i1 noundef zeroext %40)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  br label %53

41:                                               ; preds = %.lr.ph
  %42 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %.038, i32 noundef %.03235, i32 noundef 4)
  %43 = getelementptr inbounds i8, ptr %42, i64 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  store i32 2, ptr %7, align 4, !tbaa !34
  %44 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %43, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %45 = load i8, ptr %44, align 1, !tbaa !35, !range !37, !noundef !38
  %46 = trunc nuw i8 %45 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %.038, i32 noundef %.03235, i8 noundef signext 115, i1 noundef zeroext %46)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %53

47:                                               ; preds = %.lr.ph
  %48 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %.038, i32 noundef %.03235, i32 noundef 4)
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #4
  store i32 3, ptr %8, align 4, !tbaa !34
  %50 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE2atERS5_(ptr noundef nonnull align 8 dereferenceable(48) %49, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %51 = load i8, ptr %50, align 1, !tbaa !35, !range !37, !noundef !38
  %52 = trunc nuw i8 %51 to i1
  call void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %.038, i32 noundef %.03235, i8 noundef signext 119, i1 noundef zeroext %52)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #4
  br label %53

53:                                               ; preds = %47, %41, %35, %29, %.lr.ph
  %54 = getelementptr inbounds i8, ptr %.03134, i64 1
  %.not = icmp eq ptr %54, %24
  br i1 %.not, label %._crit_edge, label %.lr.ph
}

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

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

declare void @_ZN3sim13MazeInterface7setWallEiicb(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef, i8 noundef signext, i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_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 = { "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, !11, i64 136}
!6 = !{!"_ZTSN6tomasz19TomaszMazeGeneratorE", !7, i64 0, !8, i64 8, !8, i64 16, !11, i64 24, !11, i64 28, !12, i64 32, !17, i64 56, !11, i64 136, !11, i64 140, !24, i64 144, !16, i64 152}
!7 = !{!"_ZTS14IMazeAlgorithm"}
!8 = !{!"double", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"_ZTSSt6vectorIS_IN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS2_EESaIS4_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE17_Vector_impl_dataE", !16, i64 0, !16, i64 8, !16, i64 16}
!16 = !{!"any pointer", !9, i64 0}
!17 = !{!"_ZTSSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE", !18, i64 0}
!18 = !{!"_ZTSSt5dequeIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE", !19, i64 0}
!19 = !{!"_ZTSSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSNSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE11_Deque_implE", !21, i64 0}
!21 = !{!"_ZTSNSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE16_Deque_impl_dataE", !16, i64 0, !22, i64 8, !23, i64 16, !23, i64 48}
!22 = !{!"long", !9, i64 0}
!23 = !{!"_ZTSSt15_Deque_iteratorIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileERS3_PS3_E", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!24 = !{!"_ZTSN6tomasz9DirectionE", !9, i64 0}
!25 = !{!6, !11, i64 140}
!26 = distinct !{!26, !27, !28}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!"llvm.loop.unswitch.partial.disable"}
!29 = !{!9, !9, i64 0}
!30 = !{!31, !16, i64 0}
!31 = !{!"_ZTSSt16initializer_listIcE", !16, i64 0, !22, i64 8}
!32 = !{!31, !22, i64 8}
!33 = distinct !{!33, !27}
!34 = !{!24, !24, i64 0}
!35 = !{!36, !36, i64 0}
!36 = !{!"bool", !9, i64 0}
!37 = !{i8 0, i8 2}
!38 = !{}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,SLPVectorizerPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass