; 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::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 }
%"class.std::initializer_list.70" = type { ptr, i64 }
%"struct.std::pair.71" = type <{ i32, i8, [3 x i8] }>
%"struct.std::less.74" = type { i8 }
%"class.std::allocator.76" = type { i8 }
%"struct.std::_Rb_tree_iterator" = type { ptr }
%"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" }

@_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor = external hidden global float, align 4
@_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor = external hidden global i64, 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 uwtable
define dso_local void @_ZN6tomasz19TomaszMazeGenerator12generateMazeEii(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %1, i32 noundef %2) #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca float, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::map.64", align 8
  %13 = alloca %"class.std::initializer_list.70", align 8
  %14 = alloca [4 x %"struct.std::pair.71"], align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  %19 = alloca i32, align 4
  %20 = alloca i8, align 1
  %21 = alloca i32, align 4
  %22 = alloca i8, align 1
  %23 = alloca %"struct.std::less.74", align 1
  %24 = alloca %"class.std::allocator.76", align 1
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %31 = alloca ptr, align 8
  %32 = alloca float, align 4
  %33 = alloca float, align 4
  %34 = alloca float, align 4
  %35 = alloca i32, align 4
  %36 = alloca %"class.std::map.64", align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  %37 = load ptr, ptr %4, align 8
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 7
  store i32 %38, ptr %39, align 8, !tbaa !11
  %40 = load i32, ptr %6, align 4, !tbaa !9
  %41 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 8
  store i32 %40, ptr %41, align 4, !tbaa !27
  %42 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 9
  store i32 4, ptr %42, align 8, !tbaa !28
  call void @_ZN6tomasz19TomaszMazeGenerator14initializeMazeEv(ptr noundef nonnull align 8 dereferenceable(160) %37)
  %43 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef 0, i32 noundef 0, i32 noundef 4)
  %44 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %43, i32 0, i32 3
  store i8 1, ptr %44, align 4, !tbaa !29
  %45 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef 0, i32 noundef 0, i32 noundef 4)
  %46 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %45, i32 0, i32 2
  store i32 0, ptr %46, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %47 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef 0, i32 noundef 0, i32 noundef 4)
  store ptr %47, ptr %7, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 6
  call void @_ZNSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(80) %48, ptr noundef nonnull align 8 dereferenceable(8) %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %49 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 2
  %50 = load double, ptr %49, align 8, !tbaa !41
  %51 = fptrunc double %50 to float
  store float %51, ptr %8, align 4, !tbaa !42
  br label %52

52:                                               ; preds = %224, %3
  %53 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 6
  %54 = call noundef zeroext i1 @_ZNKSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %53)
  %55 = zext i1 %54 to i32
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %57, label %227

57:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %58 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 6
  %59 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %58)
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %60, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !44
  store i32 %63, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %64 = load ptr, ptr %9, align 8, !tbaa !5
  %65 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !45
  store i32 %66, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = load i32, ptr %11, align 4, !tbaa !9
  %69 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef %67, i32 noundef %68, i32 noundef 0)
  %70 = zext i1 %69 to i8
  store i8 %70, ptr %16, align 1, !tbaa !47
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %14, ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 1 dereferenceable(1) %16)
  %71 = getelementptr inbounds %"struct.std::pair.71", ptr %14, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 1, ptr %17, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = load i32, ptr %11, align 4, !tbaa !9
  %74 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef %72, i32 noundef %73, i32 noundef 1)
  %75 = zext i1 %74 to i8
  store i8 %75, ptr %18, align 1, !tbaa !47
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %71, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 1 dereferenceable(1) %18)
  %76 = getelementptr inbounds %"struct.std::pair.71", ptr %14, i64 2
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 2, ptr %19, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #5
  %77 = load i32, ptr %10, align 4, !tbaa !9
  %78 = load i32, ptr %11, align 4, !tbaa !9
  %79 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef %77, i32 noundef %78, i32 noundef 2)
  %80 = zext i1 %79 to i8
  store i8 %80, ptr %20, align 1, !tbaa !47
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %76, ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 1 dereferenceable(1) %20)
  %81 = getelementptr inbounds %"struct.std::pair.71", ptr %14, i64 3
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 3, ptr %21, align 4, !tbaa !46
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #5
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef %82, i32 noundef %83, i32 noundef 3)
  %85 = zext i1 %84 to i8
  store i8 %85, ptr %22, align 1, !tbaa !47
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %81, ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 1 dereferenceable(1) %22)
  %86 = getelementptr inbounds %"class.std::initializer_list.70", ptr %13, i32 0, i32 0
  store ptr %14, ptr %86, align 8, !tbaa !48
  %87 = getelementptr inbounds %"class.std::initializer_list.70", ptr %13, i32 0, i32 1
  store i64 4, ptr %87, align 8, !tbaa !50
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #5
  call void @_ZNSaISt4pairIKN6tomasz9DirectionEbEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #5
  %88 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8
  %90 = getelementptr inbounds { ptr, i64 }, ptr %13, i32 0, i32 1
  %91 = load i64, ptr %90, align 8
  invoke void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEEC2ESt16initializer_listIS6_ERKS3_RKS7_(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr %89, i64 %91, ptr noundef nonnull align 1 dereferenceable(1) %23, ptr noundef nonnull align 1 dereferenceable(1) %24)
          to label %92 unwind label %102

