; LLVM IR from ahr9n/psolving-paradigms :: 2.greedy/UVa 11520 - Fill the Square.ll (Z8fillGridv)

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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_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 }

@n = external dso_local global i32, align 4
@arr = external dso_local global [15 x [15 x i8]], align 16
@mp = external dso_local global %"class.std::map", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8fillGridv() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i8, align 1
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 1, ptr %1, align 4, !tbaa !5
  br label %9

9:                                                ; preds = %279, %0
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = load i32, ptr @n, align 4, !tbaa !5
  %12 = add nsw i32 %11, 1
  %13 = icmp slt i32 %10, %12
  br i1 %13, label %15, label %14

14:                                               ; preds = %9
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %282

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

16:                                               ; preds = %275, %15
  %17 = load i32, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr @n, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  %20 = icmp slt i32 %17, %19
  br i1 %20, label %22, label %21

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

22:                                               ; preds = %16
  %23 = load i32, ptr %1, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %24
  %26 = load i32, ptr %3, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [15 x i8], ptr %25, i64 0, i64 %27
  %29 = load i8, ptr %28, align 1, !tbaa !9
  %30 = sext i8 %29 to i32
  %31 = icmp ne i32 %30, 46
  br i1 %31, label %32, label %33

32:                                               ; preds = %22
  br label %275

33:                                               ; preds = %22
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %35
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [15 x i8], ptr %36, i64 0, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !9
  %41 = sext i8 %40 to i32
  %42 = icmp eq i32 %41, 46
  br i1 %42, label %43, label %126

43:                                               ; preds = %33
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %45
  %47 = load i32, ptr %3, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [15 x i8], ptr %46, i64 0, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !9
  %51 = sext i8 %50 to i32
  %52 = load i32, ptr %1, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %53
  %55 = load i32, ptr %3, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [15 x i8], ptr %54, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !9
  %60 = sext i8 %59 to i32
  %61 = icmp eq i32 %51, %60
  br i1 %61, label %62, label %126

62:                                               ; preds = %43
  %63 = load i32, ptr %1, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %64
  %66 = load i32, ptr %3, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [15 x i8], ptr %65, i64 0, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !9
  %70 = sext i8 %69 to i32
  %71 = load i32, ptr %1, align 4, !tbaa !5
  %72 = sub nsw i32 %71, 1
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %73
  %75 = load i32, ptr %3, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [15 x i8], ptr %74, i64 0, i64 %76
  %78 = load i8, ptr %77, align 1, !tbaa !9
  %79 = sext i8 %78 to i32
  %80 = icmp eq i32 %70, %79
  br i1 %80, label %81, label %126

81:                                               ; preds = %62
  %82 = load i32, ptr %1, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %83
  %85 = load i32, ptr %3, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [15 x i8], ptr %84, i64 0, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !9
  %89 = sext i8 %88 to i32
  %90 = load i32, ptr %1, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %91
  %93 = load i32, ptr %3, align 4, !tbaa !5
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [15 x i8], ptr %92, i64 0, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !9
  %98 = sext i8 %97 to i32
  %99 = icmp eq i32 %89, %98
  br i1 %99, label %100, label %126

100:                                              ; preds = %81
  %101 = load i32, ptr %1, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %102
  %104 = load i32, ptr %3, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [15 x i8], ptr %103, i64 0, i64 %105
  %107 = load i8, ptr %106, align 1, !tbaa !9
  %108 = sext i8 %107 to i32
  %109 = load i32, ptr %1, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %111
  %113 = load i32, ptr %3, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [15 x i8], ptr %112, i64 0, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !9
  %117 = sext i8 %116 to i32
  %118 = icmp eq i32 %108, %117
  br i1 %118, label %119, label %126

119:                                              ; preds = %100
  %120 = load i32, ptr %1, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %121
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [15 x i8], ptr %122, i64 0, i64 %124
  store i8 65, ptr %125, align 1, !tbaa !9
  br label %274

126:                                              ; preds = %100, %81, %62, %43, %33
  call void @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @mp) #3
  %127 = load i32, ptr %1, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %128
  %130 = load i32, ptr %3, align 4, !tbaa !5
  %131 = add nsw i32 %130, 1
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [15 x i8], ptr %129, i64 0, i64 %132
  %134 = load i8, ptr %133, align 1, !tbaa !9
  %135 = sext i8 %134 to i32
  %136 = icmp ne i32 %135, 46
  br i1 %136, label %137, label %148

