; LLVM IR from openai/procgen :: procgen/src/mazegen.ll (ZN7MazeGen13generate_mazeEv)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl" }
%"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl" = type { %"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%struct.Wall = type { i32, i32, i32, i32 }
%"class.__gnu_cxx::__normal_iterator.14" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.13" = type { ptr }
%class.MazeGen = type { %class.Grid, ptr, i32, i32, i32, %"class.std::vector.0", %"class.std::vector", %"class.std::set", %"class.std::vector" }
%class.Grid = type { i32, i32, %"class.std::vector" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::set<int>, std::allocator<std::set<int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::set<int>, std::allocator<std::set<int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::set<int>, std::allocator<std::set<int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::set<int>, std::allocator<std::set<int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, int, std::_Identity<int>, std::less<int>>::_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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7MazeGen6lookupEii(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef, i32 noundef) #0 align 2

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

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7MazeGen13generate_mazeEv(ptr noundef nonnull align 8 dereferenceable(176) %0) #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca %"class.std::vector.8", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.Wall, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca %struct.Wall, align 4
  %21 = alloca i32, align 4
  %22 = alloca %struct.Wall, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca i8, align 1
  %30 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca %"struct.std::pair", align 8
  %33 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %34 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %35 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %36 = alloca %"class.__gnu_cxx::__normal_iterator.14", align 8
  %37 = alloca %"class.__gnu_cxx::__normal_iterator.13", align 8
  %38 = alloca %"class.__gnu_cxx::__normal_iterator.13", align 8
  %39 = alloca %"class.__gnu_cxx::__normal_iterator.13", align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %40 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %41

41:                                               ; preds = %62, %1
  %42 = load i32, ptr %3, align 4, !tbaa !9
  %43 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 3
  %44 = load i32, ptr %43, align 4, !tbaa !11
  %45 = icmp slt i32 %42, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %41
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %65

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

48:                                               ; preds = %58, %47
  %49 = load i32, ptr %5, align 4, !tbaa !9
  %50 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 3
  %51 = load i32, ptr %50, align 4, !tbaa !11
  %52 = icmp slt i32 %49, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  store i32 5, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  br label %61

54:                                               ; preds = %48
  %55 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 0
  %56 = load i32, ptr %3, align 4, !tbaa !9
  %57 = load i32, ptr %5, align 4, !tbaa !9
  call void @_ZN4GridIiE3setEiii(ptr noundef nonnull align 8 dereferenceable(32) %55, i32 noundef %56, i32 noundef %57, i32 noundef 51)
  br label %58

58:                                               ; preds = %54
  %59 = load i32, ptr %5, align 4, !tbaa !9
  %60 = add nsw i32 %59, 1
  store i32 %60, ptr %5, align 4, !tbaa !9
  br label %48, !llvm.loop !31

61:                                               ; preds = %53
  br label %62

62:                                               ; preds = %61
  %63 = load i32, ptr %3, align 4, !tbaa !9
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %3, align 4, !tbaa !9
  br label %41, !llvm.loop !33

65:                                               ; preds = %46
  %66 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 0
  call void @_ZN4GridIiE3setEiii(ptr noundef nonnull align 8 dereferenceable(32) %66, i32 noundef 1, i32 noundef 1, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #5
  call void @_ZNSt6vectorI4WallSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %67 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 4
  store i32 0, ptr %67, align 8, !tbaa !34
  %68 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 7
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %68) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %69 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 5
  %70 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef 0) #5
  store ptr %70, ptr %7, align 8, !tbaa !5
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %71) #5
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  %73 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %72, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %74 unwind label %90

74:                                               ; preds = %65
  %75 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 0
  %76 = extractvalue { ptr, i8 } %73, 0
  store ptr %76, ptr %75, align 8
  %77 = getelementptr inbounds { ptr, i8 }, ptr %11, i32 0, i32 1
  %78 = extractvalue { ptr, i8 } %73, 1
  store i8 %78, ptr %77, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %79 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 6
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef 0) #5
  store i32 0, ptr %80, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !9
  br label %81

81:                                               ; preds = %112, %74
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %84 = load i32, ptr %83, align 8, !tbaa !35
  %85 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %86 = load i32, ptr %85, align 8, !tbaa !35
  %87 = mul nsw i32 %84, %86
  %88 = icmp slt i32 %82, %87
  br i1 %88, label %94, label %89

89:                                               ; preds = %81
  store i32 8, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %119

90:                                               ; preds = %65
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %9, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %358

94:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %95 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 5
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = sext i32 %96 to i64
  %98 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %95, i64 noundef %97) #5
  store ptr %98, ptr %13, align 8, !tbaa !5
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %99) #5
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %100, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %102 unwind label %115

102:                                              ; preds = %94
  %103 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 0
  %104 = extractvalue { ptr, i8 } %101, 0
  store ptr %104, ptr %103, align 8
  %105 = getelementptr inbounds { ptr, i8 }, ptr %14, i32 0, i32 1
  %106 = extractvalue { ptr, i8 } %101, 1
  store i8 %106, ptr %105, align 8
  %107 = load i32, ptr %12, align 4, !tbaa !9
  %108 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 6
  %109 = load i32, ptr %12, align 4, !tbaa !9
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %108, i64 noundef %110) #5
  store i32 %107, ptr %111, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %112

112:                                              ; preds = %102
  %113 = load i32, ptr %12, align 4, !tbaa !9
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %12, align 4, !tbaa !9
  br label %81, !llvm.loop !36

115:                                              ; preds = %94
  %116 = landingpad { ptr, i32 }
          cleanup
  %117 = extractvalue { ptr, i32 } %116, 0
  store ptr %117, ptr %9, align 8
  %118 = extractvalue { ptr, i32 } %116, 1
  store i32 %118, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %358

119:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %120

120:                                              ; preds = %163, %119
  %121 = load i32, ptr %15, align 4, !tbaa !9
  %122 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %123 = load i32, ptr %122, align 8, !tbaa !35
  %124 = icmp slt i32 %121, %123
  br i1 %124, label %126, label %125

125:                                              ; preds = %120
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %166

126:                                              ; preds = %120
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %159, %126
  %128 = load i32, ptr %16, align 4, !tbaa !9
  %129 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %130 = load i32, ptr %129, align 8, !tbaa !35
  %131 = icmp slt i32 %128, %130
  br i1 %131, label %133, label %132

132:                                              ; preds = %127
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %162

133:                                              ; preds = %127
  %134 = load i32, ptr %15, align 4, !tbaa !9
  %135 = icmp sgt i32 %134, 0
  br i1 %135, label %136, label %158

136:                                              ; preds = %133
  %137 = load i32, ptr %15, align 4, !tbaa !9
  %138 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %139 = load i32, ptr %138, align 8, !tbaa !35
  %140 = sub nsw i32 %139, 1
  %141 = icmp slt i32 %137, %140
  br i1 %141, label %142, label %158

142:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #5
  %143 = getelementptr inbounds %struct.Wall, ptr %17, i32 0, i32 0
  %144 = load i32, ptr %15, align 4, !tbaa !9
  %145 = sub nsw i32 %144, 1
  store i32 %145, ptr %143, align 4, !tbaa !37
  %146 = getelementptr inbounds %struct.Wall, ptr %17, i32 0, i32 1
  %147 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %147, ptr %146, align 4, !tbaa !39
  %148 = getelementptr inbounds %struct.Wall, ptr %17, i32 0, i32 2
  %149 = load i32, ptr %15, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %148, align 4, !tbaa !40
  %151 = getelementptr inbounds %struct.Wall, ptr %17, i32 0, i32 3
  %152 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %152, ptr %151, align 4, !tbaa !41
  invoke void @_ZNSt6vectorI4WallSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(16) %17)
          to label %153 unwind label %154

153:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  br label %158

154:                                              ; preds = %142
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %9, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %358

158:                                              ; preds = %153, %136, %133
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %16, align 4, !tbaa !9
  %161 = add nsw i32 %160, 2
  store i32 %161, ptr %16, align 4, !tbaa !9
  br label %127, !llvm.loop !42

162:                                              ; preds = %132
  br label %163

163:                                              ; preds = %162
  %164 = load i32, ptr %15, align 4, !tbaa !9
  %165 = add nsw i32 %164, 2
  store i32 %165, ptr %15, align 4, !tbaa !9
  br label %120, !llvm.loop !43

166:                                              ; preds = %125
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %167

167:                                              ; preds = %210, %166
  %168 = load i32, ptr %18, align 4, !tbaa !9
  %169 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %170 = load i32, ptr %169, align 8, !tbaa !35
  %171 = icmp slt i32 %168, %170
  br i1 %171, label %173, label %172

172:                                              ; preds = %167
  store i32 17, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %213

173:                                              ; preds = %167
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 1, ptr %19, align 4, !tbaa !9
  br label %174

174:                                              ; preds = %206, %173
  %175 = load i32, ptr %19, align 4, !tbaa !9
  %176 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %177 = load i32, ptr %176, align 8, !tbaa !35
  %178 = icmp slt i32 %175, %177
  br i1 %178, label %180, label %179

179:                                              ; preds = %174
  store i32 20, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %209

180:                                              ; preds = %174
  %181 = load i32, ptr %19, align 4, !tbaa !9
  %182 = icmp sgt i32 %181, 0
  br i1 %182, label %183, label %205

183:                                              ; preds = %180
  %184 = load i32, ptr %19, align 4, !tbaa !9
  %185 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %186 = load i32, ptr %185, align 8, !tbaa !35
  %187 = sub nsw i32 %186, 1
  %188 = icmp slt i32 %184, %187
  br i1 %188, label %189, label %205

189:                                              ; preds = %183
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #5
  %190 = getelementptr inbounds %struct.Wall, ptr %20, i32 0, i32 0
  %191 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %191, ptr %190, align 4, !tbaa !37
  %192 = getelementptr inbounds %struct.Wall, ptr %20, i32 0, i32 1
  %193 = load i32, ptr %19, align 4, !tbaa !9
  %194 = sub nsw i32 %193, 1
  store i32 %194, ptr %192, align 4, !tbaa !39
  %195 = getelementptr inbounds %struct.Wall, ptr %20, i32 0, i32 2
  %196 = load i32, ptr %18, align 4, !tbaa !9
  store i32 %196, ptr %195, align 4, !tbaa !40
  %197 = getelementptr inbounds %struct.Wall, ptr %20, i32 0, i32 3
  %198 = load i32, ptr %19, align 4, !tbaa !9
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %197, align 4, !tbaa !41
  invoke void @_ZNSt6vectorI4WallSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(16) %20)
          to label %200 unwind label %201

200:                                              ; preds = %189
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  br label %205

201:                                              ; preds = %189
  %202 = landingpad { ptr, i32 }
          cleanup
  %203 = extractvalue { ptr, i32 } %202, 0
  store ptr %203, ptr %9, align 8
  %204 = extractvalue { ptr, i32 } %202, 1
  store i32 %204, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %358

205:                                              ; preds = %200, %183, %180
  br label %206

206:                                              ; preds = %205
  %207 = load i32, ptr %19, align 4, !tbaa !9
  %208 = add nsw i32 %207, 2
  store i32 %208, ptr %19, align 4, !tbaa !9
  br label %174, !llvm.loop !44

209:                                              ; preds = %179
  br label %210