92:                                               ; preds = %57
  call void @_ZNSt15__new_allocatorISt4pairIKN6tomasz9DirectionEbEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  store i32 0, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  store ptr %12, ptr %28, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %93 = load ptr, ptr %28, align 8, !tbaa !5
  %94 = call ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %93) #5
  %95 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %29, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #5
  %96 = load ptr, ptr %28, align 8, !tbaa !5
  %97 = call ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %96) #5
  %98 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %30, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  br label %99

99:                                               ; preds = %116, %92
  %100 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN6tomasz9DirectionEbEES7_(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef nonnull align 8 dereferenceable(8) %30) #5
  br i1 %100, label %106, label %101

101:                                              ; preds = %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %118

102:                                              ; preds = %57
  %103 = landingpad { ptr, i32 }
          cleanup
  %104 = extractvalue { ptr, i32 } %103, 0
  store ptr %104, ptr %25, align 8
  %105 = extractvalue { ptr, i32 } %103, 1
  store i32 %105, ptr %26, align 4
  call void @_ZNSt15__new_allocatorISt4pairIKN6tomasz9DirectionEbEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  br label %226

106:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #5
  %107 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN6tomasz9DirectionEbEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #5
  store ptr %107, ptr %31, align 8, !tbaa !5
  %108 = load ptr, ptr %31, align 8, !tbaa !5
  %109 = getelementptr inbounds %"struct.std::pair.71", ptr %108, i32 0, i32 1
  %110 = load i8, ptr %109, align 4, !tbaa !51, !range !53, !noundef !54
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %115

112:                                              ; preds = %106
  %113 = load i32, ptr %27, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %27, align 4, !tbaa !9
  br label %115

115:                                              ; preds = %112, %106
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #5
  br label %116

116:                                              ; preds = %115
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN6tomasz9DirectionEbEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #5
  br label %99

118:                                              ; preds = %101
  %119 = load i32, ptr %27, align 4, !tbaa !9
  %120 = icmp eq i32 %119, 0
  br i1 %120, label %121, label %149

121:                                              ; preds = %118
  %122 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 6
  invoke void @_ZNSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %122)
          to label %123 unwind label %142

123:                                              ; preds = %121
  %124 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 9
  %125 = load i32, ptr %124, align 8, !tbaa !28
  %126 = icmp ne i32 %125, 4
  br i1 %126, label %127, label %147

127:                                              ; preds = %123
  %128 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 10
  %129 = load ptr, ptr %128, align 8, !tbaa !55
  %130 = invoke noundef double @_ZN3sim13MazeInterface9getRandomEv(ptr noundef nonnull align 8 dereferenceable(8) %129)
          to label %131 unwind label %142

