; LLVM IR from chrismile/cfd3d :: src/IO/PgmFile.ll (Z30nearestNeighborUpsamplingPgm2DRKSt6vectorIjSaIjEEiiRS1_ii)

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

@.str.5 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [65 x i8], align 1
@__PRETTY_FUNCTION__._Z30nearestNeighborUpsamplingPgm2DRKSt6vectorIjSaIjEEiiRS1_ii = external hidden unnamed_addr constant [120 x i8], align 1

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z30nearestNeighborUpsamplingPgm2DRKSt6vectorIjSaIjEEiiRS1_ii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %4, i32 noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  %23 = load i32, ptr %8, align 4, !tbaa !9
  %24 = icmp sge i32 %23, 3
  br i1 %24, label %25, label %34

25:                                               ; preds = %6
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = icmp sge i32 %26, 3
  br i1 %27, label %28, label %34

28:                                               ; preds = %25
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = icmp sge i32 %29, 3
  br i1 %30, label %31, label %34

31:                                               ; preds = %28
  %32 = load i32, ptr %12, align 4, !tbaa !9
  %33 = icmp sge i32 %32, 3
  br label %34

34:                                               ; preds = %31, %28, %25, %6
  %35 = phi i1 [ false, %28 ], [ false, %25 ], [ false, %6 ], [ %33, %31 ]
  br i1 %35, label %36, label %37

36:                                               ; preds = %34
  br label %39

37:                                               ; preds = %34
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.5, i32 noundef 86, ptr noundef @__PRETTY_FUNCTION__._Z30nearestNeighborUpsamplingPgm2DRKSt6vectorIjSaIjEEiiRS1_ii) #5
  unreachable

38:                                               ; No predecessors!
  br label %39

39:                                               ; preds = %38, %36
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = mul i64 %41, %43
  store i64 %44, ptr %13, align 8, !tbaa !11
  %45 = load ptr, ptr %10, align 8, !tbaa !5
  %46 = load i64, ptr %13, align 8, !tbaa !11
  call void @_ZNSt6vectorIjSaIjEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %45, i64 noundef %46)
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = load i32, ptr %11, align 4, !tbaa !9
  %49 = icmp eq i32 %47, %48
  br i1 %49, label %50, label %61

50:                                               ; preds = %39
  %51 = load i32, ptr %9, align 4, !tbaa !9
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = icmp eq i32 %51, %52
  br i1 %53, label %54, label %61

54:                                               ; preds = %50
  %55 = load ptr, ptr %10, align 8, !tbaa !5
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %55) #6
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #6
  %59 = load i64, ptr %13, align 8, !tbaa !11
  %60 = mul i64 4, %59
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %56, ptr align 4 %58, i64 %60, i1 false)
  store i32 1, ptr %14, align 4
  br label %295

61:                                               ; preds = %50, %39
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = mul nsw i32 0, %63
  %65 = add nsw i32 %64, 0
  %66 = sext i32 %65 to i64
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %66) #6
  %68 = load i32, ptr %67, align 4, !tbaa !9
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = mul nsw i32 0, %70
  %72 = add nsw i32 %71, 0
  %73 = sext i32 %72 to i64
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %73) #6
  store i32 %68, ptr %74, align 4, !tbaa !9
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = load i32, ptr %8, align 4, !tbaa !9
  %77 = sub nsw i32 %76, 1
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = mul nsw i32 %77, %78
  %80 = add nsw i32 %79, 0
  %81 = sext i32 %80 to i64
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %81) #6
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = sub nsw i32 %85, 1
  %87 = load i32, ptr %12, align 4, !tbaa !9
  %88 = mul nsw i32 %86, %87
  %89 = add nsw i32 %88, 0
  %90 = sext i32 %89 to i64
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %84, i64 noundef %90) #6
  store i32 %83, ptr %91, align 4, !tbaa !9
  %92 = load ptr, ptr %7, align 8, !tbaa !5
  %93 = load i32, ptr %9, align 4, !tbaa !9
  %94 = add nsw i32 0, %93
  %95 = sub nsw i32 %94, 1
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %92, i64 noundef %96) #6
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = load ptr, ptr %10, align 8, !tbaa !5
  %100 = load i32, ptr %12, align 4, !tbaa !9
  %101 = mul nsw i32 0, %100
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = add nsw i32 %101, %102
  %104 = sub nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %99, i64 noundef %105) #6
  store i32 %98, ptr %106, align 4, !tbaa !9
  %107 = load ptr, ptr %7, align 8, !tbaa !5
  %108 = load i32, ptr %8, align 4, !tbaa !9
  %109 = sub nsw i32 %108, 1
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = mul nsw i32 %109, %110
  %112 = load i32, ptr %9, align 4, !tbaa !9
  %113 = add nsw i32 %111, %112
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %107, i64 noundef %115) #6
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !9
  %120 = sub nsw i32 %119, 1
  %121 = load i32, ptr %12, align 4, !tbaa !9
  %122 = mul nsw i32 %120, %121
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = add nsw i32 %122, %123
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %118, i64 noundef %126) #6
  store i32 %117, ptr %127, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 1, ptr %15, align 4, !tbaa !9
  br label %128

