; 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.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 }

@__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions = external hidden unnamed_addr constant [4 x i32], align 16

; 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: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv(ptr noundef nonnull align 8 dereferenceable(160) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca [4 x i32], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %15 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  %16 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %15, i32 0, i32 7
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = sitofp i32 %17 to double
  %19 = fdiv double %18, 2.000000e+00
  %20 = call double @llvm.round.f64(double %19)
  %21 = fsub double %20, 1.000000e+00
  %22 = fptosi double %21 to i32
  store i32 %22, ptr %4, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  %23 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %15, i32 0, i32 8
  %24 = load i32, ptr %23, align 4, !tbaa !27
  %25 = sitofp i32 %24 to double
  %26 = fdiv double %25, 2.000000e+00
  %27 = call double @llvm.round.f64(double %26)
  %28 = fsub double %27, 1.000000e+00
  %29 = fptosi double %28 to i32
  store i32 %29, ptr %5, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %30 = load i32, ptr %4, align 4, !tbaa !26
  store i32 %30, ptr %7, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %31 = load i32, ptr %5, align 4, !tbaa !26
  store i32 %31, ptr %8, align 4, !tbaa !26
  %32 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %15, i32 0, i32 7
  %33 = load i32, ptr %32, align 8, !tbaa !9
  %34 = srem i32 %33, 2
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %104

36:                                               ; preds = %1
  %37 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %15, i32 0, i32 8
  %38 = load i32, ptr %37, align 4, !tbaa !27
  %39 = srem i32 %38, 2
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %104

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

42:                                               ; preds = %100, %41
  %43 = load i32, ptr %9, align 4, !tbaa !26
  %44 = icmp slt i32 %43, 4
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %103

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %47 = load i32, ptr %4, align 4, !tbaa !26
  %48 = add nsw i32 %47, 1
  %49 = load i32, ptr %5, align 4, !tbaa !26
  %50 = add nsw i32 %49, 1
  %51 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %48, i32 noundef %50, i32 noundef 4)
  %52 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %51, i32 0, i32 2
  %53 = load i32, ptr %52, align 8, !tbaa !28
  store i32 %53, ptr %10, align 4, !tbaa !26
  %54 = load i32, ptr %4, align 4, !tbaa !26
  %55 = add nsw i32 %54, 1
  %56 = load i32, ptr %5, align 4, !tbaa !26
  %57 = add nsw i32 %56, 1
  %58 = load i32, ptr %9, align 4, !tbaa !26
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !39
  %62 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %55, i32 noundef %57, i32 noundef %61)
  br i1 %62, label %63, label %99

63:                                               ; preds = %46
  %64 = load i32, ptr %4, align 4, !tbaa !26
  %65 = add nsw i32 %64, 1
  %66 = load i32, ptr %5, align 4, !tbaa !26
  %67 = add nsw i32 %66, 1
  %68 = load i32, ptr %9, align 4, !tbaa !26
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !39
  %72 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %65, i32 noundef %67, i32 noundef %71)
  %73 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !28
  %75 = load i32, ptr %10, align 4, !tbaa !26
  %76 = sub nsw i32 %74, %75
  %77 = call i32 @llvm.abs.i32(i32 %76, i1 true)
  %78 = load i32, ptr %6, align 4, !tbaa !26
  %79 = icmp sgt i32 %77, %78
  br i1 %79, label %80, label %99

80:                                               ; preds = %63
  %81 = load i32, ptr %4, align 4, !tbaa !26
  %82 = add nsw i32 %81, 1
  %83 = load i32, ptr %5, align 4, !tbaa !26
  %84 = add nsw i32 %83, 1
  %85 = load i32, ptr %9, align 4, !tbaa !26
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !39
  %89 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %82, i32 noundef %84, i32 noundef %88)
  %90 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %89, i32 0, i32 2
  %91 = load i32, ptr %90, align 8, !tbaa !28
  %92 = load i32, ptr %10, align 4, !tbaa !26
  %93 = sub nsw i32 %91, %92
  %94 = call i32 @llvm.abs.i32(i32 %93, i1 true)
  store i32 %94, ptr %6, align 4, !tbaa !26
  %95 = load i32, ptr %4, align 4, !tbaa !26
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %7, align 4, !tbaa !26
  %97 = load i32, ptr %5, align 4, !tbaa !26
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %8, align 4, !tbaa !26
  br label %99

99:                                               ; preds = %80, %63, %46
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %100

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

103:                                              ; preds = %45
  br label %104