131:                                              ; preds = %127
  %132 = load float, ptr %8, align 4, !tbaa !42
  %133 = fpext float %132 to double
  %134 = fcmp ole double %130, %133
  br i1 %134, label %135, label %146

135:                                              ; preds = %131
  %136 = load i32, ptr %10, align 4, !tbaa !9
  %137 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN6tomasz19TomaszMazeGenerator23updateDistanceFromStartEii(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef %136, i32 noundef %137)
          to label %138 unwind label %142

138:                                              ; preds = %135
  %139 = load i32, ptr %10, align 4, !tbaa !9
  %140 = load i32, ptr %11, align 4, !tbaa !9
  invoke void @_ZN6tomasz19TomaszMazeGenerator17breakGradientWallEii(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef %139, i32 noundef %140)
          to label %141 unwind label %142

141:                                              ; preds = %138
  br label %146

142:                                              ; preds = %138, %135, %127, %121
  %143 = landingpad { ptr, i32 }
          cleanup
  %144 = extractvalue { ptr, i32 } %143, 0
  store ptr %144, ptr %25, align 8
  %145 = extractvalue { ptr, i32 } %143, 1
  store i32 %145, ptr %26, align 4
  br label %225

146:                                              ; preds = %141, %131
  br label %147

147:                                              ; preds = %146, %123
  %148 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 9
  store i32 4, ptr %148, align 8, !tbaa !28
  br label %224

149:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = sitofp i32 %150 to double
  %152 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 7
  %153 = load i32, ptr %152, align 8, !tbaa !11
  %154 = sitofp i32 %153 to double
  %155 = fdiv double %154, 2.000000e+00
  %156 = fsub double %151, %155
  %157 = fptosi double %156 to i32
  %158 = call i32 @llvm.abs.i32(i32 %157, i1 true)
  %159 = sitofp i32 %158 to double
  %160 = fmul double %159, 2.000000e+00
  %161 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 7
  %162 = load i32, ptr %161, align 8, !tbaa !11
  %163 = sub nsw i32 %162, 1
  %164 = sitofp i32 %163 to double
  %165 = fdiv double %160, %164
  %166 = fptrunc double %165 to float
  store float %166, ptr %32, align 4, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #5
  %167 = load i32, ptr %11, align 4, !tbaa !9
  %168 = sitofp i32 %167 to double
  %169 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 8
  %170 = load i32, ptr %169, align 4, !tbaa !27
  %171 = sitofp i32 %170 to double
  %172 = fdiv double %171, 2.000000e+00
  %173 = fsub double %168, %172
  %174 = fptosi double %173 to i32
  %175 = call i32 @llvm.abs.i32(i32 %174, i1 true)
  %176 = sitofp i32 %175 to double
  %177 = fmul double %176, 2.000000e+00
  %178 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 8
  %179 = load i32, ptr %178, align 4, !tbaa !27
  %180 = sub nsw i32 %179, 1
  %181 = sitofp i32 %180 to double
  %182 = fdiv double %177, %181
  %183 = fptrunc double %182 to float
  store float %183, ptr %33, align 4, !tbaa !42
  %184 = load atomic i8, ptr @_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor acquire, align 8
  %185 = icmp eq i8 %184, 0
  br i1 %185, label %186, label %194, !prof !56

186:                                              ; preds = %149
  %187 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor) #5
  %188 = icmp ne i32 %187, 0
  br i1 %188, label %189, label %194

189:                                              ; preds = %186
  %190 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 1
  %191 = load double, ptr %190, align 8, !tbaa !57
  %192 = fptrunc double %191 to float
  store float %192, ptr @_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor, align 4, !tbaa !42
  %193 = call ptr @llvm.invariant.start.p0(i64 4, ptr @_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor)
  call void @__cxa_guard_release(ptr @_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor) #5
  br label %194

194:                                              ; preds = %189, %186, %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  %195 = load float, ptr @_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor, align 4, !tbaa !42
  %196 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %32, ptr noundef nonnull align 4 dereferenceable(4) %33)
          to label %197 unwind label %210