210:                                              ; preds = %209
  %211 = load i32, ptr %18, align 4, !tbaa !9
  %212 = add nsw i32 %211, 2
  store i32 %212, ptr %18, align 4, !tbaa !9
  br label %167, !llvm.loop !45

213:                                              ; preds = %172
  br label %214

214:                                              ; preds = %349, %213
  %215 = call noundef i64 @_ZNKSt6vectorI4WallSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %216 = icmp ugt i64 %215, 0
  br i1 %216, label %217, label %357

217:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %218 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 1
  %219 = load ptr, ptr %218, align 8, !tbaa !46
  %220 = call noundef i64 @_ZNKSt6vectorI4WallSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %221 = trunc i64 %220 to i32
  %222 = invoke noundef i32 @_ZN7RandGen5randnEi(ptr noundef nonnull align 8 dereferenceable(5001) %219, i32 noundef %221)
          to label %223 unwind label %330

223:                                              ; preds = %217
  store i32 %222, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #5
  %224 = load i32, ptr %21, align 4, !tbaa !9
  %225 = sext i32 %224 to i64
  %226 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI4WallSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %225) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %226, i64 16, i1 false), !tbaa.struct !47
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %227 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 0
  %228 = load i32, ptr %227, align 4, !tbaa !37
  %229 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 1
  %230 = load i32, ptr %229, align 4, !tbaa !39
  %231 = call noundef i32 @_ZN7MazeGen6lookupEii(ptr noundef nonnull align 8 dereferenceable(176) %40, i32 noundef %228, i32 noundef %230)
  store i32 %231, ptr %23, align 4, !tbaa !9
  %232 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 5
  %233 = load i32, ptr %23, align 4, !tbaa !9
  %234 = sext i32 %233 to i64
  %235 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %232, i64 noundef %234) #5
  store ptr %235, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %236 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 2
  %237 = load i32, ptr %236, align 4, !tbaa !40
  %238 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 3
  %239 = load i32, ptr %238, align 4, !tbaa !41
  %240 = call noundef i32 @_ZN7MazeGen6lookupEii(ptr noundef nonnull align 8 dereferenceable(176) %40, i32 noundef %237, i32 noundef %239)
  store i32 %240, ptr %24, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %241 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 5
  %242 = load i32, ptr %24, align 4, !tbaa !9
  %243 = sext i32 %242 to i64
  %244 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %241, i64 noundef %243) #5
  store ptr %244, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %245 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 0
  %246 = load i32, ptr %245, align 4, !tbaa !37
  %247 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 2
  %248 = load i32, ptr %247, align 4, !tbaa !40
  %249 = add nsw i32 %246, %248
  %250 = sdiv i32 %249, 2
  store i32 %250, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %251 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 1
  %252 = load i32, ptr %251, align 4, !tbaa !39
  %253 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 3
  %254 = load i32, ptr %253, align 4, !tbaa !41
  %255 = add nsw i32 %252, %254
  %256 = sdiv i32 %255, 2
  store i32 %256, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  %257 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 2
  %258 = load i32, ptr %257, align 8, !tbaa !35
  %259 = load i32, ptr %27, align 4, !tbaa !9
  %260 = mul nsw i32 %258, %259
  %261 = load i32, ptr %26, align 4, !tbaa !9
  %262 = add nsw i32 %260, %261
  store i32 %262, ptr %28, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #5
  %263 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 0
  %264 = load i32, ptr %26, align 4, !tbaa !9
  %265 = add nsw i32 %264, 1
  %266 = load i32, ptr %27, align 4, !tbaa !9
  %267 = add nsw i32 %266, 1
  %268 = invoke noundef i32 @_ZNK4GridIiE3getEii(ptr noundef nonnull align 8 dereferenceable(32) %263, i32 noundef %265, i32 noundef %267)
          to label %269 unwind label %334

269:                                              ; preds = %223
  %270 = icmp eq i32 %268, 51
  br i1 %270, label %271, label %275

271:                                              ; preds = %269
  %272 = load i32, ptr %23, align 4, !tbaa !9
  %273 = load i32, ptr %24, align 4, !tbaa !9
  %274 = icmp ne i32 %272, %273
  br label %275

275:                                              ; preds = %271, %269
  %276 = phi i1 [ false, %269 ], [ %274, %271 ]
  %277 = zext i1 %276 to i8
  store i8 %277, ptr %29, align 1, !tbaa !48
  %278 = load i8, ptr %29, align 1, !tbaa !48, !range !50, !noundef !51
  %279 = trunc i8 %278 to i1
  br i1 %279, label %280, label %339

280:                                              ; preds = %275
  %281 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 0
  %282 = load i32, ptr %281, align 4, !tbaa !37
  %283 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 1
  %284 = load i32, ptr %283, align 4, !tbaa !39
  invoke void @_ZN7MazeGen13set_free_cellEii(ptr noundef nonnull align 8 dereferenceable(176) %40, i32 noundef %282, i32 noundef %284)
          to label %285 unwind label %334

285:                                              ; preds = %280
  %286 = load i32, ptr %26, align 4, !tbaa !9
  %287 = load i32, ptr %27, align 4, !tbaa !9
  invoke void @_ZN7MazeGen13set_free_cellEii(ptr noundef nonnull align 8 dereferenceable(176) %40, i32 noundef %286, i32 noundef %287)
          to label %288 unwind label %334

288:                                              ; preds = %285
  %289 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 2
  %290 = load i32, ptr %289, align 4, !tbaa !40
  %291 = getelementptr inbounds %struct.Wall, ptr %22, i32 0, i32 3
  %292 = load i32, ptr %291, align 4, !tbaa !41
  invoke void @_ZN7MazeGen13set_free_cellEii(ptr noundef nonnull align 8 dereferenceable(176) %40, i32 noundef %290, i32 noundef %292)
          to label %293 unwind label %334