137:                                              ; preds = %126
  %138 = load i32, ptr %1, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %139
  %141 = load i32, ptr %3, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [15 x i8], ptr %140, i64 0, i64 %143
  %145 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %144)
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %145, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %137, %126
  %149 = load i32, ptr %1, align 4, !tbaa !5
  %150 = sub nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %151
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [15 x i8], ptr %152, i64 0, i64 %154
  %156 = load i8, ptr %155, align 1, !tbaa !9
  %157 = sext i8 %156 to i32
  %158 = icmp ne i32 %157, 46
  br i1 %158, label %159, label %170

159:                                              ; preds = %148
  %160 = load i32, ptr %1, align 4, !tbaa !5
  %161 = sub nsw i32 %160, 1
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %162
  %164 = load i32, ptr %3, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [15 x i8], ptr %163, i64 0, i64 %165
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %166)
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = add nsw i32 %168, 1
  store i32 %169, ptr %167, align 4, !tbaa !5
  br label %170

170:                                              ; preds = %159, %148
  %171 = load i32, ptr %1, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %172
  %174 = load i32, ptr %3, align 4, !tbaa !5
  %175 = sub nsw i32 %174, 1
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [15 x i8], ptr %173, i64 0, i64 %176
  %178 = load i8, ptr %177, align 1, !tbaa !9
  %179 = sext i8 %178 to i32
  %180 = icmp ne i32 %179, 46
  br i1 %180, label %181, label %192

181:                                              ; preds = %170
  %182 = load i32, ptr %1, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %183
  %185 = load i32, ptr %3, align 4, !tbaa !5
  %186 = sub nsw i32 %185, 1
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [15 x i8], ptr %184, i64 0, i64 %187
  %189 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %188)
  %190 = load i32, ptr %189, align 4, !tbaa !5
  %191 = add nsw i32 %190, 1
  store i32 %191, ptr %189, align 4, !tbaa !5
  br label %192

192:                                              ; preds = %181, %170
  %193 = load i32, ptr %1, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %195
  %197 = load i32, ptr %3, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [15 x i8], ptr %196, i64 0, i64 %198
  %200 = load i8, ptr %199, align 1, !tbaa !9
  %201 = sext i8 %200 to i32
  %202 = icmp ne i32 %201, 46
  br i1 %202, label %203, label %214

203:                                              ; preds = %192
  %204 = load i32, ptr %1, align 4, !tbaa !5
  %205 = add nsw i32 %204, 1
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %206
  %208 = load i32, ptr %3, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds [15 x i8], ptr %207, i64 0, i64 %209
  %211 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %210)
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = add nsw i32 %212, 1
  store i32 %213, ptr %211, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %203, %192
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #3
  store i8 65, ptr %4, align 1, !tbaa !9
  %215 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = icmp eq i32 %216, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #3
  br i1 %217, label %218, label %225

218:                                              ; preds = %214
  %219 = load i32, ptr %1, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %220
  %222 = load i32, ptr %3, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [15 x i8], ptr %221, i64 0, i64 %223
  store i8 65, ptr %224, align 1, !tbaa !9
  br label %273

225:                                              ; preds = %214
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  store i8 66, ptr %5, align 1, !tbaa !9
  %226 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %5)
  %227 = load i32, ptr %226, align 4, !tbaa !5
  %228 = icmp eq i32 %227, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  br i1 %228, label %229, label %236

229:                                              ; preds = %225
  %230 = load i32, ptr %1, align 4, !tbaa !5
  %231 = sext i32 %230 to i64
  %232 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %231
  %233 = load i32, ptr %3, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [15 x i8], ptr %232, i64 0, i64 %234
  store i8 66, ptr %235, align 1, !tbaa !9
  br label %272

236:                                              ; preds = %225
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  store i8 67, ptr %6, align 1, !tbaa !9
  %237 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %6)
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = icmp eq i32 %238, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  br i1 %239, label %240, label %247

240:                                              ; preds = %236
  %241 = load i32, ptr %1, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %242
  %244 = load i32, ptr %3, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [15 x i8], ptr %243, i64 0, i64 %245
  store i8 67, ptr %246, align 1, !tbaa !9
  br label %271

247:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  store i8 68, ptr %7, align 1, !tbaa !9
  %248 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %7)
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = icmp eq i32 %249, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  br i1 %250, label %251, label %258