197:                                              ; preds = %194
  %198 = load float, ptr %196, align 4, !tbaa !42
  %199 = fmul float %195, %198
  store float %199, ptr %34, align 4, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #5
  %200 = load float, ptr %34, align 4, !tbaa !42
  invoke void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEEC2ERKS8_(ptr noundef nonnull align 8 dereferenceable(48) %36, ptr noundef nonnull align 8 dereferenceable(48) %12)
          to label %201 unwind label %214

201:                                              ; preds = %197
  %202 = invoke noundef i32 @_ZN6tomasz19TomaszMazeGenerator18getDirectionToMoveEfSt3mapINS_9DirectionEbSt4lessIS2_ESaISt4pairIKS2_bEEE(ptr noundef nonnull align 8 dereferenceable(160) %37, float noundef %200, ptr noundef %36)
          to label %203 unwind label %218

203:                                              ; preds = %201
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %36) #5
  store i32 %202, ptr %35, align 4, !tbaa !46
  %204 = load i32, ptr %10, align 4, !tbaa !9
  %205 = load i32, ptr %11, align 4, !tbaa !9
  %206 = load i32, ptr %35, align 4, !tbaa !46
  %207 = invoke noundef i32 @_ZN6tomasz19TomaszMazeGenerator19moveTowardDirectionEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef %204, i32 noundef %205, i32 noundef %206)
          to label %208 unwind label %214

208:                                              ; preds = %203
  %209 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %37, i32 0, i32 9
  store i32 %207, ptr %209, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %224

210:                                              ; preds = %194
  %211 = landingpad { ptr, i32 }
          cleanup
  %212 = extractvalue { ptr, i32 } %211, 0
  store ptr %212, ptr %25, align 8
  %213 = extractvalue { ptr, i32 } %211, 1
  store i32 %213, ptr %26, align 4
  br label %223

214:                                              ; preds = %203, %197
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %25, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %26, align 4
  br label %222

218:                                              ; preds = %201
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %25, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %26, align 4
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %36) #5
  br label %222

222:                                              ; preds = %218, %214
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #5
  br label %223

223:                                              ; preds = %222, %210
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  br label %225

224:                                              ; preds = %208, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %52, !llvm.loop !58

225:                                              ; preds = %223, %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #5
  br label %226

226:                                              ; preds = %225, %102
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  br label %228

227:                                              ; preds = %52
  call void @_ZN6tomasz19TomaszMazeGenerator18breakGradientWallsEv(ptr noundef nonnull align 8 dereferenceable(160) %37)
  call void @_ZN6tomasz19TomaszMazeGenerator23updateDistanceFromStartEii(ptr noundef nonnull align 8 dereferenceable(160) %37, i32 noundef 0, i32 noundef 0)
  call void @_ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv(ptr noundef nonnull align 8 dereferenceable(160) %37)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret void

228:                                              ; preds = %226
  %229 = load ptr, ptr %25, align 8
  %230 = load i32, ptr %26, align 4
  %231 = insertvalue { ptr, i32 } poison, ptr %229, 0
  %232 = insertvalue { ptr, i32 } %231, i32 %230, 1
  resume { ptr, i32 } %232
}