293:                                              ; preds = %288
  %294 = load ptr, ptr %25, align 8, !tbaa !5
  %295 = load ptr, ptr %7, align 8, !tbaa !5
  %296 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %295) #5
  %297 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  store ptr %296, ptr %297, align 8
  %298 = load ptr, ptr %7, align 8, !tbaa !5
  %299 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %298) #5
  %300 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %299, ptr %300, align 8
  %301 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  %302 = load ptr, ptr %301, align 8
  %303 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  %304 = load ptr, ptr %303, align 8
  invoke void @_ZNSt3setIiSt4lessIiESaIiEE6insertISt23_Rb_tree_const_iteratorIiEEEvT_S7_(ptr noundef nonnull align 8 dereferenceable(48) %294, ptr %302, ptr %304)
          to label %305 unwind label %334

305:                                              ; preds = %293
  %306 = load ptr, ptr %25, align 8, !tbaa !5
  %307 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %306, ptr noundef nonnull align 4 dereferenceable(4) %28)
          to label %308 unwind label %334

308:                                              ; preds = %305
  %309 = getelementptr inbounds { ptr, i8 }, ptr %32, i32 0, i32 0
  %310 = extractvalue { ptr, i8 } %307, 0
  store ptr %310, ptr %309, align 8
  %311 = getelementptr inbounds { ptr, i8 }, ptr %32, i32 0, i32 1
  %312 = extractvalue { ptr, i8 } %307, 1
  store i8 %312, ptr %311, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #5
  call void @_ZNSt23_Rb_tree_const_iteratorIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %33) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #5
  %313 = load ptr, ptr %25, align 8, !tbaa !5
  %314 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %313) #5
  %315 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %34, i32 0, i32 0
  store ptr %314, ptr %315, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %33, ptr align 8 %34, i64 8, i1 false), !tbaa.struct !52
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #5
  br label %316

316:                                              ; preds = %328, %308
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #5
  %317 = load ptr, ptr %25, align 8, !tbaa !5
  %318 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %317) #5
  %319 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %35, i32 0, i32 0
  store ptr %318, ptr %319, align 8
  %320 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %33, ptr noundef nonnull align 8 dereferenceable(8) %35) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #5
  br i1 %320, label %321, label %338

321:                                              ; preds = %316
  %322 = load i32, ptr %24, align 4, !tbaa !9
  %323 = getelementptr inbounds %class.MazeGen, ptr %40, i32 0, i32 6
  %324 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #5
  %325 = load i32, ptr %324, align 4, !tbaa !9
  %326 = sext i32 %325 to i64
  %327 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %323, i64 noundef %326) #5
  store i32 %322, ptr %327, align 4, !tbaa !9
  br label %328

328:                                              ; preds = %321
  %329 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %33) #5
  br label %316, !llvm.loop !53

330:                                              ; preds = %217
  %331 = landingpad { ptr, i32 }
          cleanup
  %332 = extractvalue { ptr, i32 } %331, 0
  store ptr %332, ptr %9, align 8
  %333 = extractvalue { ptr, i32 } %331, 1
  store i32 %333, ptr %10, align 4
  br label %356

334:                                              ; preds = %305, %293, %288, %285, %280, %223
  %335 = landingpad { ptr, i32 }
          cleanup
  %336 = extractvalue { ptr, i32 } %335, 0
  store ptr %336, ptr %9, align 8
  %337 = extractvalue { ptr, i32 } %335, 1
  store i32 %337, ptr %10, align 4
  br label %355

338:                                              ; preds = %316
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #5
  br label %339

339:                                              ; preds = %338, %275
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #5
  %340 = call ptr @_ZNSt6vectorI4WallSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %341 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.13", ptr %38, i32 0, i32 0
  store ptr %340, ptr %341, align 8
  %342 = load i32, ptr %21, align 4, !tbaa !9
  %343 = sext i32 %342 to i64
  %344 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4WallSt6vectorIS1_SaIS1_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %38, i64 noundef %343) #5
  %345 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.13", ptr %37, i32 0, i32 0
  store ptr %344, ptr %345, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPK4WallSt6vectorIS1_SaIS1_EEEC2IPS1_vEERKNS0_IT_S6_EE(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef nonnull align 8 dereferenceable(8) %37) #5
  %346 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.14", ptr %36, i32 0, i32 0
  %347 = load ptr, ptr %346, align 8
  %348 = invoke ptr @_ZNSt6vectorI4WallSaIS0_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS0_S2_EE(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr %347)
          to label %349 unwind label %351

349:                                              ; preds = %339
  %350 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.13", ptr %39, i32 0, i32 0
  store ptr %348, ptr %350, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %214, !llvm.loop !54

351:                                              ; preds = %339
  %352 = landingpad { ptr, i32 }
          cleanup
  %353 = extractvalue { ptr, i32 } %352, 0
  store ptr %353, ptr %9, align 8
  %354 = extractvalue { ptr, i32 } %352, 1
  store i32 %354, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #5
  br label %355

355:                                              ; preds = %351, %334
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #5
  br label %356

356:                                              ; preds = %355, %330
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %358

357:                                              ; preds = %214
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt6vectorI4WallSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  ret void

358:                                              ; preds = %356, %201, %154, %115, %90
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @_ZNSt6vectorI4WallSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #5
  br label %359

359:                                              ; preds = %358
  %360 = load ptr, ptr %9, align 8
  %361 = load i32, ptr %10, align 4
  %362 = insertvalue { ptr, i32 } poison, ptr %360, 0
  %363 = insertvalue { ptr, i32 } %362, i32 %361, 1
  resume { ptr, i32 } %363
}

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

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

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

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

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

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

