; LLVM IR from venumb/ZSPACE :: cpp/depends/lodePNG (lodepng_unittest)

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

%struct.Image = type { %"class.std::vector", i32, i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z36generateTestImageRequiringColorType8R5Image16LodePNGColorTypejb(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i8, align 1
  %13 = alloca i64, align 8
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !11
  %21 = zext i1 %3 to i8
  store i8 %21, ptr %8, align 1, !tbaa !13
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Image, ptr %23, i32 0, i32 3
  store i32 %22, ptr %24, align 8, !tbaa !15
  %25 = load i32, ptr %7, align 4, !tbaa !11
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.Image, ptr %26, i32 0, i32 4
  store i32 %25, ptr %27, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 1, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #3
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = icmp eq i32 %28, 0
  br i1 %29, label %33, label %30

30:                                               ; preds = %4
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = icmp eq i32 %31, 4
  br label %33

33:                                               ; preds = %30, %4
  %34 = phi i1 [ true, %4 ], [ %32, %30 ]
  %35 = zext i1 %34 to i8
  store i8 %35, ptr %11, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #3
  %36 = load i32, ptr %6, align 4, !tbaa !9
  %37 = icmp eq i32 %36, 6
  br i1 %37, label %41, label %38

38:                                               ; preds = %33
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = icmp eq i32 %39, 4
  br label %41

41:                                               ; preds = %38, %33
  %42 = phi i1 [ true, %33 ], [ %40, %38 ]
  %43 = zext i1 %42 to i8
  store i8 %43, ptr %12, align 1, !tbaa !13
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = icmp eq i32 %44, 3
  br i1 %45, label %46, label %118

46:                                               ; preds = %41
  %47 = load i32, ptr %7, align 4, !tbaa !11
  %48 = shl i32 1, %47
  store i32 %48, ptr %9, align 4, !tbaa !11
  store i32 256, ptr %10, align 4, !tbaa !11
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.Image, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %9, align 4, !tbaa !11
  %52 = load i32, ptr %10, align 4, !tbaa !11
  %53 = mul i32 %51, %52
  %54 = mul i32 %53, 4
  %55 = zext i32 %54 to i64
  call void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %50, i64 noundef %55)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  store i64 0, ptr %13, align 8, !tbaa !22
  br label %56

56:                                               ; preds = %114, %46
  %57 = load i64, ptr %13, align 8, !tbaa !22
  %58 = load i32, ptr %10, align 4, !tbaa !11
  %59 = zext i32 %58 to i64
  %60 = icmp ult i64 %57, %59
  br i1 %60, label %62, label %61

61:                                               ; preds = %56
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %117

62:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store i64 0, ptr %15, align 8, !tbaa !22
  br label %63

63:                                               ; preds = %110, %62
  %64 = load i64, ptr %15, align 8, !tbaa !22
  %65 = load i32, ptr %9, align 4, !tbaa !11
  %66 = zext i32 %65 to i64
  %67 = icmp ult i64 %64, %66
  br i1 %67, label %69, label %68

68:                                               ; preds = %63
  store i32 5, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  br label %113

69:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %70 = load i64, ptr %13, align 8, !tbaa !22
  %71 = load i32, ptr %9, align 4, !tbaa !11
  %72 = zext i32 %71 to i64
  %73 = mul i64 %70, %72
  %74 = mul i64 %73, 4
  %75 = load i64, ptr %15, align 8, !tbaa !22
  %76 = mul i64 %75, 4
  %77 = add i64 %74, %76
  store i64 %77, ptr %16, align 8, !tbaa !22
  %78 = load i64, ptr %15, align 8, !tbaa !22
  %79 = trunc i64 %78 to i8
  %80 = load ptr, ptr %5, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.Image, ptr %80, i32 0, i32 0
  %82 = load i64, ptr %16, align 8, !tbaa !22
  %83 = add i64 %82, 0
  %84 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %81, i64 noundef %83) #3
  store i8 %79, ptr %84, align 1, !tbaa !24
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Image, ptr %85, i32 0, i32 0
  %87 = load i64, ptr %16, align 8, !tbaa !22
  %88 = add i64 %87, 1
  %89 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %86, i64 noundef %88) #3
  store i8 -1, ptr %89, align 1, !tbaa !24
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.Image, ptr %90, i32 0, i32 0
  %92 = load i64, ptr %16, align 8, !tbaa !22
  %93 = add i64 %92, 2
  %94 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %91, i64 noundef %93) #3
  store i8 0, ptr %94, align 1, !tbaa !24
  %95 = load i8, ptr %8, align 1, !tbaa !13, !range !25, !noundef !26
  %96 = trunc i8 %95 to i1
  br i1 %96, label %97, label %100