; 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 void @_ZN6tomasz19TomaszMazeGenerator14initializeMazeEv(ptr noundef nonnull align 8 dereferenceable(160)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

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

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

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

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

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

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

declare noundef double @_ZN3sim13MazeInterface9getRandomEv(ptr noundef nonnull align 8 dereferenceable(8)) #3

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #5

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

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv(ptr noundef nonnull align 8 dereferenceable(160)) #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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { 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" }

!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 = !{!12, !26, i64 144}
!29 = !{!30, !31, i64 12}
!30 = !{!"_ZTSN6tomasz19TomaszMazeGenerator14TomMazeGenTileE", !10, i64 0, !10, i64 4, !10, i64 8, !31, i64 12, !31, i64 13, !32, i64 16}
!31 = !{!"bool", !7, i64 0}
!32 = !{!"_ZTSSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE", !33, i64 0}
!33 = !{!"_ZTSSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE", !34, i64 0}
!34 = !{!"_ZTSNSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE13_Rb_tree_implIS8_Lb1EEE", !35, i64 0, !37, i64 8}
!35 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN6tomasz9DirectionEEE", !36, i64 0}
!36 = !{!"_ZTSSt4lessIN6tomasz9DirectionEE"}
!37 = !{!"_ZTSSt15_Rb_tree_header", !38, i64 0, !24, i64 32}
!38 = !{!"_ZTSSt18_Rb_tree_node_base", !39, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!39 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!40 = !{!30, !10, i64 8}
!41 = !{!12, !14, i64 16}
!42 = !{!43, !43, i64 0}
!43 = !{!"float", !7, i64 0}
!44 = !{!30, !10, i64 4}
!45 = !{!30, !10, i64 0}
!46 = !{!26, !26, i64 0}
!47 = !{!31, !31, i64 0}
!48 = !{!49, !6, i64 0}
!49 = !{!"_ZTSSt16initializer_listISt4pairIKN6tomasz9DirectionEbEE", !6, i64 0, !24, i64 8}
!50 = !{!49, !24, i64 8}
!51 = !{!52, !31, i64 4}
!52 = !{!"_ZTSSt4pairIKN6tomasz9DirectionEbE", !26, i64 0, !31, i64 4}
!53 = !{i8 0, i8 2}
!54 = !{}
!55 = !{!12, !6, i64 152}
!56 = !{!"branch_weights", i32 1, i32 1048575}
!57 = !{!12, !14, i64 8}
!58 = distinct !{!58, !59}
!59 = !{!"llvm.loop.mustprogress"}


; 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::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 }
%"struct.std::pair.71" = type <{ i32, i8, [3 x i8] }>
%"struct.std::less.74" = type { i8 }
%"class.std::allocator.76" = type { i8 }
%"struct.std::_Rb_tree_iterator" = type { ptr }

@_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor = external hidden global float, align 4
@_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor = external hidden global i64, 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 uwtable
define dso_local void @_ZN6tomasz19TomaszMazeGenerator12generateMazeEii(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca %"class.std::map.64", align 8
  %6 = alloca [4 x %"struct.std::pair.71"], align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i8, align 1
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i8, align 1
  %15 = alloca %"struct.std::less.74", align 1
  %16 = alloca %"class.std::allocator.76", align 1
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca float, align 4
  %20 = alloca float, align 4
  %21 = alloca %"class.std::map.64", align 8
  %22 = getelementptr inbounds i8, ptr %0, i64 136
  store i32 %1, ptr %22, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %0, i64 140
  store i32 %2, ptr %23, align 4, !tbaa !25
  %24 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 4, ptr %24, align 8, !tbaa !26
  tail call void @_ZN6tomasz19TomaszMazeGenerator14initializeMazeEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  %25 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef 0, i32 noundef 0, i32 noundef 4)
  %26 = getelementptr inbounds i8, ptr %25, i64 12
  store i8 1, ptr %26, align 4, !tbaa !27
  %27 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef 0, i32 noundef 0, i32 noundef 4)
  %28 = getelementptr inbounds i8, ptr %27, i64 8
  store i32 0, ptr %28, align 8, !tbaa !38
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  %29 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef 0, i32 noundef 0, i32 noundef 4)
  store ptr %29, ptr %4, align 8, !tbaa !39
  %30 = getelementptr inbounds i8, ptr %0, i64 56
  call void @_ZNSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE4pushERKS3_(ptr noundef nonnull align 8 dereferenceable(80) %30, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %31 = getelementptr inbounds i8, ptr %0, i64 16
  %32 = load double, ptr %31, align 8, !tbaa !40
  %33 = call noundef zeroext i1 @_ZNKSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %30)
  br i1 %33, label %._crit_edge43, label %.lr.ph42

.lr.ph42:                                         ; preds = %3
  %34 = fptrunc double %32 to float
  %35 = getelementptr inbounds i8, ptr %6, i64 8
  %36 = getelementptr inbounds i8, ptr %6, i64 16
  %37 = getelementptr inbounds i8, ptr %6, i64 24
  %38 = getelementptr inbounds i8, ptr %0, i64 8
  %39 = getelementptr inbounds i8, ptr %0, i64 152
  %40 = fpext float %34 to double
  br label %41