declare noundef i32 @_ZN7RandGen5randnEi(ptr noundef nonnull align 8 dereferenceable(5001), i32 noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI4WallSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

; 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) #4

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

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

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

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

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

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

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

attributes #0 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 44}
!12 = !{!"_ZTS7MazeGen", !13, i64 0, !6, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !18, i64 56, !14, i64 80, !22, i64 104, !14, i64 152}
!13 = !{!"_ZTS4GridIiE", !10, i64 0, !10, i64 4, !14, i64 8}
!14 = !{!"_ZTSSt6vectorIiSaIiEE", !15, i64 0}
!15 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !17, i64 0}
!17 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!18 = !{!"_ZTSSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseISt3setIiSt4lessIiESaIiEESaIS4_EE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseISt3setIiSt4lessIiESaIiEESaIS4_EE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseISt3setIiSt4lessIiESaIiEESaIS4_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !23, i64 0}
!23 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !24, i64 0}
!24 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !25, i64 0, !27, i64 8}
!25 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !26, i64 0}
!26 = !{!"_ZTSSt4lessIiE"}
!27 = !{!"_ZTSSt15_Rb_tree_header", !28, i64 0, !30, i64 32}
!28 = !{!"_ZTSSt18_Rb_tree_node_base", !29, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!29 = !{!"_ZTSSt14_Rb_tree_color", !7, i64 0}
!30 = !{!"long", !7, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = distinct !{!33, !32}
!34 = !{!12, !10, i64 48}
!35 = !{!12, !10, i64 40}
!36 = distinct !{!36, !32}
!37 = !{!38, !10, i64 0}
!38 = !{!"_ZTS4Wall", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!39 = !{!38, !10, i64 4}
!40 = !{!38, !10, i64 8}
!41 = !{!38, !10, i64 12}
!42 = distinct !{!42, !32}
!43 = distinct !{!43, !32}
!44 = distinct !{!44, !32}
!45 = distinct !{!45, !32}
!46 = !{!12, !6, i64 32}
!47 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9}
!48 = !{!49, !49, i64 0}
!49 = !{!"bool", !7, i64 0}
!50 = !{i8 0, i8 2}
!51 = !{}
!52 = !{i64 0, i64 8, !5}
!53 = distinct !{!53, !32}
!54 = distinct !{!54, !32}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = type { %"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl" }
%"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl" = type { %"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Wall, std::allocator<Wall>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Wall = type { i32, i32, i32, i32 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.14" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.13" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN7MazeGen6lookupEii(ptr noundef nonnull align 8 dereferenceable(176), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #2

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7MazeGen13generate_mazeEv(ptr noundef nonnull align 8 dereferenceable(176) %0) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::vector.8", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca %struct.Wall, align 4
  %6 = alloca %struct.Wall, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.14", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.13", align 8
  %12 = alloca %"class.__gnu_cxx::__normal_iterator.13", align 8
  %13 = getelementptr inbounds i8, ptr %0, i64 44
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader89, label %._crit_edge93

.preheader89:                                     ; preds = %1, %._crit_edge
  %16 = phi i32 [ %23, %._crit_edge ], [ %14, %1 ]
  %.092 = phi i32 [ %24, %._crit_edge ], [ 0, %1 ]
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge93:                                    ; preds = %._crit_edge, %1
  tail call void @_ZN4GridIiE3setEiii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 1, i32 noundef 1, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #4
  call void @_ZNSt6vectorI4WallSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %18 = getelementptr inbounds i8, ptr %0, i64 48
  store i32 0, ptr %18, align 8, !tbaa !29
  %19 = getelementptr inbounds i8, ptr %0, i64 104
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %19) #4
  %20 = getelementptr inbounds i8, ptr %0, i64 56
  %21 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef 0) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  store i32 0, ptr %3, align 4, !tbaa !30
  %22 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertEOi(ptr noundef nonnull align 8 dereferenceable(48) %21, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %29 unwind label %41

._crit_edge:                                      ; preds = %.lr.ph, %.preheader89
  %23 = phi i32 [ %16, %.preheader89 ], [ %27, %.lr.ph ]
  %24 = add nuw nsw i32 %.092, 1
  %25 = icmp slt i32 %24, %23
  br i1 %25, label %.preheader89, label %._crit_edge93, !llvm.loop !31

.lr.ph:                                           ; preds = %.preheader89, %.lr.ph
  %.06991 = phi i32 [ %26, %.lr.ph ], [ 0, %.preheader89 ]
  tail call void @_ZN4GridIiE3setEiii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %.092, i32 noundef %.06991, i32 noundef 51)
  %26 = add nuw nsw i32 %.06991, 1
  %27 = load i32, ptr %13, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %.lr.ph, label %._crit_edge, !llvm.loop !34

29:                                               ; preds = %._crit_edge93
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  %30 = getelementptr inbounds i8, ptr %0, i64 80
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef 0) #4
  store i32 0, ptr %31, align 4, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #4
  %32 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 1, ptr %4, align 4, !tbaa !30
  %33 = load i32, ptr %32, align 8, !tbaa !35
  %34 = mul nsw i32 %33, %33
  %35 = icmp ugt i32 %34, 1
  br i1 %35, label %.lr.ph96, label %._crit_edge97

._crit_edge97:                                    ; preds = %46, %29
  %36 = phi i32 [ %33, %29 ], [ %52, %46 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  %37 = icmp sgt i32 %36, 1
  br i1 %37, label %.preheader88.preheader, label %.preheader87

.preheader88.preheader:                           ; preds = %._crit_edge97
  %38 = getelementptr inbounds i8, ptr %5, i64 4
  %39 = getelementptr inbounds i8, ptr %5, i64 8
  %40 = getelementptr inbounds i8, ptr %5, i64 12
  br label %.preheader88

41:                                               ; preds = %._crit_edge93
  %42 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  br label %166

.lr.ph96:                                         ; preds = %29, %46
  %storemerge94 = phi i32 [ %51, %46 ], [ 1, %29 ]
  %43 = sext i32 %storemerge94 to i64
  %44 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %43) #4
  call void @_ZNSt3setIiSt4lessIiESaIiEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) %44) #4
  %45 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %44, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %46 unwind label %55