128:                                              ; preds = %178, %61
  %129 = load i32, ptr %15, align 4, !tbaa !9
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = sub nsw i32 %130, 1
  %132 = icmp slt i32 %129, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %128
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %181

134:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %135 = load i32, ptr %15, align 4, !tbaa !9
  %136 = sub nsw i32 %135, 1
  %137 = load i32, ptr %9, align 4, !tbaa !9
  %138 = sub nsw i32 %137, 2
  %139 = mul nsw i32 %136, %138
  %140 = load i32, ptr %12, align 4, !tbaa !9
  %141 = sub nsw i32 %140, 2
  %142 = sdiv i32 %139, %141
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %16, align 4, !tbaa !9
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = load i32, ptr %9, align 4, !tbaa !9
  %146 = mul nsw i32 0, %145
  %147 = load i32, ptr %16, align 4, !tbaa !9
  %148 = add nsw i32 %146, %147
  %149 = sext i32 %148 to i64
  %150 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %144, i64 noundef %149) #6
  %151 = load i32, ptr %150, align 4, !tbaa !9
  %152 = load ptr, ptr %10, align 8, !tbaa !5
  %153 = load i32, ptr %12, align 4, !tbaa !9
  %154 = mul nsw i32 0, %153
  %155 = load i32, ptr %15, align 4, !tbaa !9
  %156 = add nsw i32 %154, %155
  %157 = sext i32 %156 to i64
  %158 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %152, i64 noundef %157) #6
  store i32 %151, ptr %158, align 4, !tbaa !9
  %159 = load ptr, ptr %7, align 8, !tbaa !5
  %160 = load i32, ptr %8, align 4, !tbaa !9
  %161 = sub nsw i32 %160, 1
  %162 = load i32, ptr %9, align 4, !tbaa !9
  %163 = mul nsw i32 %161, %162
  %164 = load i32, ptr %16, align 4, !tbaa !9
  %165 = add nsw i32 %163, %164
  %166 = sext i32 %165 to i64
  %167 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %159, i64 noundef %166) #6
  %168 = load i32, ptr %167, align 4, !tbaa !9
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = load i32, ptr %11, align 4, !tbaa !9
  %171 = sub nsw i32 %170, 1
  %172 = load i32, ptr %12, align 4, !tbaa !9
  %173 = mul nsw i32 %171, %172
  %174 = load i32, ptr %15, align 4, !tbaa !9
  %175 = add nsw i32 %173, %174
  %176 = sext i32 %175 to i64
  %177 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %169, i64 noundef %176) #6
  store i32 %168, ptr %177, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %178

178:                                              ; preds = %134
  %179 = load i32, ptr %15, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %15, align 4, !tbaa !9
  br label %128, !llvm.loop !13

181:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %182

182:                                              ; preds = %232, %181
  %183 = load i32, ptr %17, align 4, !tbaa !9
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = sub nsw i32 %184, 1
  %186 = icmp slt i32 %183, %185
  br i1 %186, label %188, label %187

187:                                              ; preds = %182
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %235

188:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %189 = load i32, ptr %17, align 4, !tbaa !9
  %190 = sub nsw i32 %189, 1
  %191 = load i32, ptr %8, align 4, !tbaa !9
  %192 = sub nsw i32 %191, 2
  %193 = mul nsw i32 %190, %192
  %194 = load i32, ptr %11, align 4, !tbaa !9
  %195 = sub nsw i32 %194, 2
  %196 = sdiv i32 %193, %195
  %197 = add nsw i32 %196, 1
  store i32 %197, ptr %18, align 4, !tbaa !9
  %198 = load ptr, ptr %7, align 8, !tbaa !5
  %199 = load i32, ptr %18, align 4, !tbaa !9
  %200 = load i32, ptr %9, align 4, !tbaa !9
  %201 = mul nsw i32 %199, %200
  %202 = add nsw i32 %201, 0
  %203 = sext i32 %202 to i64
  %204 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %198, i64 noundef %203) #6
  %205 = load i32, ptr %204, align 4, !tbaa !9
  %206 = load ptr, ptr %10, align 8, !tbaa !5
  %207 = load i32, ptr %17, align 4, !tbaa !9
  %208 = load i32, ptr %12, align 4, !tbaa !9
  %209 = mul nsw i32 %207, %208
  %210 = add nsw i32 %209, 0
  %211 = sext i32 %210 to i64
  %212 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %206, i64 noundef %211) #6
  store i32 %205, ptr %212, align 4, !tbaa !9
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  %214 = load i32, ptr %18, align 4, !tbaa !9
  %215 = load i32, ptr %9, align 4, !tbaa !9
  %216 = mul nsw i32 %214, %215
  %217 = load i32, ptr %9, align 4, !tbaa !9
  %218 = add nsw i32 %216, %217
  %219 = sub nsw i32 %218, 1
  %220 = sext i32 %219 to i64
  %221 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %213, i64 noundef %220) #6
  %222 = load i32, ptr %221, align 4, !tbaa !9
  %223 = load ptr, ptr %10, align 8, !tbaa !5
  %224 = load i32, ptr %17, align 4, !tbaa !9
  %225 = load i32, ptr %12, align 4, !tbaa !9
  %226 = mul nsw i32 %224, %225
  %227 = load i32, ptr %12, align 4, !tbaa !9
  %228 = add nsw i32 %226, %227
  %229 = sub nsw i32 %228, 1
  %230 = sext i32 %229 to i64
  %231 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %223, i64 noundef %230) #6
  store i32 %222, ptr %231, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %232

232:                                              ; preds = %188
  %233 = load i32, ptr %17, align 4, !tbaa !9
  %234 = add nsw i32 %233, 1
  store i32 %234, ptr %17, align 4, !tbaa !9
  br label %182, !llvm.loop !15

235:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  store i32 1, ptr %19, align 4, !tbaa !9
  br label %236

236:                                              ; preds = %291, %235
  %237 = load i32, ptr %19, align 4, !tbaa !9
  %238 = load i32, ptr %12, align 4, !tbaa !9
  %239 = sub nsw i32 %238, 1
  %240 = icmp slt i32 %237, %239
  br i1 %240, label %242, label %241

241:                                              ; preds = %236
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %294

242:                                              ; preds = %236
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 1, ptr %20, align 4, !tbaa !9
  br label %243

243:                                              ; preds = %287, %242
  %244 = load i32, ptr %20, align 4, !tbaa !9
  %245 = load i32, ptr %11, align 4, !tbaa !9
  %246 = sub nsw i32 %245, 1
  %247 = icmp slt i32 %244, %246
  br i1 %247, label %249, label %248

248:                                              ; preds = %243
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %290

249:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %250 = load i32, ptr %20, align 4, !tbaa !9
  %251 = sub nsw i32 %250, 1
  %252 = load i32, ptr %8, align 4, !tbaa !9
  %253 = sub nsw i32 %252, 2
  %254 = mul nsw i32 %251, %253
  %255 = load i32, ptr %11, align 4, !tbaa !9
  %256 = sub nsw i32 %255, 2
  %257 = sdiv i32 %254, %256
  %258 = add nsw i32 %257, 1
  store i32 %258, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %259 = load i32, ptr %19, align 4, !tbaa !9
  %260 = sub nsw i32 %259, 1
  %261 = load i32, ptr %9, align 4, !tbaa !9
  %262 = sub nsw i32 %261, 2
  %263 = mul nsw i32 %260, %262
  %264 = load i32, ptr %12, align 4, !tbaa !9
  %265 = sub nsw i32 %264, 2
  %266 = sdiv i32 %263, %265
  %267 = add nsw i32 %266, 1
  store i32 %267, ptr %22, align 4, !tbaa !9
  %268 = load ptr, ptr %7, align 8, !tbaa !5
  %269 = load i32, ptr %21, align 4, !tbaa !9
  %270 = load i32, ptr %9, align 4, !tbaa !9
  %271 = mul nsw i32 %269, %270
  %272 = load i32, ptr %22, align 4, !tbaa !9
  %273 = add nsw i32 %271, %272
  %274 = sext i32 %273 to i64
  %275 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %268, i64 noundef %274) #6
  %276 = load i32, ptr %275, align 4, !tbaa !9
  %277 = load ptr, ptr %10, align 8, !tbaa !5
  %278 = load i32, ptr %20, align 4, !tbaa !9
  %279 = load i32, ptr %12, align 4, !tbaa !9
  %280 = mul nsw i32 %278, %279
  %281 = load i32, ptr %19, align 4, !tbaa !9
  %282 = load i32, ptr %11, align 4, !tbaa !9
  %283 = mul nsw i32 %281, %282
  %284 = add nsw i32 %280, %283
  %285 = sext i32 %284 to i64
  %286 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %277, i64 noundef %285) #6
  store i32 %276, ptr %286, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %287