41:                                               ; preds = %.lr.ph42, %130
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %30)
  %43 = load ptr, ptr %42, align 8, !tbaa !39
  %44 = getelementptr inbounds i8, ptr %43, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !41
  %46 = load i32, ptr %43, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 0, ptr %7, align 4, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #7
  %47 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %45, i32 noundef %46, i32 noundef 0)
  %48 = zext i1 %47 to i8
  store i8 %48, ptr %8, align 1, !tbaa !44
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 1 dereferenceable(1) %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #7
  store i32 1, ptr %9, align 4, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %10) #7
  %49 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %45, i32 noundef %46, i32 noundef 1)
  %50 = zext i1 %49 to i8
  store i8 %50, ptr %10, align 1, !tbaa !44
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %35, ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 1 dereferenceable(1) %10)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #7
  store i32 2, ptr %11, align 4, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %12) #7
  %51 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %45, i32 noundef %46, i32 noundef 2)
  %52 = zext i1 %51 to i8
  store i8 %52, ptr %12, align 1, !tbaa !44
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %36, ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 1 dereferenceable(1) %12)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #7
  store i32 3, ptr %13, align 4, !tbaa !43
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %14) #7
  %53 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator21isValidUnexploredMoveEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %45, i32 noundef %46, i32 noundef 3)
  %54 = zext i1 %53 to i8
  store i8 %54, ptr %14, align 1, !tbaa !44
  call void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5) %37, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 1 dereferenceable(1) %14)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #7
  call void @_ZNSaISt4pairIKN6tomasz9DirectionEbEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  invoke void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEEC2ESt16initializer_listIS6_ERKS3_RKS7_(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr nonnull %6, i64 4, ptr noundef nonnull align 1 dereferenceable(1) %15, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %55 unwind label %60

55:                                               ; preds = %41
  call void @_ZNSt15__new_allocatorISt4pairIKN6tomasz9DirectionEbEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %17) #7
  %56 = call ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  store ptr %56, ptr %17, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #7
  %57 = call ptr @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  store ptr %57, ptr %18, align 8
  %58 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN6tomasz9DirectionEbEES7_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %58, label %.lr.ph, label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %55
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  br label %68

._crit_edge:                                      ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %17) #7
  %59 = icmp eq i32 %spec.select, 0
  br i1 %59, label %68, label %80

60:                                               ; preds = %41
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt4pairIKN6tomasz9DirectionEbEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #7
  br label %133

.lr.ph:                                           ; preds = %55, %.lr.ph
  %.03340 = phi i32 [ %spec.select, %.lr.ph ], [ 0, %55 ]
  %62 = call noundef nonnull align 4 dereferenceable(5) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKN6tomasz9DirectionEbEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %63 = getelementptr inbounds i8, ptr %62, i64 4
  %64 = load i8, ptr %63, align 4, !tbaa !45, !range !47, !noundef !48
  %65 = zext nneg i8 %64 to i32
  %spec.select = add nuw nsw i32 %.03340, %65
  %66 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKN6tomasz9DirectionEbEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  %67 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKN6tomasz9DirectionEbEES7_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %67, label %.lr.ph, label %._crit_edge

68:                                               ; preds = %._crit_edge.thread, %._crit_edge
  call void @_ZNSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %30)
  %69 = load i32, ptr %24, align 8, !tbaa !26
  %.not36 = icmp eq i32 %69, 4
  br i1 %.not36, label %79, label %70

70:                                               ; preds = %68
  %71 = load ptr, ptr %39, align 8, !tbaa !49
  %72 = invoke noundef double @_ZN3sim13MazeInterface9getRandomEv(ptr noundef nonnull align 8 dereferenceable(8) %71)
          to label %73 unwind label %77

73:                                               ; preds = %70
  %74 = fcmp ugt double %72, %40
  br i1 %74, label %79, label %75