46:                                               ; preds = %.lr.ph96
  %47 = load i32, ptr %4, align 4, !tbaa !30
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %48) #4
  store i32 %47, ptr %49, align 4, !tbaa !30
  %50 = load i32, ptr %4, align 4, !tbaa !30
  %51 = add nsw i32 %50, 1
  store i32 %51, ptr %4, align 4, !tbaa !30
  %52 = load i32, ptr %32, align 8, !tbaa !35
  %53 = mul nsw i32 %52, %52
  %54 = icmp slt i32 %51, %53
  br i1 %54, label %.lr.ph96, label %._crit_edge97, !llvm.loop !36

55:                                               ; preds = %.lr.ph96
  %56 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #4
  br label %166

.preheader88:                                     ; preds = %.preheader88.preheader, %._crit_edge100
  %57 = phi i32 [ %66, %._crit_edge100 ], [ %36, %.preheader88.preheader ]
  %.074101 = phi i32 [ %67, %._crit_edge100 ], [ 1, %.preheader88.preheader ]
  %58 = icmp sgt i32 %57, 0
  br i1 %58, label %.lr.ph99, label %._crit_edge100

.lr.ph99:                                         ; preds = %.preheader88
  %59 = add nsw i32 %.074101, -1
  %60 = add nuw nsw i32 %.074101, 1
  br label %69

.preheader87:                                     ; preds = %._crit_edge100, %._crit_edge97
  %61 = phi i32 [ %36, %._crit_edge97 ], [ %66, %._crit_edge100 ]
  %62 = icmp sgt i32 %61, 0
  br i1 %62, label %.preheader86.lr.ph, label %.preheader

.preheader86.lr.ph:                               ; preds = %.preheader87
  %63 = getelementptr inbounds i8, ptr %6, i64 4
  %64 = getelementptr inbounds i8, ptr %6, i64 8
  %65 = getelementptr inbounds i8, ptr %6, i64 12
  %.not116 = icmp eq i32 %61, 1
  br i1 %.not116, label %.preheader, label %.preheader86

._crit_edge100:                                   ; preds = %78, %.preheader88
  %66 = phi i32 [ %57, %.preheader88 ], [ %79, %78 ]
  %67 = add nuw nsw i32 %.074101, 2
  %68 = icmp slt i32 %67, %66
  br i1 %68, label %.preheader88, label %.preheader87, !llvm.loop !37

69:                                               ; preds = %.lr.ph99, %78
  %70 = phi i32 [ %57, %.lr.ph99 ], [ %79, %78 ]
  %71 = phi i32 [ %57, %.lr.ph99 ], [ %80, %78 ]
  %.07598 = phi i32 [ 0, %.lr.ph99 ], [ %81, %78 ]
  %72 = add nsw i32 %71, -1
  %73 = icmp slt i32 %.074101, %72
  br i1 %73, label %74, label %78

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  store i32 %59, ptr %5, align 4, !tbaa !38
  store i32 %.07598, ptr %38, align 4, !tbaa !40
  store i32 %60, ptr %39, align 4, !tbaa !41
  store i32 %.07598, ptr %40, align 4, !tbaa !42
  invoke void @_ZNSt6vectorI4WallSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(16) %5)
          to label %75 unwind label %76

75:                                               ; preds = %74
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  %.pre = load i32, ptr %32, align 8, !tbaa !35
  br label %78

76:                                               ; preds = %74
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  br label %166

78:                                               ; preds = %69, %75
  %79 = phi i32 [ %70, %69 ], [ %.pre, %75 ]
  %80 = phi i32 [ %71, %69 ], [ %.pre, %75 ]
  %81 = add nuw nsw i32 %.07598, 2
  %82 = icmp slt i32 %81, %80
  br i1 %82, label %69, label %._crit_edge100, !llvm.loop !43

.preheader86:                                     ; preds = %.preheader86.lr.ph, %._crit_edge104
  %83 = phi i32 [ %87, %._crit_edge104 ], [ %61, %.preheader86.lr.ph ]
  %.076105 = phi i32 [ %88, %._crit_edge104 ], [ 0, %.preheader86.lr.ph ]
  %84 = icmp sgt i32 %83, 1
  br i1 %84, label %.lr.ph103, label %._crit_edge104

.preheader:                                       ; preds = %._crit_edge104, %.preheader86.lr.ph, %.preheader87
  %85 = call noundef i64 @_ZNKSt6vectorI4WallSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not109 = icmp eq i64 %85, 0
  br i1 %.not109, label %._crit_edge111, label %.lr.ph110

.lr.ph110:                                        ; preds = %.preheader
  %86 = getelementptr inbounds i8, ptr %0, i64 32
  br label %105

._crit_edge104:                                   ; preds = %100, %.preheader86
  %87 = phi i32 [ %83, %.preheader86 ], [ %101, %100 ]
  %88 = add nuw nsw i32 %.076105, 2
  %89 = icmp slt i32 %88, %87
  br i1 %89, label %.preheader86, label %.preheader, !llvm.loop !44

.lr.ph103:                                        ; preds = %.preheader86, %100
  %90 = phi i32 [ %101, %100 ], [ %83, %.preheader86 ]
  %91 = phi i32 [ %102, %100 ], [ %83, %.preheader86 ]
  %.077102 = phi i32 [ %103, %100 ], [ 1, %.preheader86 ]
  %92 = add nsw i32 %91, -1
  %93 = icmp slt i32 %.077102, %92
  br i1 %93, label %94, label %100