251:                                              ; preds = %247
  %252 = load i32, ptr %1, align 4, !tbaa !5
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %253
  %255 = load i32, ptr %3, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [15 x i8], ptr %254, i64 0, i64 %256
  store i8 68, ptr %257, align 1, !tbaa !9
  br label %270

258:                                              ; preds = %247
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  store i8 69, ptr %8, align 1, !tbaa !9
  %259 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %8)
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = icmp eq i32 %260, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  br i1 %261, label %262, label %269

262:                                              ; preds = %258
  %263 = load i32, ptr %1, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %264
  %266 = load i32, ptr %3, align 4, !tbaa !5
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds [15 x i8], ptr %265, i64 0, i64 %267
  store i8 69, ptr %268, align 1, !tbaa !9
  br label %269

269:                                              ; preds = %262, %258
  br label %270

270:                                              ; preds = %269, %251
  br label %271

271:                                              ; preds = %270, %240
  br label %272

272:                                              ; preds = %271, %229
  br label %273

273:                                              ; preds = %272, %218
  br label %274

274:                                              ; preds = %273, %119
  br label %275

275:                                              ; preds = %274, %32
  %276 = load i32, ptr %3, align 4, !tbaa !5
  %277 = add nsw i32 %276, 1
  store i32 %277, ptr %3, align 4, !tbaa !5
  br label %16, !llvm.loop !10

278:                                              ; preds = %21
  br label %279

279:                                              ; preds = %278
  %280 = load i32, ptr %1, align 4, !tbaa !5
  %281 = add nsw i32 %280, 1
  store i32 %281, ptr %1, align 4, !tbaa !5
  br label %9, !llvm.loop !12

282:                                              ; preds = %14
  ret void
}

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


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

%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<char, std::pair<const char, int>, std::_Select1st<std::pair<const char, int>>, std::less<char>>::_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 }

@n = external dso_local local_unnamed_addr global i32, align 4
@arr = external dso_local global [15 x [15 x i8]], align 16
@mp = external dso_local global %"class.std::map", align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z8fillGridv() local_unnamed_addr #0 {
  %1 = alloca i8, align 1
  %2 = alloca i8, align 1
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not62 = icmp slt i32 %6, 1
  br i1 %.not62, label %._crit_edge64, label %.preheader

.preheader:                                       ; preds = %0, %._crit_edge
  %7 = phi i32 [ %10, %._crit_edge ], [ %6, %0 ]
  %indvars.iv67 = phi i64 [ %indvars.iv.next68.pre-phi, %._crit_edge ], [ 1, %0 ]
  %.not5460 = icmp slt i32 %7, 1
  br i1 %.not5460, label %.preheader.._crit_edge_crit_edge, label %.lr.ph

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre = add nuw nsw i64 %indvars.iv67, 1
  %.pre71 = sext i32 %7 to i64
  br label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %8 = add nsw i64 %indvars.iv67, -1
  %9 = add nuw nsw i64 %indvars.iv67, 1
  br label %11

._crit_edge64:                                    ; preds = %._crit_edge, %0
  ret void

._crit_edge:                                      ; preds = %._crit_edge70, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre71, %.preheader.._crit_edge_crit_edge ], [ %81, %._crit_edge70 ]
  %indvars.iv.next68.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %9, %._crit_edge70 ]
  %10 = phi i32 [ %7, %.preheader.._crit_edge_crit_edge ], [ %80, %._crit_edge70 ]
  %.not.not = icmp slt i64 %indvars.iv67, %.pre-phi
  br i1 %.not.not, label %.preheader, label %._crit_edge64, !llvm.loop !9

11:                                               ; preds = %.lr.ph, %._crit_edge70
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %14, %._crit_edge70 ]
  %12 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %indvars.iv67, i64 %indvars.iv
  %13 = load i8, ptr %12, align 1, !tbaa !12
  %.not55 = icmp eq i8 %13, 46
  %14 = add nuw nsw i64 %indvars.iv, 1
  br i1 %.not55, label %15, label %._crit_edge70

15:                                               ; preds = %11
  %16 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %indvars.iv67, i64 %14
  %17 = load i8, ptr %16, align 1, !tbaa !12
  %18 = icmp eq i8 %17, 46
  br i1 %18, label %19, label %32

19:                                               ; preds = %15
  %20 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %8, i64 %indvars.iv
  %21 = load i8, ptr %20, align 1, !tbaa !12
  %22 = icmp eq i8 %21, 46
  br i1 %22, label %23, label %32