75:                                               ; preds = %73
  invoke void @_ZN6tomasz19TomaszMazeGenerator23updateDistanceFromStartEii(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %45, i32 noundef %46)
          to label %76 unwind label %77

76:                                               ; preds = %75
  invoke void @_ZN6tomasz19TomaszMazeGenerator17breakGradientWallEii(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %45, i32 noundef %46)
          to label %79 unwind label %77

77:                                               ; preds = %76, %75, %70
  %78 = landingpad { ptr, i32 }
          cleanup
  br label %132

79:                                               ; preds = %73, %76, %68
  store i32 4, ptr %24, align 8, !tbaa !26
  br label %130

80:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %19) #7
  %81 = sitofp i32 %45 to double
  %82 = load i32, ptr %22, align 8, !tbaa !5
  %83 = sitofp i32 %82 to double
  %84 = fmul double %83, 5.000000e-01
  %85 = fsub double %81, %84
  %86 = fptosi double %85 to i32
  %87 = call i32 @llvm.abs.i32(i32 %86, i1 true)
  %88 = shl nuw i32 %87, 1
  %89 = uitofp i32 %88 to double
  %90 = add nsw i32 %82, -1
  %91 = sitofp i32 %90 to double
  %92 = fdiv double %89, %91
  %93 = fptrunc double %92 to float
  store float %93, ptr %19, align 4, !tbaa !50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %20) #7
  %94 = sitofp i32 %46 to double
  %95 = load i32, ptr %23, align 4, !tbaa !25
  %96 = sitofp i32 %95 to double
  %97 = fmul double %96, 5.000000e-01
  %98 = fsub double %94, %97
  %99 = fptosi double %98 to i32
  %100 = call i32 @llvm.abs.i32(i32 %99, i1 true)
  %101 = shl nuw i32 %100, 1
  %102 = uitofp i32 %101 to double
  %103 = add nsw i32 %95, -1
  %104 = sitofp i32 %103 to double
  %105 = fdiv double %102, %104
  %106 = fptrunc double %105 to float
  store float %106, ptr %20, align 4, !tbaa !50
  %107 = load atomic i8, ptr @_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor acquire, align 8
  %108 = icmp eq i8 %107, 0
  br i1 %108, label %109, label %115, !prof !52

109:                                              ; preds = %80
  %110 = call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor) #7
  %.not = icmp eq i32 %110, 0
  br i1 %.not, label %115, label %111

111:                                              ; preds = %109
  %112 = load double, ptr %38, align 8, !tbaa !53
  %113 = fptrunc double %112 to float
  store float %113, ptr @_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor, align 4, !tbaa !50
  %114 = call ptr @llvm.invariant.start.p0(i64 4, ptr nonnull @_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor)
  call void @__cxa_guard_release(ptr nonnull @_ZGVZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor) #7
  br label %115

115:                                              ; preds = %111, %109, %80
  %116 = load float, ptr @_ZZN6tomasz19TomaszMazeGenerator12generateMazeEiiE14straightFactor, align 4, !tbaa !50
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %19, ptr noundef nonnull align 4 dereferenceable(4) %20)
  %118 = load float, ptr %117, align 4, !tbaa !50
  invoke void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEEC2ERKS8_(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 8 dereferenceable(48) %5)
          to label %119 unwind label %125

119:                                              ; preds = %115
  %120 = fmul float %116, %118
  %121 = invoke noundef i32 @_ZN6tomasz19TomaszMazeGenerator18getDirectionToMoveEfSt3mapINS_9DirectionEbSt4lessIS2_ESaISt4pairIKS2_bEEE(ptr noundef nonnull align 8 dereferenceable(160) %0, float noundef %120, ptr noundef nonnull %21)
          to label %122 unwind label %127

122:                                              ; preds = %119
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #7
  %123 = invoke noundef i32 @_ZN6tomasz19TomaszMazeGenerator19moveTowardDirectionEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %45, i32 noundef %46, i32 noundef %121)
          to label %124 unwind label %125

124:                                              ; preds = %122
  store i32 %123, ptr %24, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #7
  br label %130