94:                                               ; preds = %.lr.ph103
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #4
  store i32 %.076105, ptr %6, align 4, !tbaa !38
  %95 = add nsw i32 %.077102, -1
  store i32 %95, ptr %63, align 4, !tbaa !40
  store i32 %.076105, ptr %64, align 4, !tbaa !41
  %96 = add nuw nsw i32 %.077102, 1
  store i32 %96, ptr %65, align 4, !tbaa !42
  invoke void @_ZNSt6vectorI4WallSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr noundef nonnull align 4 dereferenceable(16) %6)
          to label %97 unwind label %98

97:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  %.pre115 = load i32, ptr %32, align 8, !tbaa !35
  br label %100

98:                                               ; preds = %94
  %99 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #4
  br label %166

100:                                              ; preds = %.lr.ph103, %97
  %101 = phi i32 [ %90, %.lr.ph103 ], [ %.pre115, %97 ]
  %102 = phi i32 [ %91, %.lr.ph103 ], [ %.pre115, %97 ]
  %103 = add nuw nsw i32 %.077102, 2
  %104 = icmp slt i32 %103, %102
  br i1 %104, label %.lr.ph103, label %._crit_edge104, !llvm.loop !45

105:                                              ; preds = %.lr.ph110, %161
  %106 = load ptr, ptr %86, align 8, !tbaa !46
  %107 = call noundef i64 @_ZNKSt6vectorI4WallSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %108 = trunc i64 %107 to i32
  %109 = invoke noundef i32 @_ZN7RandGen5randnEi(ptr noundef nonnull align 8 dereferenceable(5001) %106, i32 noundef %108)
          to label %110 unwind label %152

110:                                              ; preds = %105
  %111 = sext i32 %109 to i64
  %112 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI4WallSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %111) #4
  %.sroa.019.0.copyload = load i32, ptr %112, align 4, !tbaa !30
  %.sroa.7.0..sroa_idx = getelementptr inbounds i8, ptr %112, i64 4
  %.sroa.7.0.copyload = load i32, ptr %.sroa.7.0..sroa_idx, align 4, !tbaa !30
  %.sroa.10.0..sroa_idx = getelementptr inbounds i8, ptr %112, i64 8
  %.sroa.10.0.copyload = load i32, ptr %.sroa.10.0..sroa_idx, align 4, !tbaa !30
  %.sroa.13.0..sroa_idx = getelementptr inbounds i8, ptr %112, i64 12
  %.sroa.13.0.copyload = load i32, ptr %.sroa.13.0..sroa_idx, align 4, !tbaa !30
  %113 = call noundef i32 @_ZN7MazeGen6lookupEii(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %.sroa.019.0.copyload, i32 noundef %.sroa.7.0.copyload)
  %114 = sext i32 %113 to i64
  %115 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %114) #4
  %116 = call noundef i32 @_ZN7MazeGen6lookupEii(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %.sroa.10.0.copyload, i32 noundef %.sroa.13.0.copyload)
  %117 = sext i32 %116 to i64
  %118 = call noundef nonnull align 8 dereferenceable(48) ptr @_ZNSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %117) #4
  %119 = add nsw i32 %.sroa.10.0.copyload, %.sroa.019.0.copyload
  %120 = sdiv i32 %119, 2
  %121 = add nsw i32 %.sroa.13.0.copyload, %.sroa.7.0.copyload
  %122 = sdiv i32 %121, 2
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #4
  %123 = load i32, ptr %32, align 8, !tbaa !35
  %124 = mul nsw i32 %123, %122
  %125 = add nsw i32 %124, %120
  store i32 %125, ptr %7, align 4, !tbaa !30
  %126 = add nsw i32 %120, 1
  %127 = add nsw i32 %122, 1
  %128 = invoke noundef i32 @_ZNK4GridIiE3getEii(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef %126, i32 noundef %127)
          to label %129 unwind label %154

129:                                              ; preds = %110
  %130 = icmp eq i32 %128, 51
  %131 = icmp ne i32 %113, %116
  %132 = and i1 %131, %130
  br i1 %132, label %133, label %156

133:                                              ; preds = %129
  invoke void @_ZN7MazeGen13set_free_cellEii(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %.sroa.019.0.copyload, i32 noundef %.sroa.7.0.copyload)
          to label %134 unwind label %154

134:                                              ; preds = %133
  invoke void @_ZN7MazeGen13set_free_cellEii(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %120, i32 noundef %122)
          to label %135 unwind label %154

135:                                              ; preds = %134
  invoke void @_ZN7MazeGen13set_free_cellEii(ptr noundef nonnull align 8 dereferenceable(176) %0, i32 noundef %.sroa.10.0.copyload, i32 noundef %.sroa.13.0.copyload)
          to label %136 unwind label %154

136:                                              ; preds = %135
  %137 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %115) #4
  %138 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %115) #4
  invoke void @_ZNSt3setIiSt4lessIiESaIiEE6insertISt23_Rb_tree_const_iteratorIiEEEvT_S7_(ptr noundef nonnull align 8 dereferenceable(48) %118, ptr %137, ptr %138)
          to label %139 unwind label %154

139:                                              ; preds = %136
  %140 = invoke { ptr, i8 } @_ZNSt3setIiSt4lessIiESaIiEE6insertERKi(ptr noundef nonnull align 8 dereferenceable(48) %118, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %141 unwind label %154

141:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  call void @_ZNSt23_Rb_tree_const_iteratorIiEC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %142 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %118) #4
  store ptr %142, ptr %8, align 8, !tbaa !47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %143 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %118) #4
  store ptr %143, ptr %9, align 8
  %144 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br i1 %144, label %.lr.ph107, label %._crit_edge108