287:                                              ; preds = %249
  %288 = load i32, ptr %20, align 4, !tbaa !9
  %289 = add nsw i32 %288, 1
  store i32 %289, ptr %20, align 4, !tbaa !9
  br label %243, !llvm.loop !16

290:                                              ; preds = %248
  br label %291

291:                                              ; preds = %290
  %292 = load i32, ptr %19, align 4, !tbaa !9
  %293 = add nsw i32 %292, 1
  store i32 %293, ptr %19, align 4, !tbaa !9
  br label %236, !llvm.loop !17

294:                                              ; preds = %241
  store i32 0, ptr %14, align 4
  br label %295

295:                                              ; preds = %294, %54
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  %296 = load i32, ptr %14, align 4
  switch i32 %296, label %298 [
    i32 0, label %297
    i32 1, label %297
  ]

297:                                              ; preds = %295, %295
  ret void

298:                                              ; preds = %295
  unreachable
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 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 nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn nounwind "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 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 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { noreturn nounwind }
attributes #6 = { 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, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}


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

@.str.5 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [65 x i8], align 1
@__PRETTY_FUNCTION__._Z30nearestNeighborUpsamplingPgm2DRKSt6vectorIjSaIjEEiiRS1_ii = external hidden unnamed_addr constant [120 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z30nearestNeighborUpsamplingPgm2DRKSt6vectorIjSaIjEEiiRS1_ii(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 noundef %1, i32 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #1 {
  %7 = icmp sgt i32 %1, 2
  %8 = icmp sgt i32 %2, 2
  %or.cond = and i1 %7, %8
  %9 = icmp sgt i32 %4, 2
  %or.cond3 = and i1 %or.cond, %9
  %10 = icmp sgt i32 %5, 2
  %or.cond5 = and i1 %or.cond3, %10
  br i1 %or.cond5, label %11, label %.critedge

.critedge:                                        ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.5, i32 noundef 86, ptr noundef nonnull @__PRETTY_FUNCTION__._Z30nearestNeighborUpsamplingPgm2DRKSt6vectorIjSaIjEEiiRS1_ii) #4
  unreachable

11:                                               ; preds = %6
  %12 = zext nneg i32 %4 to i64
  %13 = zext nneg i32 %5 to i64
  %14 = mul nuw nsw i64 %13, %12
  tail call void @_ZNSt6vectorIjSaIjEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %14)
  %15 = icmp eq i32 %1, %4
  %16 = icmp eq i32 %2, %5
  %or.cond112 = and i1 %15, %16
  br i1 %or.cond112, label %17, label %.lr.ph

17:                                               ; preds = %11
  %18 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %19 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEE5frontEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #5
  %20 = shl nuw i64 %14, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %18, ptr nonnull align 4 %19, i64 %20, i1 false)
  br label %.loopexit

.lr.ph:                                           ; preds = %11
  %21 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #5
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #5
  store i32 %22, ptr %23, align 4, !tbaa !5
  %24 = add nsw i32 %1, -1
  %25 = mul nsw i32 %24, %2
  %26 = zext nneg i32 %25 to i64
  %27 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %26) #5
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = add nsw i32 %4, -1
  %30 = mul nsw i32 %29, %5
  %31 = zext nneg i32 %30 to i64
  %32 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %31) #5
  store i32 %28, ptr %32, align 4, !tbaa !5
  %33 = add nsw i32 %2, -1
  %34 = zext nneg i32 %33 to i64
  %35 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %34) #5
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %5, -1
  %38 = zext nneg i32 %37 to i64
  %39 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %38) #5
  store i32 %36, ptr %39, align 4, !tbaa !5
  %40 = mul i32 %2, %1
  %41 = add nsw i32 %40, -1
  %42 = zext nneg i32 %41 to i64
  %43 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %42) #5
  %44 = load i32, ptr %43, align 4, !tbaa !5
  %45 = mul i32 %5, %4
  %46 = add nsw i32 %45, -1
  %47 = zext nneg i32 %46 to i64
  %48 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %47) #5
  store i32 %44, ptr %48, align 4, !tbaa !5
  %49 = add nsw i32 %2, -2
  %50 = add nsw i32 %5, -2
  %51 = zext nneg i32 %30 to i64
  br label %55

.lr.ph117:                                        ; preds = %55
  %52 = add nsw i32 %1, -2
  %53 = add nsw i32 %4, -2
  %54 = zext nneg i32 %5 to i64
  %wide.trip.count126 = zext i32 %29 to i64
  br label %95