104:                                              ; preds = %103, %36, %1
  %105 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %15, i32 0, i32 7
  %106 = load i32, ptr %105, align 8, !tbaa !9
  %107 = srem i32 %106, 2
  %108 = icmp eq i32 %107, 0
  br i1 %108, label %109, label %167

109:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !26
  br label %110

110:                                              ; preds = %163, %109
  %111 = load i32, ptr %11, align 4, !tbaa !26
  %112 = icmp slt i32 %111, 4
  br i1 %112, label %114, label %113

113:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %166

114:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %115 = load i32, ptr %4, align 4, !tbaa !26
  %116 = add nsw i32 %115, 1
  %117 = load i32, ptr %5, align 4, !tbaa !26
  %118 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %116, i32 noundef %117, i32 noundef 4)
  %119 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %118, i32 0, i32 2
  %120 = load i32, ptr %119, align 8, !tbaa !28
  store i32 %120, ptr %12, align 4, !tbaa !26
  %121 = load i32, ptr %4, align 4, !tbaa !26
  %122 = add nsw i32 %121, 1
  %123 = load i32, ptr %5, align 4, !tbaa !26
  %124 = load i32, ptr %11, align 4, !tbaa !26
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !39
  %128 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %122, i32 noundef %123, i32 noundef %127)
  br i1 %128, label %129, label %162

129:                                              ; preds = %114
  %130 = load i32, ptr %4, align 4, !tbaa !26
  %131 = add nsw i32 %130, 1
  %132 = load i32, ptr %5, align 4, !tbaa !26
  %133 = load i32, ptr %11, align 4, !tbaa !26
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !39
  %137 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %131, i32 noundef %132, i32 noundef %136)
  %138 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %137, i32 0, i32 2
  %139 = load i32, ptr %138, align 8, !tbaa !28
  %140 = load i32, ptr %12, align 4, !tbaa !26
  %141 = sub nsw i32 %139, %140
  %142 = call i32 @llvm.abs.i32(i32 %141, i1 true)
  %143 = load i32, ptr %6, align 4, !tbaa !26
  %144 = icmp sgt i32 %142, %143
  br i1 %144, label %145, label %162

145:                                              ; preds = %129
  %146 = load i32, ptr %4, align 4, !tbaa !26
  %147 = add nsw i32 %146, 1
  %148 = load i32, ptr %5, align 4, !tbaa !26
  %149 = load i32, ptr %11, align 4, !tbaa !26
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !39
  %153 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %147, i32 noundef %148, i32 noundef %152)
  %154 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %153, i32 0, i32 2
  %155 = load i32, ptr %154, align 8, !tbaa !28
  %156 = load i32, ptr %12, align 4, !tbaa !26
  %157 = sub nsw i32 %155, %156
  %158 = call i32 @llvm.abs.i32(i32 %157, i1 true)
  store i32 %158, ptr %6, align 4, !tbaa !26
  %159 = load i32, ptr %4, align 4, !tbaa !26
  %160 = add nsw i32 %159, 1
  store i32 %160, ptr %7, align 4, !tbaa !26
  %161 = load i32, ptr %5, align 4, !tbaa !26
  store i32 %161, ptr %8, align 4, !tbaa !26
  br label %162

162:                                              ; preds = %145, %129, %114
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %11, align 4, !tbaa !26
  %165 = add nsw i32 %164, 1
  store i32 %165, ptr %11, align 4, !tbaa !26
  br label %110, !llvm.loop !42

166:                                              ; preds = %113
  br label %167

167:                                              ; preds = %166, %104
  %168 = getelementptr inbounds %"class.tomasz::TomaszMazeGenerator", ptr %15, i32 0, i32 8
  %169 = load i32, ptr %168, align 4, !tbaa !27
  %170 = srem i32 %169, 2
  %171 = icmp eq i32 %170, 0
  br i1 %171, label %172, label %230

172:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !26
  br label %173

173:                                              ; preds = %226, %172
  %174 = load i32, ptr %13, align 4, !tbaa !26
  %175 = icmp slt i32 %174, 4
  br i1 %175, label %177, label %176

176:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %229

177:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %178 = load i32, ptr %4, align 4, !tbaa !26
  %179 = load i32, ptr %5, align 4, !tbaa !26
  %180 = add nsw i32 %179, 1
  %181 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %178, i32 noundef %180, i32 noundef 4)
  %182 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %181, i32 0, i32 2
  %183 = load i32, ptr %182, align 8, !tbaa !28
  store i32 %183, ptr %14, align 4, !tbaa !26
  %184 = load i32, ptr %4, align 4, !tbaa !26
  %185 = load i32, ptr %5, align 4, !tbaa !26
  %186 = add nsw i32 %185, 1
  %187 = load i32, ptr %13, align 4, !tbaa !26
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %188
  %190 = load i32, ptr %189, align 4, !tbaa !39
  %191 = call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %184, i32 noundef %186, i32 noundef %190)
  br i1 %191, label %192, label %225