97:                                               ; preds = %69
  %98 = load i64, ptr %15, align 8, !tbaa !22
  %99 = icmp eq i64 %98, 0
  br label %100

100:                                              ; preds = %97, %69
  %101 = phi i1 [ false, %69 ], [ %99, %97 ]
  %102 = zext i1 %101 to i64
  %103 = select i1 %101, i32 0, i32 255
  %104 = trunc i32 %103 to i8
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.Image, ptr %105, i32 0, i32 0
  %107 = load i64, ptr %16, align 8, !tbaa !22
  %108 = add i64 %107, 3
  %109 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %106, i64 noundef %108) #3
  store i8 %104, ptr %109, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  br label %110

110:                                              ; preds = %100
  %111 = load i64, ptr %15, align 8, !tbaa !22
  %112 = add i64 %111, 1
  store i64 %112, ptr %15, align 8, !tbaa !22
  br label %63, !llvm.loop !27

113:                                              ; preds = %68
  br label %114

114:                                              ; preds = %113
  %115 = load i64, ptr %13, align 8, !tbaa !22
  %116 = add i64 %115, 1
  store i64 %116, ptr %13, align 8, !tbaa !22
  br label %56, !llvm.loop !29

117:                                              ; preds = %61
  br label %261

118:                                              ; preds = %41
  %119 = load i8, ptr %11, align 1, !tbaa !13, !range !25, !noundef !26
  %120 = trunc i8 %119 to i1
  br i1 %120, label %121, label %176

121:                                              ; preds = %118
  store i32 2, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %122 = load i32, ptr %7, align 4, !tbaa !11
  %123 = shl i32 1, %122
  %124 = sub i32 %123, 1
  %125 = udiv i32 255, %124
  store i32 %125, ptr %17, align 4, !tbaa !11
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.Image, ptr %126, i32 0, i32 0
  %128 = load i32, ptr %9, align 4, !tbaa !11
  %129 = load i32, ptr %10, align 4, !tbaa !11
  %130 = mul i32 %128, %129
  %131 = mul i32 %130, 4
  %132 = zext i32 %131 to i64
  call void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %127, i64 noundef %132)
  %133 = load i32, ptr %17, align 4, !tbaa !11
  %134 = trunc i32 %133 to i8
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.Image, ptr %135, i32 0, i32 0
  %137 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %136, i64 noundef 0) #3
  store i8 %134, ptr %137, align 1, !tbaa !24
  %138 = load i32, ptr %17, align 4, !tbaa !11
  %139 = trunc i32 %138 to i8
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.Image, ptr %140, i32 0, i32 0
  %142 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %141, i64 noundef 1) #3
  store i8 %139, ptr %142, align 1, !tbaa !24
  %143 = load i32, ptr %17, align 4, !tbaa !11
  %144 = trunc i32 %143 to i8
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.Image, ptr %145, i32 0, i32 0
  %147 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %146, i64 noundef 2) #3
  store i8 %144, ptr %147, align 1, !tbaa !24
  %148 = load i8, ptr %12, align 1, !tbaa !13, !range !25, !noundef !26
  %149 = trunc i8 %148 to i1
  br i1 %149, label %150, label %152

150:                                              ; preds = %121
  %151 = load i32, ptr %17, align 4, !tbaa !11
  br label %153

152:                                              ; preds = %121
  br label %153

153:                                              ; preds = %152, %150
  %154 = phi i32 [ %151, %150 ], [ 255, %152 ]
  %155 = trunc i32 %154 to i8
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.Image, ptr %156, i32 0, i32 0
  %158 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %157, i64 noundef 3) #3
  store i8 %155, ptr %158, align 1, !tbaa !24
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.Image, ptr %159, i32 0, i32 0
  %161 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %160, i64 noundef 4) #3
  store i8 0, ptr %161, align 1, !tbaa !24
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.Image, ptr %162, i32 0, i32 0
  %164 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %163, i64 noundef 5) #3
  store i8 0, ptr %164, align 1, !tbaa !24
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.Image, ptr %165, i32 0, i32 0
  %167 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %166, i64 noundef 6) #3
  store i8 0, ptr %167, align 1, !tbaa !24
  %168 = load i8, ptr %8, align 1, !tbaa !13, !range !25, !noundef !26
  %169 = trunc i8 %168 to i1
  %170 = zext i1 %169 to i64
  %171 = select i1 %169, i32 0, i32 255
  %172 = trunc i32 %171 to i8
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.Image, ptr %173, i32 0, i32 0
  %175 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %174, i64 noundef 7) #3
  store i8 %172, ptr %175, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  br label %260