55:                                               ; preds = %.lr.ph, %55
  %indvars.iv = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next, %55 ]
  %56 = trunc i64 %indvars.iv to i32
  %57 = add i32 %56, -1
  %58 = mul i32 %57, %49
  %59 = sdiv i32 %58, %50
  %60 = add nsw i32 %59, 1
  %61 = sext i32 %60 to i64
  %62 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %61) #5
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %indvars.iv) #5
  store i32 %63, ptr %64, align 4, !tbaa !5
  %65 = add nsw i32 %60, %25
  %66 = sext i32 %65 to i64
  %67 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %66) #5
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = add nuw nsw i64 %indvars.iv, %51
  %70 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %69) #5
  store i32 %68, ptr %70, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %38
  br i1 %exitcond.not, label %.lr.ph117, label %55, !llvm.loop !9

.preheader.us.preheader:                          ; preds = %95
  %71 = add nsw i32 %4, -2
  %72 = add nsw i32 %5, -2
  %73 = add nsw i32 %2, -2
  %74 = add nsw i32 %1, -2
  %wide.trip.count131 = zext i32 %29 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv133 = phi i64 [ 1, %.preheader.us.preheader ], [ %indvars.iv.next134, %._crit_edge.us ]
  %75 = trunc i64 %indvars.iv133 to i32
  %76 = add i32 %75, -1
  %77 = mul i32 %76, %73
  %78 = sdiv i32 %77, %72
  %79 = add nsw i32 %78, 1
  %80 = mul nuw nsw i64 %indvars.iv133, %12
  br label %81

81:                                               ; preds = %.preheader.us, %81
  %indvars.iv128 = phi i64 [ 1, %.preheader.us ], [ %indvars.iv.next129, %81 ]
  %82 = trunc i64 %indvars.iv128 to i32
  %83 = add i32 %82, -1
  %84 = mul i32 %83, %74
  %85 = sdiv i32 %84, %71
  %86 = add nsw i32 %85, 1
  %87 = mul nsw i32 %86, %2
  %88 = add nsw i32 %79, %87
  %89 = sext i32 %88 to i64
  %90 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %89) #5
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = mul nuw nsw i64 %indvars.iv128, %13
  %93 = add nuw nsw i64 %92, %80
  %94 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %93) #5
  store i32 %91, ptr %94, align 4, !tbaa !5
  %indvars.iv.next129 = add nuw nsw i64 %indvars.iv128, 1
  %exitcond132.not = icmp eq i64 %indvars.iv.next129, %wide.trip.count131
  br i1 %exitcond132.not, label %._crit_edge.us, label %81, !llvm.loop !11

._crit_edge.us:                                   ; preds = %81
  %indvars.iv.next134 = add nuw nsw i64 %indvars.iv133, 1
  %exitcond137.not = icmp eq i64 %indvars.iv.next134, %38
  br i1 %exitcond137.not, label %.loopexit, label %.preheader.us, !llvm.loop !12

95:                                               ; preds = %.lr.ph117, %95
  %indvars.iv123 = phi i64 [ 1, %.lr.ph117 ], [ %indvars.iv.next124, %95 ]
  %96 = trunc i64 %indvars.iv123 to i32
  %97 = add i32 %96, -1
  %98 = mul i32 %97, %52
  %99 = sdiv i32 %98, %53
  %100 = add nsw i32 %99, 1
  %101 = mul nsw i32 %100, %2
  %102 = sext i32 %101 to i64
  %103 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %102) #5
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = mul nuw nsw i64 %indvars.iv123, %54
  %106 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %105) #5
  store i32 %104, ptr %106, align 4, !tbaa !5
  %107 = add i32 %33, %101
  %108 = sext i32 %107 to i64
  %109 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNKSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %108) #5
  %110 = load i32, ptr %109, align 4, !tbaa !5
  %111 = trunc nsw i64 %105 to i32
  %112 = add i32 %37, %111
  %113 = sext i32 %112 to i64
  %114 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %113) #5
  store i32 %110, ptr %114, align 4, !tbaa !5
  %indvars.iv.next124 = add nuw nsw i64 %indvars.iv123, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next124, %wide.trip.count126
  br i1 %exitcond127.not, label %.preheader.us.preheader, label %95, !llvm.loop !13

.loopexit:                                        ; preds = %._crit_edge.us, %17
  ret void
}

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

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

; Function Attrs: mustprogress 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) #3

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

attributes #0 = { noreturn nounwind "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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { noreturn nounwind }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = distinct !{!13, !10}


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