192:                                              ; preds = %177
  %193 = load i32, ptr %4, align 4, !tbaa !26
  %194 = load i32, ptr %5, align 4, !tbaa !26
  %195 = add nsw i32 %194, 1
  %196 = load i32, ptr %13, align 4, !tbaa !26
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %197
  %199 = load i32, ptr %198, align 4, !tbaa !39
  %200 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %193, i32 noundef %195, i32 noundef %199)
  %201 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %200, i32 0, i32 2
  %202 = load i32, ptr %201, align 8, !tbaa !28
  %203 = load i32, ptr %14, align 4, !tbaa !26
  %204 = sub nsw i32 %202, %203
  %205 = call i32 @llvm.abs.i32(i32 %204, i1 true)
  %206 = load i32, ptr %6, align 4, !tbaa !26
  %207 = icmp sgt i32 %205, %206
  br i1 %207, label %208, label %225

208:                                              ; preds = %192
  %209 = load i32, ptr %4, align 4, !tbaa !26
  %210 = load i32, ptr %5, align 4, !tbaa !26
  %211 = add nsw i32 %210, 1
  %212 = load i32, ptr %13, align 4, !tbaa !26
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [4 x i32], ptr %3, i64 0, i64 %213
  %215 = load i32, ptr %214, align 4, !tbaa !39
  %216 = call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %209, i32 noundef %211, i32 noundef %215)
  %217 = getelementptr inbounds %"struct.tomasz::TomaszMazeGenerator::TomMazeGenTile", ptr %216, i32 0, i32 2
  %218 = load i32, ptr %217, align 8, !tbaa !28
  %219 = load i32, ptr %14, align 4, !tbaa !26
  %220 = sub nsw i32 %218, %219
  %221 = call i32 @llvm.abs.i32(i32 %220, i1 true)
  store i32 %221, ptr %6, align 4, !tbaa !26
  %222 = load i32, ptr %4, align 4, !tbaa !26
  store i32 %222, ptr %7, align 4, !tbaa !26
  %223 = load i32, ptr %5, align 4, !tbaa !26
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %8, align 4, !tbaa !26
  br label %225

225:                                              ; preds = %208, %192, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %226

226:                                              ; preds = %225
  %227 = load i32, ptr %13, align 4, !tbaa !26
  %228 = add nsw i32 %227, 1
  store i32 %228, ptr %13, align 4, !tbaa !26
  br label %173, !llvm.loop !43

229:                                              ; preds = %176
  br label %230

230:                                              ; preds = %229, %167
  %231 = load i32, ptr %7, align 4, !tbaa !26
  %232 = load i32, ptr %8, align 4, !tbaa !26
  call void @_ZN6tomasz19TomaszMazeGenerator17breakGradientWallEii(ptr noundef nonnull align 8 dereferenceable(160) %15, i32 noundef %231, i32 noundef %232)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.round.f64(double) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !13, i64 136}