125:                                              ; preds = %122, %115
  %126 = landingpad { ptr, i32 }
          cleanup
  br label %129

127:                                              ; preds = %119
  %128 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %21) #7
  br label %129

129:                                              ; preds = %127, %125
  %.pn = phi { ptr, i32 } [ %126, %125 ], [ %128, %127 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %19) #7
  br label %132

130:                                              ; preds = %124, %79
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  %131 = call noundef zeroext i1 @_ZNKSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %30)
  br i1 %131, label %._crit_edge43, label %41, !llvm.loop !54

132:                                              ; preds = %129, %77
  %.pn37 = phi { ptr, i32 } [ %78, %77 ], [ %.pn, %129 ]
  call void @_ZNSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #7
  br label %133

133:                                              ; preds = %132, %60
  %.pn37.pn = phi { ptr, i32 } [ %.pn37, %132 ], [ %61, %60 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  resume { ptr, i32 } %.pn37.pn

._crit_edge43:                                    ; preds = %130, %3
  call void @_ZN6tomasz19TomaszMazeGenerator18breakGradientWallsEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  call void @_ZN6tomasz19TomaszMazeGenerator23updateDistanceFromStartEii(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef 0, i32 noundef 0)
  call void @_ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv(ptr noundef nonnull align 8 dereferenceable(160) %0)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  ret void
}

; 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 void @_ZN6tomasz19TomaszMazeGenerator14initializeMazeEv(ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNKSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIKN6tomasz9DirectionEbEC2IS1_bTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS6_S7_EEEbE4typeELb1EEEOS6_OS7_(ptr noundef nonnull align 4 dereferenceable(5), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

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

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

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

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

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

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

declare noundef double @_ZN3sim13MazeInterface9getRandomEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #4

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #5

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

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIfERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN6tomasz19TomaszMazeGenerator19moveTowardDirectionEiiNS_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 void @_ZN6tomasz19TomaszMazeGenerator18breakGradientWallsEv(ptr noundef nonnull align 8 dereferenceable(160)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv(ptr noundef nonnull align 8 dereferenceable(160)) 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nofree nounwind }
attributes #6 = { 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 #7 = { 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 = !{!6, !24, i64 144}
!27 = !{!28, !29, i64 12}
!28 = !{!"_ZTSN6tomasz19TomaszMazeGenerator14TomMazeGenTileE", !11, i64 0, !11, i64 4, !11, i64 8, !29, i64 12, !29, i64 13, !30, i64 16}
!29 = !{!"bool", !9, i64 0}
!30 = !{!"_ZTSSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE", !31, i64 0}
!31 = !{!"_ZTSSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE", !32, i64 0}
!32 = !{!"_ZTSNSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE13_Rb_tree_implIS8_Lb1EEE", !33, i64 0, !35, i64 8}
!33 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN6tomasz9DirectionEEE", !34, i64 0}
!34 = !{!"_ZTSSt4lessIN6tomasz9DirectionEE"}
!35 = !{!"_ZTSSt15_Rb_tree_header", !36, i64 0, !22, i64 32}
!36 = !{!"_ZTSSt18_Rb_tree_node_base", !37, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!37 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!38 = !{!28, !11, i64 8}
!39 = !{!16, !16, i64 0}
!40 = !{!6, !8, i64 16}
!41 = !{!28, !11, i64 4}
!42 = !{!28, !11, i64 0}
!43 = !{!24, !24, i64 0}
!44 = !{!29, !29, i64 0}
!45 = !{!46, !29, i64 4}
!46 = !{!"_ZTSSt4pairIKN6tomasz9DirectionEbE", !24, i64 0, !29, i64 4}
!47 = !{i8 0, i8 2}
!48 = !{}
!49 = !{!6, !16, i64 152}
!50 = !{!51, !51, i64 0}
!51 = !{!"float", !9, i64 0}
!52 = !{!"branch_weights", i32 1, i32 1048575}
!53 = !{!6, !8, i64 8}
!54 = distinct !{!54, !55}
!55 = !{!"llvm.loop.mustprogress"}


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