.lr.ph107:                                        ; preds = %141, %.lr.ph107
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt23_Rb_tree_const_iteratorIiEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  %146 = load i32, ptr %145, align 4, !tbaa !30
  %147 = sext i32 %146 to i64
  %148 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %147) #4
  store i32 %116, ptr %148, align 4, !tbaa !30
  %149 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorIiEppEv(ptr noundef nonnull align 8 dereferenceable(8) %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %150 = call ptr @_ZNKSt3setIiSt4lessIiESaIiEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %118) #4
  store ptr %150, ptr %9, align 8
  %151 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorIiES2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  br i1 %151, label %.lr.ph107, label %._crit_edge108, !llvm.loop !48

152:                                              ; preds = %105
  %153 = landingpad { ptr, i32 }
          cleanup
  br label %166

154:                                              ; preds = %139, %136, %135, %134, %133, %110
  %155 = landingpad { ptr, i32 }
          cleanup
  br label %165

._crit_edge108:                                   ; preds = %.lr.ph107, %141
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  br label %156

156:                                              ; preds = %._crit_edge108, %129
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #4
  %157 = call ptr @_ZNSt6vectorI4WallSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  store ptr %157, ptr %12, align 8
  %158 = call ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4WallSt6vectorIS1_SaIS1_EEEplEl(ptr noundef nonnull align 8 dereferenceable(8) %12, i64 noundef %111) #4
  store ptr %158, ptr %11, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPK4WallSt6vectorIS1_SaIS1_EEEC2IPS1_vEERKNS0_IT_S6_EE(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #4
  %159 = load ptr, ptr %10, align 8
  %160 = invoke ptr @_ZNSt6vectorI4WallSaIS0_EE5eraseEN9__gnu_cxx17__normal_iteratorIPKS0_S2_EE(ptr noundef nonnull align 8 dereferenceable(24) %2, ptr %159)
          to label %161 unwind label %163

161:                                              ; preds = %156
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  %162 = call noundef i64 @_ZNKSt6vectorI4WallSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  %.not = icmp eq i64 %162, 0
  br i1 %.not, label %._crit_edge111, label %105, !llvm.loop !49

163:                                              ; preds = %156
  %164 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  br label %165

165:                                              ; preds = %163, %154
  %.pn = phi { ptr, i32 } [ %164, %163 ], [ %155, %154 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #4
  br label %166

._crit_edge111:                                   ; preds = %161, %.preheader
  call void @_ZNSt6vectorI4WallSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  ret void

166:                                              ; preds = %152, %165, %98, %76, %55, %41
  %.pn84 = phi { ptr, i32 } [ %56, %55 ], [ %77, %76 ], [ %99, %98 ], [ %42, %41 ], [ %.pn, %165 ], [ %153, %152 ]
  call void @_ZNSt6vectorI4WallSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #4
  resume { ptr, i32 } %.pn84
}

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

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

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

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

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

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

declare noundef i32 @_ZN7RandGen5randnEi(ptr noundef nonnull align 8 dereferenceable(5001), i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZNSt6vectorI4WallSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

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

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

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

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

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

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

attributes #0 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 44}
!6 = !{!"_ZTS7MazeGen", !7, i64 0, !15, i64 32, !8, i64 40, !8, i64 44, !8, i64 48, !16, i64 56, !11, i64 80, !20, i64 104, !11, i64 152}
!7 = !{!"_ZTS4GridIiE", !8, i64 0, !8, i64 4, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSSt6vectorIiSaIiEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !9, i64 0}
!16 = !{!"_ZTSSt6vectorISt3setIiSt4lessIiESaIiEESaIS4_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseISt3setIiSt4lessIiESaIiEESaIS4_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt3setIiSt4lessIiESaIiEESaIS4_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt3setIiSt4lessIiESaIiEESaIS4_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!20 = !{!"_ZTSSt3setIiSt4lessIiESaIiEE", !21, i64 0}
!21 = !{!"_ZTSSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE", !22, i64 0}
!22 = !{!"_ZTSNSt8_Rb_treeIiiSt9_IdentityIiESt4lessIiESaIiEE13_Rb_tree_implIS3_Lb1EEE", !23, i64 0, !25, i64 8}
!23 = !{!"_ZTSSt20_Rb_tree_key_compareISt4lessIiEE", !24, i64 0}
!24 = !{!"_ZTSSt4lessIiE"}
!25 = !{!"_ZTSSt15_Rb_tree_header", !26, i64 0, !28, i64 32}
!26 = !{!"_ZTSSt18_Rb_tree_node_base", !27, i64 0, !15, i64 8, !15, i64 16, !15, i64 24}
!27 = !{!"_ZTSSt14_Rb_tree_color", !9, i64 0}
!28 = !{!"long", !9, i64 0}
!29 = !{!6, !8, i64 48}
!30 = !{!8, !8, i64 0}
!31 = distinct !{!31, !32, !33}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!"llvm.loop.unswitch.partial.disable"}
!34 = distinct !{!34, !32}
!35 = !{!6, !8, i64 40}
!36 = distinct !{!36, !32}
!37 = distinct !{!37, !32, !33}
!38 = !{!39, !8, i64 0}
!39 = !{!"_ZTS4Wall", !8, i64 0, !8, i64 4, !8, i64 8, !8, i64 12}
!40 = !{!39, !8, i64 4}
!41 = !{!39, !8, i64 8}
!42 = !{!39, !8, i64 12}
!43 = distinct !{!43, !32}
!44 = distinct !{!44, !32, !33}
!45 = distinct !{!45, !32}
!46 = !{!6, !15, i64 32}
!47 = !{!15, !15, i64 0}
!48 = distinct !{!48, !32}
!49 = distinct !{!49, !32}


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