!10 = !{!"_ZTSN6tomasz19TomaszMazeGeneratorE", !11, i64 0, !12, i64 8, !12, i64 16, !13, i64 24, !13, i64 28, !14, i64 32, !18, i64 56, !13, i64 136, !13, i64 140, !25, i64 144, !6, i64 152}
!11 = !{!"_ZTS14IMazeAlgorithm"}
!12 = !{!"double", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!"_ZTSSt6vectorIS_IN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS2_EESaIS4_EE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseISt6vectorIN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EESaIS5_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt5stackIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESt5dequeIS3_SaIS3_EEE", !19, i64 0}
!19 = !{!"_ZTSSt5dequeIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE", !20, i64 0}
!20 = !{!"_ZTSSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE", !21, i64 0}
!21 = !{!"_ZTSNSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE11_Deque_implE", !22, i64 0}
!22 = !{!"_ZTSNSt11_Deque_baseIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileESaIS3_EE16_Deque_impl_dataE", !6, i64 0, !23, i64 8, !24, i64 16, !24, i64 48}
!23 = !{!"long", !7, i64 0}
!24 = !{!"_ZTSSt15_Deque_iteratorIPN6tomasz19TomaszMazeGenerator14TomMazeGenTileERS3_PS3_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!25 = !{!"_ZTSN6tomasz9DirectionE", !7, i64 0}
!26 = !{!13, !13, i64 0}
!27 = !{!10, !13, i64 140}
!28 = !{!29, !13, i64 8}
!29 = !{!"_ZTSN6tomasz19TomaszMazeGenerator14TomMazeGenTileE", !13, i64 0, !13, i64 4, !13, i64 8, !30, i64 12, !30, i64 13, !31, i64 16}
!30 = !{!"bool", !7, i64 0}
!31 = !{!"_ZTSSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE", !32, i64 0}
!32 = !{!"_ZTSSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE", !33, i64 0}
!33 = !{!"_ZTSNSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE13_Rb_tree_implIS8_Lb1EEE", !34, i64 0, !36, i64 8}
!34 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN6tomasz9DirectionEEE", !35, i64 0}
!35 = !{!"_ZTSSt4lessIN6tomasz9DirectionEE"}
!36 = !{!"_ZTSSt15_Rb_tree_header", !37, i64 0, !23, i64 32}
!37 = !{!"_ZTSSt18_Rb_tree_node_base", !38, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!38 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!39 = !{!25, !25, i64 0}
!40 = distinct !{!40, !41}
!41 = !{!"llvm.loop.mustprogress"}
!42 = distinct !{!42, !41}
!43 = distinct !{!43, !41}


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

@__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions = external hidden unnamed_addr constant [4 x i32], align 16

; 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 #0 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 #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv(ptr noundef nonnull align 8 dereferenceable(160) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 136
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = sitofp i32 %3 to double
  %5 = fmul double %4, 5.000000e-01
  %6 = tail call double @llvm.round.f64(double %5)
  %7 = fadd double %6, -1.000000e+00
  %8 = fptosi double %7 to i32
  %9 = getelementptr inbounds i8, ptr %0, i64 140
  %10 = load i32, ptr %9, align 4, !tbaa !25
  %11 = sitofp i32 %10 to double
  %12 = fmul double %11, 5.000000e-01
  %13 = tail call double @llvm.round.f64(double %12)
  %14 = fadd double %13, -1.000000e+00
  %15 = fptosi double %14 to i32
  %16 = and i32 %3, 1
  %17 = icmp eq i32 %16, 0
  %18 = and i32 %10, 1
  %19 = icmp eq i32 %18, 0
  %or.cond = select i1 %17, i1 %19, i1 false
  br i1 %or.cond, label %.preheader81, label %.loopexit82

.preheader81:                                     ; preds = %1
  %20 = add nsw i32 %8, 1
  %21 = add nsw i32 %15, 1
  %22 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef 4)
  %23 = getelementptr inbounds i8, ptr %22, i64 8
  %24 = load i32, ptr %23, align 8, !tbaa !26
  %25 = load i32, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, align 16, !tbaa !37
  %26 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %25)
  br i1 %26, label %27, label %37

27:                                               ; preds = %.preheader81
  %28 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %25)
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load i32, ptr %29, align 8, !tbaa !26
  %.not = icmp eq i32 %30, %24
  br i1 %.not, label %37, label %31

31:                                               ; preds = %27
  %32 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %25)
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load i32, ptr %33, align 8, !tbaa !26
  %35 = sub nsw i32 %34, %24
  %36 = tail call i32 @llvm.abs.i32(i32 %35, i1 true)
  br label %37

37:                                               ; preds = %31, %27, %.preheader81
  %.169 = phi i32 [ %21, %31 ], [ %15, %27 ], [ %15, %.preheader81 ]
  %.160 = phi i32 [ %20, %31 ], [ %8, %27 ], [ %8, %.preheader81 ]
  %.1 = phi i32 [ %36, %31 ], [ 0, %27 ], [ 0, %.preheader81 ]
  %38 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef 4)
  %39 = getelementptr inbounds i8, ptr %38, i64 8
  %40 = load i32, ptr %39, align 8, !tbaa !26
  %41 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 4), align 4, !tbaa !37
  %42 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %41)
  br i1 %42, label %43, label %56

43:                                               ; preds = %37
  %44 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %41)
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load i32, ptr %45, align 8, !tbaa !26
  %47 = sub nsw i32 %46, %40
  %48 = tail call i32 @llvm.abs.i32(i32 %47, i1 true)
  %49 = icmp ugt i32 %48, %.1
  br i1 %49, label %50, label %56

50:                                               ; preds = %43
  %51 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %41)
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load i32, ptr %52, align 8, !tbaa !26
  %54 = sub nsw i32 %53, %40
  %55 = tail call i32 @llvm.abs.i32(i32 %54, i1 true)
  br label %56