176:                                              ; preds = %118
  store i32 257, ptr %9, align 4, !tbaa !11
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.Image, ptr %177, i32 0, i32 0
  %179 = load i32, ptr %9, align 4, !tbaa !11
  %180 = load i32, ptr %10, align 4, !tbaa !11
  %181 = mul i32 %179, %180
  %182 = mul i32 %181, 4
  %183 = zext i32 %182 to i64
  call void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %178, i64 noundef %183)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  store i64 0, ptr %18, align 8, !tbaa !22
  br label %184

184:                                              ; preds = %256, %176
  %185 = load i64, ptr %18, align 8, !tbaa !22
  %186 = load i32, ptr %10, align 4, !tbaa !11
  %187 = zext i32 %186 to i64
  %188 = icmp ult i64 %185, %187
  br i1 %188, label %190, label %189

189:                                              ; preds = %184
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  br label %259

190:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store i64 0, ptr %19, align 8, !tbaa !22
  br label %191

191:                                              ; preds = %252, %190
  %192 = load i64, ptr %19, align 8, !tbaa !22
  %193 = load i32, ptr %9, align 4, !tbaa !11
  %194 = zext i32 %193 to i64
  %195 = icmp ult i64 %192, %194
  br i1 %195, label %197, label %196

196:                                              ; preds = %191
  store i32 11, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %255

197:                                              ; preds = %191
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %198 = load i64, ptr %18, align 8, !tbaa !22
  %199 = load i32, ptr %9, align 4, !tbaa !11
  %200 = zext i32 %199 to i64
  %201 = mul i64 %198, %200
  %202 = mul i64 %201, 4
  %203 = load i64, ptr %19, align 8, !tbaa !22
  %204 = mul i64 %203, 4
  %205 = add i64 %202, %204
  store i64 %205, ptr %20, align 8, !tbaa !22
  %206 = load i64, ptr %20, align 8, !tbaa !22
  %207 = udiv i64 %206, 2
  %208 = trunc i64 %207 to i8
  %209 = load ptr, ptr %5, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.Image, ptr %209, i32 0, i32 0
  %211 = load i64, ptr %20, align 8, !tbaa !22
  %212 = add i64 %211, 0
  %213 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %210, i64 noundef %212) #3
  store i8 %208, ptr %213, align 1, !tbaa !24
  %214 = load i64, ptr %20, align 8, !tbaa !22
  %215 = udiv i64 %214, 3
  %216 = trunc i64 %215 to i8
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.Image, ptr %217, i32 0, i32 0
  %219 = load i64, ptr %20, align 8, !tbaa !22
  %220 = add i64 %219, 1
  %221 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %218, i64 noundef %220) #3
  store i8 %216, ptr %221, align 1, !tbaa !24
  %222 = load i64, ptr %20, align 8, !tbaa !22
  %223 = udiv i64 %222, 5
  %224 = trunc i64 %223 to i8
  %225 = load ptr, ptr %5, align 8, !tbaa !5
  %226 = getelementptr inbounds %struct.Image, ptr %225, i32 0, i32 0
  %227 = load i64, ptr %20, align 8, !tbaa !22
  %228 = add i64 %227, 2
  %229 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %226, i64 noundef %228) #3
  store i8 %224, ptr %229, align 1, !tbaa !24
  %230 = load i8, ptr %8, align 1, !tbaa !13, !range !25, !noundef !26
  %231 = trunc i8 %230 to i1
  br i1 %231, label %232, label %236

232:                                              ; preds = %197
  %233 = load i64, ptr %19, align 8, !tbaa !22
  %234 = icmp eq i64 %233, 0
  br i1 %234, label %235, label %236

235:                                              ; preds = %232
  br label %244

236:                                              ; preds = %232, %197
  %237 = load i8, ptr %12, align 1, !tbaa !13, !range !25, !noundef !26
  %238 = trunc i8 %237 to i1
  br i1 %238, label %239, label %241