23:                                               ; preds = %19
  %24 = add nsw i64 %indvars.iv, -1
  %25 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %indvars.iv67, i64 %24
  %26 = load i8, ptr %25, align 1, !tbaa !12
  %27 = icmp eq i8 %26, 46
  br i1 %27, label %28, label %32

28:                                               ; preds = %23
  %29 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %9, i64 %indvars.iv
  %30 = load i8, ptr %29, align 1, !tbaa !12
  %31 = icmp eq i8 %30, 46
  br i1 %31, label %._crit_edge70.sink.split, label %32

32:                                               ; preds = %28, %23, %19, %15
  call void @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEE5clearEv(ptr noundef nonnull align 8 dereferenceable(48) @mp) #3
  %33 = load i8, ptr %16, align 1, !tbaa !12
  %.not56 = icmp eq i8 %33, 46
  br i1 %.not56, label %38, label %34

34:                                               ; preds = %32
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %16)
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr %35, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %34, %32
  %39 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %8, i64 %indvars.iv
  %40 = load i8, ptr %39, align 1, !tbaa !12
  %.not57 = icmp eq i8 %40, 46
  br i1 %.not57, label %45, label %41

41:                                               ; preds = %38
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %39)
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %42, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %41, %38
  %46 = add nsw i64 %indvars.iv, -1
  %47 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %indvars.iv67, i64 %46
  %48 = load i8, ptr %47, align 1, !tbaa !12
  %.not58 = icmp eq i8 %48, 46
  br i1 %.not58, label %53, label %49

49:                                               ; preds = %45
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %47)
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %50, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %49, %45
  %54 = getelementptr inbounds [15 x [15 x i8]], ptr @arr, i64 0, i64 %9, i64 %indvars.iv
  %55 = load i8, ptr %54, align 1, !tbaa !12
  %.not59 = icmp eq i8 %55, 46
  br i1 %.not59, label %60, label %56

56:                                               ; preds = %53
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %54)
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %57, align 4, !tbaa !5
  br label %60

60:                                               ; preds = %56, %53
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %1) #3
  store i8 65, ptr %1, align 1, !tbaa !12
  %61 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %1)
  %62 = load i32, ptr %61, align 4, !tbaa !5
  %63 = icmp eq i32 %62, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %1) #3
  br i1 %63, label %._crit_edge70.sink.split, label %64

64:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %2) #3
  store i8 66, ptr %2, align 1, !tbaa !12
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %2)
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = icmp eq i32 %66, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %2) #3
  br i1 %67, label %._crit_edge70.sink.split, label %68

68:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #3
  store i8 67, ptr %3, align 1, !tbaa !12
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %3)
  %70 = load i32, ptr %69, align 4, !tbaa !5
  %71 = icmp eq i32 %70, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #3
  br i1 %71, label %._crit_edge70.sink.split, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #3
  store i8 68, ptr %4, align 1, !tbaa !12
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %4)
  %74 = load i32, ptr %73, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #3
  br i1 %75, label %._crit_edge70.sink.split, label %76

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #3
  store i8 69, ptr %5, align 1, !tbaa !12
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48) @mp, ptr noundef nonnull align 1 dereferenceable(1) %5)
  %78 = load i32, ptr %77, align 4, !tbaa !5
  %79 = icmp eq i32 %78, 0
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #3
  br i1 %79, label %._crit_edge70.sink.split, label %._crit_edge70

._crit_edge70.sink.split:                         ; preds = %76, %72, %68, %64, %60, %28
  %.sink = phi i8 [ 65, %28 ], [ 65, %60 ], [ 66, %64 ], [ 67, %68 ], [ 68, %72 ], [ 69, %76 ]
  store i8 %.sink, ptr %12, align 1, !tbaa !12
  br label %._crit_edge70

._crit_edge70:                                    ; preds = %._crit_edge70.sink.split, %11, %76
  %80 = load i32, ptr @n, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %.not54.not = icmp slt i64 %indvars.iv, %81
  br i1 %.not54.not, label %11, label %._crit_edge, !llvm.loop !13
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIciSt4lessIcESaISt4pairIKciEEEixEOc(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 1 dereferenceable(1)) 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) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.unswitch.partial.disable"}
!12 = !{!7, !7, i64 0}
!13 = distinct !{!13, !10}


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