56:                                               ; preds = %50, %43, %37
  %.169.1 = phi i32 [ %21, %50 ], [ %.169, %43 ], [ %.169, %37 ]
  %.160.1 = phi i32 [ %20, %50 ], [ %.160, %43 ], [ %.160, %37 ]
  %.1.1 = phi i32 [ %55, %50 ], [ %.1, %43 ], [ %.1, %37 ]
  %57 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef 4)
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = load i32, ptr %58, align 8, !tbaa !26
  %60 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 8), align 8, !tbaa !37
  %61 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %60)
  br i1 %61, label %62, label %75

62:                                               ; preds = %56
  %63 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %60)
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load i32, ptr %64, align 8, !tbaa !26
  %66 = sub nsw i32 %65, %59
  %67 = tail call i32 @llvm.abs.i32(i32 %66, i1 true)
  %68 = icmp ugt i32 %67, %.1.1
  br i1 %68, label %69, label %75

69:                                               ; preds = %62
  %70 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %60)
  %71 = getelementptr inbounds i8, ptr %70, i64 8
  %72 = load i32, ptr %71, align 8, !tbaa !26
  %73 = sub nsw i32 %72, %59
  %74 = tail call i32 @llvm.abs.i32(i32 %73, i1 true)
  br label %75

75:                                               ; preds = %69, %62, %56
  %.169.2 = phi i32 [ %21, %69 ], [ %.169.1, %62 ], [ %.169.1, %56 ]
  %.160.2 = phi i32 [ %20, %69 ], [ %.160.1, %62 ], [ %.160.1, %56 ]
  %.1.2 = phi i32 [ %74, %69 ], [ %.1.1, %62 ], [ %.1.1, %56 ]
  %76 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef 4)
  %77 = getelementptr inbounds i8, ptr %76, i64 8
  %78 = load i32, ptr %77, align 8, !tbaa !26
  %79 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 12), align 4, !tbaa !37
  %80 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %79)
  br i1 %80, label %81, label %.loopexit82.loopexit

81:                                               ; preds = %75
  %82 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %79)
  %83 = getelementptr inbounds i8, ptr %82, i64 8
  %84 = load i32, ptr %83, align 8, !tbaa !26
  %85 = sub nsw i32 %84, %78
  %86 = tail call i32 @llvm.abs.i32(i32 %85, i1 true)
  %87 = icmp ugt i32 %86, %.1.2
  br i1 %87, label %88, label %.loopexit82.loopexit

88:                                               ; preds = %81
  %89 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %20, i32 noundef %21, i32 noundef %79)
  %90 = getelementptr inbounds i8, ptr %89, i64 8
  %91 = load i32, ptr %90, align 8, !tbaa !26
  %92 = sub nsw i32 %91, %78
  %93 = tail call i32 @llvm.abs.i32(i32 %92, i1 true)
  br label %.loopexit82.loopexit

.loopexit82.loopexit:                             ; preds = %88, %81, %75
  %.169.3 = phi i32 [ %21, %88 ], [ %.169.2, %81 ], [ %.169.2, %75 ]
  %.160.3 = phi i32 [ %20, %88 ], [ %.160.2, %81 ], [ %.160.2, %75 ]
  %.1.3 = phi i32 [ %93, %88 ], [ %.1.2, %81 ], [ %.1.2, %75 ]
  %.pre = load i32, ptr %2, align 8, !tbaa !5
  br label %.loopexit82

.loopexit82:                                      ; preds = %.loopexit82.loopexit, %1
  %94 = phi i32 [ %3, %1 ], [ %.pre, %.loopexit82.loopexit ]
  %.270 = phi i32 [ %15, %1 ], [ %.169.3, %.loopexit82.loopexit ]
  %.261 = phi i32 [ %8, %1 ], [ %.160.3, %.loopexit82.loopexit ]
  %.2 = phi i32 [ 0, %1 ], [ %.1.3, %.loopexit82.loopexit ]
  %95 = and i32 %94, 1
  %96 = icmp eq i32 %95, 0
  br i1 %96, label %.preheader79, label %.loopexit80

.preheader79:                                     ; preds = %.loopexit82
  %97 = add nsw i32 %8, 1
  %98 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef 4)
  %99 = getelementptr inbounds i8, ptr %98, i64 8
  %100 = load i32, ptr %99, align 8, !tbaa !26
  %101 = load i32, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, align 16, !tbaa !37
  %102 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %101)
  br i1 %102, label %103, label %116