239:                                              ; preds = %236
  %240 = load i64, ptr %20, align 8, !tbaa !22
  br label %242

241:                                              ; preds = %236
  br label %242

242:                                              ; preds = %241, %239
  %243 = phi i64 [ %240, %239 ], [ 255, %241 ]
  br label %244

244:                                              ; preds = %242, %235
  %245 = phi i64 [ 0, %235 ], [ %243, %242 ]
  %246 = trunc i64 %245 to i8
  %247 = load ptr, ptr %5, align 8, !tbaa !5
  %248 = getelementptr inbounds %struct.Image, ptr %247, i32 0, i32 0
  %249 = load i64, ptr %20, align 8, !tbaa !22
  %250 = add i64 %249, 3
  %251 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %248, i64 noundef %250) #3
  store i8 %246, ptr %251, align 1, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  br label %252

252:                                              ; preds = %244
  %253 = load i64, ptr %19, align 8, !tbaa !22
  %254 = add i64 %253, 1
  store i64 %254, ptr %19, align 8, !tbaa !22
  br label %191, !llvm.loop !30

255:                                              ; preds = %196
  br label %256

256:                                              ; preds = %255
  %257 = load i64, ptr %18, align 8, !tbaa !22
  %258 = add i64 %257, 1
  store i64 %258, ptr %18, align 8, !tbaa !22
  br label %184, !llvm.loop !31

259:                                              ; preds = %189
  br label %260

260:                                              ; preds = %259, %153
  br label %261

261:                                              ; preds = %260, %117
  %262 = load i32, ptr %9, align 4, !tbaa !11
  %263 = load ptr, ptr %5, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.Image, ptr %263, i32 0, i32 1
  store i32 %262, ptr %264, align 8, !tbaa !32
  %265 = load i32, ptr %10, align 4, !tbaa !11
  %266 = load ptr, ptr %5, align 8, !tbaa !5
  %267 = getelementptr inbounds %struct.Image, ptr %266, i32 0, i32 2
  store i32 %265, ptr %267, align 4, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !10, i64 32}
!16 = !{!"_ZTS5Image", !17, i64 0, !12, i64 24, !12, i64 28, !10, i64 32, !12, i64 36}
!17 = !{!"_ZTSSt6vectorIhSaIhEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!16, !12, i64 36}
!22 = !{!23, !23, i64 0}
!23 = !{!"long", !7, i64 0}
!24 = !{!7, !7, i64 0}
!25 = !{i8 0, i8 2}
!26 = !{}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = distinct !{!30, !28}
!31 = distinct !{!31, !28}
!32 = !{!16, !12, i64 24}
!33 = !{!16, !12, i64 28}


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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z36generateTestImageRequiringColorType8R5Image16LodePNGColorTypejb(ptr noundef nonnull align 8 dereferenceable(40) %0, i32 noundef %1, i32 noundef %2, i1 noundef zeroext %3) local_unnamed_addr #1 {
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %1, ptr %5, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %2, ptr %6, align 4, !tbaa !16
  %7 = and i32 %1, -3
  %8 = icmp eq i32 %7, 4
  switch i32 %1, label %.critedge [
    i32 3, label %9
    i32 4, label %33
    i32 0, label %33
  ]

9:                                                ; preds = %4
  %10 = shl nuw i32 1, %2
  %11 = shl i32 1024, %2
  %12 = zext i32 %11 to i64
  tail call void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %12)
  %13 = zext i32 %10 to i64
  %14 = zext nneg i32 %2 to i64
  br label %.preheader

.preheader:                                       ; preds = %9, %16
  %.08694 = phi i64 [ 0, %9 ], [ %17, %16 ]
  %15 = shl nuw i64 %.08694, %14
  br label %18

16:                                               ; preds = %18
  %17 = add nuw nsw i64 %.08694, 1
  %exitcond106.not = icmp eq i64 %17, 256
  br i1 %exitcond106.not, label %.loopexit, label %.preheader, !llvm.loop !17