103:                                              ; preds = %.preheader79
  %104 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %101)
  %105 = getelementptr inbounds i8, ptr %104, i64 8
  %106 = load i32, ptr %105, align 8, !tbaa !26
  %107 = sub nsw i32 %106, %100
  %108 = tail call i32 @llvm.abs.i32(i32 %107, i1 true)
  %109 = icmp ugt i32 %108, %.2
  br i1 %109, label %110, label %116

110:                                              ; preds = %103
  %111 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %101)
  %112 = getelementptr inbounds i8, ptr %111, i64 8
  %113 = load i32, ptr %112, align 8, !tbaa !26
  %114 = sub nsw i32 %113, %100
  %115 = tail call i32 @llvm.abs.i32(i32 %114, i1 true)
  br label %116

116:                                              ; preds = %110, %103, %.preheader79
  %.472 = phi i32 [ %15, %110 ], [ %.270, %103 ], [ %.270, %.preheader79 ]
  %.463 = phi i32 [ %97, %110 ], [ %.261, %103 ], [ %.261, %.preheader79 ]
  %.4 = phi i32 [ %115, %110 ], [ %.2, %103 ], [ %.2, %.preheader79 ]
  %117 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef 4)
  %118 = getelementptr inbounds i8, ptr %117, i64 8
  %119 = load i32, ptr %118, align 8, !tbaa !26
  %120 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 4), align 4, !tbaa !37
  %121 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %120)
  br i1 %121, label %122, label %135

122:                                              ; preds = %116
  %123 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %120)
  %124 = getelementptr inbounds i8, ptr %123, i64 8
  %125 = load i32, ptr %124, align 8, !tbaa !26
  %126 = sub nsw i32 %125, %119
  %127 = tail call i32 @llvm.abs.i32(i32 %126, i1 true)
  %128 = icmp ugt i32 %127, %.4
  br i1 %128, label %129, label %135

129:                                              ; preds = %122
  %130 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %120)
  %131 = getelementptr inbounds i8, ptr %130, i64 8
  %132 = load i32, ptr %131, align 8, !tbaa !26
  %133 = sub nsw i32 %132, %119
  %134 = tail call i32 @llvm.abs.i32(i32 %133, i1 true)
  br label %135

135:                                              ; preds = %129, %122, %116
  %.472.1 = phi i32 [ %15, %129 ], [ %.472, %122 ], [ %.472, %116 ]
  %.463.1 = phi i32 [ %97, %129 ], [ %.463, %122 ], [ %.463, %116 ]
  %.4.1 = phi i32 [ %134, %129 ], [ %.4, %122 ], [ %.4, %116 ]
  %136 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef 4)
  %137 = getelementptr inbounds i8, ptr %136, i64 8
  %138 = load i32, ptr %137, align 8, !tbaa !26
  %139 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 8), align 8, !tbaa !37
  %140 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %139)
  br i1 %140, label %141, label %154

141:                                              ; preds = %135
  %142 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %139)
  %143 = getelementptr inbounds i8, ptr %142, i64 8
  %144 = load i32, ptr %143, align 8, !tbaa !26
  %145 = sub nsw i32 %144, %138
  %146 = tail call i32 @llvm.abs.i32(i32 %145, i1 true)
  %147 = icmp ugt i32 %146, %.4.1
  br i1 %147, label %148, label %154

148:                                              ; preds = %141
  %149 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %139)
  %150 = getelementptr inbounds i8, ptr %149, i64 8
  %151 = load i32, ptr %150, align 8, !tbaa !26
  %152 = sub nsw i32 %151, %138
  %153 = tail call i32 @llvm.abs.i32(i32 %152, i1 true)
  br label %154

154:                                              ; preds = %148, %141, %135
  %.472.2 = phi i32 [ %15, %148 ], [ %.472.1, %141 ], [ %.472.1, %135 ]
  %.463.2 = phi i32 [ %97, %148 ], [ %.463.1, %141 ], [ %.463.1, %135 ]
  %.4.2 = phi i32 [ %153, %148 ], [ %.4.1, %141 ], [ %.4.1, %135 ]
  %155 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef 4)
  %156 = getelementptr inbounds i8, ptr %155, i64 8
  %157 = load i32, ptr %156, align 8, !tbaa !26
  %158 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 12), align 4, !tbaa !37
  %159 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %158)
  br i1 %159, label %160, label %.loopexit80