18:                                               ; preds = %.preheader, %18
  %.08793 = phi i64 [ 0, %.preheader ], [ %32, %18 ]
  %19 = add i64 %.08793, %15
  %20 = shl nuw i64 %19, 2
  %21 = trunc i64 %.08793 to i8
  %22 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %20) #2
  store i8 %21, ptr %22, align 1, !tbaa !19
  %23 = or disjoint i64 %20, 1
  %24 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %23) #2
  store i8 -1, ptr %24, align 1, !tbaa !19
  %25 = or disjoint i64 %20, 2
  %26 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %25) #2
  store i8 0, ptr %26, align 1, !tbaa !19
  %27 = icmp eq i64 %.08793, 0
  %28 = and i1 %27, %3
  %not.89 = xor i1 %28, true
  %29 = sext i1 %not.89 to i8
  %30 = or disjoint i64 %20, 3
  %31 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %30) #2
  store i8 %29, ptr %31, align 1, !tbaa !19
  %32 = add nuw nsw i64 %.08793, 1
  %exitcond.not = icmp eq i64 %32, %13
  br i1 %exitcond.not, label %16, label %18, !llvm.loop !20

33:                                               ; preds = %4, %4
  %notmask = shl nsw i32 -1, %2
  %34 = xor i32 %notmask, -1
  %35 = udiv i32 255, %34
  tail call void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 8)
  %36 = trunc nuw i32 %35 to i8
  %37 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #2
  store i8 %36, ptr %37, align 1, !tbaa !19
  %38 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1) #2
  store i8 %36, ptr %38, align 1, !tbaa !19
  %39 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 2) #2
  store i8 %36, ptr %39, align 1, !tbaa !19
  %40 = select i1 %8, i8 %36, i8 -1
  %41 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 3) #2
  store i8 %40, ptr %41, align 1, !tbaa !19
  %42 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 4) #2
  store i8 0, ptr %42, align 1, !tbaa !19
  %43 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 5) #2
  store i8 0, ptr %43, align 1, !tbaa !19
  %44 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 6) #2
  store i8 0, ptr %44, align 1, !tbaa !19
  %not. = xor i1 %3, true
  %45 = sext i1 %not. to i8
  %46 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 7) #2
  store i8 %45, ptr %46, align 1, !tbaa !19
  br label %.loopexit

.critedge:                                        ; preds = %4
  tail call void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1028)
  br i1 %8, label %.critedge.split.us.peel.next, label %.critedge.split

.critedge.split.us.peel.next:                     ; preds = %.critedge
  %47 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 0) #2
  store i8 0, ptr %47, align 1, !tbaa !19
  %48 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 1) #2
  store i8 0, ptr %48, align 1, !tbaa !19
  %49 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 2) #2
  store i8 0, ptr %49, align 1, !tbaa !19
  %50 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef 3) #2
  store i8 0, ptr %50, align 1, !tbaa !19
  br label %.critedge.split.us

.critedge.split.us:                               ; preds = %.critedge.split.us.peel.next, %.critedge.split.us
  %.08395.us = phi i64 [ %65, %.critedge.split.us ], [ 1, %.critedge.split.us.peel.next ]
  %51 = shl nuw nsw i64 %.08395.us, 2
  %.083.tr.us = trunc i64 %.08395.us to i8
  %52 = shl i8 %.083.tr.us, 1
  %53 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %51) #2
  store i8 %52, ptr %53, align 1, !tbaa !19
  %.lhs.trunc.us = trunc nuw i64 %51 to i16
  %54 = udiv i16 %.lhs.trunc.us, 3
  %55 = trunc i16 %54 to i8
  %56 = or disjoint i64 %51, 1
  %57 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %56) #2
  store i8 %55, ptr %57, align 1, !tbaa !19
  %58 = udiv i16 %.lhs.trunc.us, 5
  %59 = trunc i16 %58 to i8
  %60 = or disjoint i64 %51, 2
  %61 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %60) #2
  store i8 %59, ptr %61, align 1, !tbaa !19
  %62 = trunc i64 %51 to i8
  %63 = or disjoint i64 %51, 3
  %64 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %63) #2
  store i8 %62, ptr %64, align 1, !tbaa !19
  %65 = add nuw nsw i64 %.08395.us, 1
  %exitcond109.not = icmp eq i64 %65, 257
  br i1 %exitcond109.not, label %.loopexit, label %.critedge.split.us, !llvm.loop !21

.critedge.split:                                  ; preds = %.critedge
  br i1 %3, label %.critedge.split.split, label %.critedge.split.split.us