160:                                              ; preds = %154
  %161 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %158)
  %162 = getelementptr inbounds i8, ptr %161, i64 8
  %163 = load i32, ptr %162, align 8, !tbaa !26
  %164 = sub nsw i32 %163, %157
  %165 = tail call i32 @llvm.abs.i32(i32 %164, i1 true)
  %166 = icmp ugt i32 %165, %.4.2
  br i1 %166, label %167, label %.loopexit80

167:                                              ; preds = %160
  %168 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %97, i32 noundef %15, i32 noundef %158)
  %169 = getelementptr inbounds i8, ptr %168, i64 8
  %170 = load i32, ptr %169, align 8, !tbaa !26
  %171 = sub nsw i32 %170, %157
  %172 = tail call i32 @llvm.abs.i32(i32 %171, i1 true)
  br label %.loopexit80

.loopexit80:                                      ; preds = %154, %160, %167, %.loopexit82
  %.573 = phi i32 [ %.270, %.loopexit82 ], [ %15, %167 ], [ %.472.2, %160 ], [ %.472.2, %154 ]
  %.564 = phi i32 [ %.261, %.loopexit82 ], [ %97, %167 ], [ %.463.2, %160 ], [ %.463.2, %154 ]
  %.5 = phi i32 [ %.2, %.loopexit82 ], [ %172, %167 ], [ %.4.2, %160 ], [ %.4.2, %154 ]
  %173 = load i32, ptr %9, align 4, !tbaa !25
  %174 = and i32 %173, 1
  %175 = icmp eq i32 %174, 0
  br i1 %175, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %.loopexit80
  %176 = add nsw i32 %15, 1
  %177 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef 4)
  %178 = getelementptr inbounds i8, ptr %177, i64 8
  %179 = load i32, ptr %178, align 8, !tbaa !26
  %180 = load i32, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, align 16, !tbaa !37
  %181 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %180)
  br i1 %181, label %182, label %195

182:                                              ; preds = %.preheader
  %183 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %180)
  %184 = getelementptr inbounds i8, ptr %183, i64 8
  %185 = load i32, ptr %184, align 8, !tbaa !26
  %186 = sub nsw i32 %185, %179
  %187 = tail call i32 @llvm.abs.i32(i32 %186, i1 true)
  %188 = icmp ugt i32 %187, %.5
  br i1 %188, label %189, label %195

189:                                              ; preds = %182
  %190 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %180)
  %191 = getelementptr inbounds i8, ptr %190, i64 8
  %192 = load i32, ptr %191, align 8, !tbaa !26
  %193 = sub nsw i32 %192, %179
  %194 = tail call i32 @llvm.abs.i32(i32 %193, i1 true)
  br label %195

195:                                              ; preds = %189, %182, %.preheader
  %.775 = phi i32 [ %176, %189 ], [ %.573, %182 ], [ %.573, %.preheader ]
  %.766 = phi i32 [ %8, %189 ], [ %.564, %182 ], [ %.564, %.preheader ]
  %.7 = phi i32 [ %194, %189 ], [ %.5, %182 ], [ %.5, %.preheader ]
  %196 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef 4)
  %197 = getelementptr inbounds i8, ptr %196, i64 8
  %198 = load i32, ptr %197, align 8, !tbaa !26
  %199 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 4), align 4, !tbaa !37
  %200 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %199)
  br i1 %200, label %201, label %214

201:                                              ; preds = %195
  %202 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %199)
  %203 = getelementptr inbounds i8, ptr %202, i64 8
  %204 = load i32, ptr %203, align 8, !tbaa !26
  %205 = sub nsw i32 %204, %198
  %206 = tail call i32 @llvm.abs.i32(i32 %205, i1 true)
  %207 = icmp ugt i32 %206, %.7
  br i1 %207, label %208, label %214

208:                                              ; preds = %201
  %209 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %199)
  %210 = getelementptr inbounds i8, ptr %209, i64 8
  %211 = load i32, ptr %210, align 8, !tbaa !26
  %212 = sub nsw i32 %211, %198
  %213 = tail call i32 @llvm.abs.i32(i32 %212, i1 true)
  br label %214

214:                                              ; preds = %208, %201, %195
  %.775.1 = phi i32 [ %176, %208 ], [ %.775, %201 ], [ %.775, %195 ]
  %.766.1 = phi i32 [ %8, %208 ], [ %.766, %201 ], [ %.766, %195 ]
  %.7.1 = phi i32 [ %213, %208 ], [ %.7, %201 ], [ %.7, %195 ]
  %215 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef 4)
  %216 = getelementptr inbounds i8, ptr %215, i64 8
  %217 = load i32, ptr %216, align 8, !tbaa !26
  %218 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 8), align 8, !tbaa !37
  %219 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %218)
  br i1 %219, label %220, label %233

220:                                              ; preds = %214
  %221 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %218)
  %222 = getelementptr inbounds i8, ptr %221, i64 8
  %223 = load i32, ptr %222, align 8, !tbaa !26
  %224 = sub nsw i32 %223, %217
  %225 = tail call i32 @llvm.abs.i32(i32 %224, i1 true)
  %226 = icmp ugt i32 %225, %.7.1
  br i1 %226, label %227, label %233

227:                                              ; preds = %220
  %228 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %218)
  %229 = getelementptr inbounds i8, ptr %228, i64 8
  %230 = load i32, ptr %229, align 8, !tbaa !26
  %231 = sub nsw i32 %230, %217
  %232 = tail call i32 @llvm.abs.i32(i32 %231, i1 true)
  br label %233

233:                                              ; preds = %227, %220, %214
  %.775.2 = phi i32 [ %176, %227 ], [ %.775.1, %220 ], [ %.775.1, %214 ]
  %.766.2 = phi i32 [ %8, %227 ], [ %.766.1, %220 ], [ %.766.1, %214 ]
  %.7.2 = phi i32 [ %232, %227 ], [ %.7.1, %220 ], [ %.7.1, %214 ]
  %234 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef 4)
  %235 = getelementptr inbounds i8, ptr %234, i64 8
  %236 = load i32, ptr %235, align 8, !tbaa !26
  %237 = load i32, ptr getelementptr inbounds (i8, ptr @__const._ZN6tomasz19TomaszMazeGenerator14pathIntoCenterEv.directions, i64 12), align 4, !tbaa !37
  %238 = tail call noundef zeroext i1 @_ZN6tomasz19TomaszMazeGenerator19isValidExploredTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %237)
  br i1 %238, label %239, label %.loopexit

239:                                              ; preds = %233
  %240 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %237)
  %241 = getelementptr inbounds i8, ptr %240, i64 8
  %242 = load i32, ptr %241, align 8, !tbaa !26
  %243 = sub nsw i32 %242, %236
  %244 = tail call i32 @llvm.abs.i32(i32 %243, i1 true)
  %245 = icmp ugt i32 %244, %.7.2
  br i1 %245, label %246, label %.loopexit

246:                                              ; preds = %239
  %247 = tail call noundef ptr @_ZN6tomasz19TomaszMazeGenerator7getTileEiiNS_9DirectionE(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %8, i32 noundef %176, i32 noundef %237)
  br label %.loopexit

.loopexit:                                        ; preds = %233, %239, %246, %.loopexit80
  %.876 = phi i32 [ %.573, %.loopexit80 ], [ %176, %246 ], [ %.775.2, %239 ], [ %.775.2, %233 ]
  %.8 = phi i32 [ %.564, %.loopexit80 ], [ %8, %246 ], [ %.766.2, %239 ], [ %.766.2, %233 ]
  tail call void @_ZN6tomasz19TomaszMazeGenerator17breakGradientWallEii(ptr noundef nonnull align 8 dereferenceable(160) %0, i32 noundef %.8, i32 noundef %.876)
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.round.f64(double) #1

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }

!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 = !{!27, !11, i64 8}
!27 = !{!"_ZTSN6tomasz19TomaszMazeGenerator14TomMazeGenTileE", !11, i64 0, !11, i64 4, !11, i64 8, !28, i64 12, !28, i64 13, !29, i64 16}
!28 = !{!"bool", !9, i64 0}
!29 = !{!"_ZTSSt3mapIN6tomasz9DirectionEbSt4lessIS1_ESaISt4pairIKS1_bEEE", !30, i64 0}
!30 = !{!"_ZTSSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE", !31, i64 0}
!31 = !{!"_ZTSNSt8_Rb_treeIN6tomasz9DirectionESt4pairIKS1_bESt10_Select1stIS4_ESt4lessIS1_ESaIS4_EE13_Rb_tree_implIS8_Lb1EEE", !32, i64 0, !34, i64 8}
!32 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIN6tomasz9DirectionEEE", !33, i64 0}
!33 = !{!"_ZTSSt4lessIN6tomasz9DirectionEE"}
!34 = !{!"_ZTSSt15_Rb_tree_header", !35, i64 0, !22, i64 32}
!35 = !{!"_ZTSSt18_Rb_tree_node_base", !36, i64 0, !16, i64 8, !16, i64 16, !16, i64 24}
!36 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!37 = !{!24, !24, i64 0}


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