.critedge.split.split.us:                         ; preds = %.critedge.split, %.critedge.split.split.us
  %.08395.us96 = phi i64 [ %79, %.critedge.split.split.us ], [ 0, %.critedge.split ]
  %66 = shl nuw nsw i64 %.08395.us96, 2
  %.083.tr.us97 = trunc i64 %.08395.us96 to i8
  %67 = shl i8 %.083.tr.us97, 1
  %68 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %66) #2
  store i8 %67, ptr %68, align 1, !tbaa !19
  %.lhs.trunc.us98 = trunc nuw i64 %66 to i16
  %69 = udiv i16 %.lhs.trunc.us98, 3
  %70 = trunc i16 %69 to i8
  %71 = or disjoint i64 %66, 1
  %72 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %71) #2
  store i8 %70, ptr %72, align 1, !tbaa !19
  %73 = udiv i16 %.lhs.trunc.us98, 5
  %74 = trunc i16 %73 to i8
  %75 = or disjoint i64 %66, 2
  %76 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %75) #2
  store i8 %74, ptr %76, align 1, !tbaa !19
  %77 = or disjoint i64 %66, 3
  %78 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %77) #2
  store i8 -1, ptr %78, align 1, !tbaa !19
  %79 = add nuw nsw i64 %.08395.us96, 1
  %exitcond107.not = icmp eq i64 %79, 257
  br i1 %exitcond107.not, label %.loopexit, label %.critedge.split.split.us, !llvm.loop !23

.critedge.split.split:                            ; preds = %.critedge.split, %.critedge.split.split
  %.08395 = phi i64 [ %94, %.critedge.split.split ], [ 0, %.critedge.split ]
  %80 = shl nuw nsw i64 %.08395, 2
  %.083.tr = trunc i64 %.08395 to i8
  %81 = shl i8 %.083.tr, 1
  %82 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %80) #2
  store i8 %81, ptr %82, align 1, !tbaa !19
  %.lhs.trunc = trunc nuw i64 %80 to i16
  %83 = udiv i16 %.lhs.trunc, 3
  %84 = trunc i16 %83 to i8
  %85 = or disjoint i64 %80, 1
  %86 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %85) #2
  store i8 %84, ptr %86, align 1, !tbaa !19
  %87 = udiv i16 %.lhs.trunc, 5
  %88 = trunc i16 %87 to i8
  %89 = or disjoint i64 %80, 2
  %90 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %89) #2
  store i8 %88, ptr %90, align 1, !tbaa !19
  %91 = icmp ne i64 %.08395, 0
  %spec.select = sext i1 %91 to i8
  %92 = or disjoint i64 %80, 3
  %93 = tail call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %0, i64 noundef %92) #2
  store i8 %spec.select, ptr %93, align 1, !tbaa !19
  %94 = add nuw nsw i64 %.08395, 1
  %exitcond108.not = icmp eq i64 %94, 257
  br i1 %exitcond108.not, label %.loopexit, label %.critedge.split.split, !llvm.loop !23

.loopexit:                                        ; preds = %16, %.critedge.split.split.us, %.critedge.split.split, %.critedge.split.us, %33
  %.085 = phi i32 [ 1, %33 ], [ 1, %.critedge.split.us ], [ 1, %.critedge.split.split ], [ 1, %.critedge.split.split.us ], [ 256, %16 ]
  %.0 = phi i32 [ 2, %33 ], [ 257, %.critedge.split.us ], [ 257, %.critedge.split.split ], [ 257, %.critedge.split.split.us ], [ %10, %16 ]
  %95 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %.0, ptr %95, align 8, !tbaa !24
  %96 = getelementptr inbounds i8, ptr %0, i64 28
  store i32 %.085, ptr %96, align 4, !tbaa !25
  ret void
}

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 = { 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, !15, i64 32}
!6 = !{!"_ZTS5Image", !7, i64 0, !14, i64 24, !14, i64 28, !15, i64 32, !14, i64 36}
!7 = !{!"_ZTSSt6vectorIhSaIhEE", !8, i64 0}
!8 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !9, i64 0}
!9 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !10, i64 0}
!10 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !11, i64 0, !11, i64 8, !11, i64 16}
!11 = !{!"any pointer", !12, i64 0}
!12 = !{!"omnipotent char", !13, i64 0}
!13 = !{!"Simple C++ TBAA"}
!14 = !{!"int", !12, i64 0}
!15 = !{!"_ZTS16LodePNGColorType", !12, i64 0}
!16 = !{!6, !14, i64 36}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!12, !12, i64 0}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18, !22}
!22 = !{!"llvm.loop.peeled.count", i32 1}
!23 = distinct !{!23, !18}
!24 = !{!6, !14, i64 24}
!25 = !{!6, !14, i64 28}


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