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

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [18 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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40)) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5ImageC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15testSinglePixeliiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9testColoriiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.Image, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca %struct.Image, align 8
  %16 = alloca %struct.Image, align 8
  %17 = alloca i64, align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !5
  %18 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.59)
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %18, i32 noundef %19)
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef @.str.8)
  %22 = load i32, ptr %6, align 4, !tbaa !5
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %21, i32 noundef %22)
  %24 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef @.str.8)
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %24, i32 noundef %25)
  %27 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %26, ptr noundef @.str.8)
  %28 = load i32, ptr %8, align 4, !tbaa !5
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %27, i32 noundef %28)
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %29, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 40, ptr %9) #6
  call void @_ZN5ImageC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  %31 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 1
  store i32 20, ptr %31, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 2
  store i32 20, ptr %32, align 4, !tbaa !17
  %33 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 3
  store i32 6, ptr %33, align 8, !tbaa !18
  %34 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 4
  store i32 8, ptr %34, align 4, !tbaa !19
  %35 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %35, i64 noundef 1600)
          to label %36 unwind label %41

36:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store i64 0, ptr %12, align 8, !tbaa !20
  br label %37

37:                                               ; preds = %95, %36
  %38 = load i64, ptr %12, align 8, !tbaa !20
  %39 = icmp ult i64 %38, 20
  br i1 %39, label %45, label %40

40:                                               ; preds = %37
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  br label %98

41:                                               ; preds = %98, %4
  %42 = landingpad { ptr, i32 }
          cleanup
  %43 = extractvalue { ptr, i32 } %42, 0
  store ptr %43, ptr %10, align 8
  %44 = extractvalue { ptr, i32 } %42, 1
  store i32 %44, ptr %11, align 4
  br label %177

45:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store i64 0, ptr %14, align 8, !tbaa !20
  br label %46

46:                                               ; preds = %91, %45
  %47 = load i64, ptr %14, align 8, !tbaa !20
  %48 = icmp ult i64 %47, 20
  br i1 %48, label %50, label %49

49:                                               ; preds = %46
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %94

50:                                               ; preds = %46
  %51 = load i32, ptr %5, align 4, !tbaa !5
  %52 = trunc i32 %51 to i8
  %53 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %54 = load i64, ptr %12, align 8, !tbaa !20
  %55 = mul i64 80, %54
  %56 = load i64, ptr %14, align 8, !tbaa !20
  %57 = mul i64 4, %56
  %58 = add i64 %55, %57
  %59 = add i64 %58, 0
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %59) #6
  store i8 %52, ptr %60, align 1, !tbaa !22
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = trunc i32 %61 to i8
  %63 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %64 = load i64, ptr %12, align 8, !tbaa !20
  %65 = mul i64 80, %64
  %66 = load i64, ptr %14, align 8, !tbaa !20
  %67 = mul i64 4, %66
  %68 = add i64 %65, %67
  %69 = add i64 %68, 0
  %70 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %63, i64 noundef %69) #6
  store i8 %62, ptr %70, align 1, !tbaa !22
  %71 = load i32, ptr %7, align 4, !tbaa !5
  %72 = trunc i32 %71 to i8
  %73 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %74 = load i64, ptr %12, align 8, !tbaa !20
  %75 = mul i64 80, %74
  %76 = load i64, ptr %14, align 8, !tbaa !20
  %77 = mul i64 4, %76
  %78 = add i64 %75, %77
  %79 = add i64 %78, 0
  %80 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %73, i64 noundef %79) #6
  store i8 %72, ptr %80, align 1, !tbaa !22
  %81 = load i32, ptr %8, align 4, !tbaa !5
  %82 = trunc i32 %81 to i8
  %83 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %84 = load i64, ptr %12, align 8, !tbaa !20
  %85 = mul i64 80, %84
  %86 = load i64, ptr %14, align 8, !tbaa !20
  %87 = mul i64 4, %86
  %88 = add i64 %85, %87
  %89 = add i64 %88, 0
  %90 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %83, i64 noundef %89) #6
  store i8 %82, ptr %90, align 1, !tbaa !22
  br label %91

91:                                               ; preds = %50
  %92 = load i64, ptr %14, align 8, !tbaa !20
  %93 = add i64 %92, 1
  store i64 %93, ptr %14, align 8, !tbaa !20
  br label %46, !llvm.loop !23

94:                                               ; preds = %49
  br label %95

95:                                               ; preds = %94
  %96 = load i64, ptr %12, align 8, !tbaa !20
  %97 = add i64 %96, 1
  store i64 %97, ptr %12, align 8, !tbaa !20
  br label %37, !llvm.loop !25

98:                                               ; preds = %40
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %99 unwind label %41

99:                                               ; preds = %98
  call void @llvm.lifetime.start.p0(i64 40, ptr %15) #6
  invoke void @_ZN5ImageC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %15, ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %100 unwind label %112

100:                                              ; preds = %99
  %101 = getelementptr inbounds %struct.Image, ptr %15, i32 0, i32 0
  %102 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %101, i64 noundef 3) #6
  store i8 0, ptr %102, align 1, !tbaa !22
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %15)
          to label %103 unwind label %116

103:                                              ; preds = %100
  %104 = getelementptr inbounds %struct.Image, ptr %15, i32 0, i32 0
  %105 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef 3) #6
  store i8 -128, ptr %105, align 1, !tbaa !22
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %15)
          to label %106 unwind label %116

106:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 40, ptr %16) #6
  invoke void @_ZN5ImageC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %16, ptr noundef nonnull align 8 dereferenceable(40) %9)
          to label %107 unwind label %120

107:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  store i64 0, ptr %17, align 8, !tbaa !20
  br label %108

108:                                              ; preds = %151, %107
  %109 = load i64, ptr %17, align 8, !tbaa !20
  %110 = icmp ult i64 %109, 255
  br i1 %110, label %124, label %111

111:                                              ; preds = %108
  store i32 8, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %154

112:                                              ; preds = %99
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %10, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %11, align 4
  br label %176

116:                                              ; preds = %103, %100
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %10, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %11, align 4
  br label %175

120:                                              ; preds = %106
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %10, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %11, align 4
  br label %174

124:                                              ; preds = %108
  %125 = load i64, ptr %17, align 8, !tbaa !20
  %126 = trunc i64 %125 to i8
  %127 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %128 = load i64, ptr %17, align 8, !tbaa !20
  %129 = mul i64 %128, 4
  %130 = add i64 %129, 0
  %131 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %127, i64 noundef %130) #6
  store i8 %126, ptr %131, align 1, !tbaa !22
  %132 = load i64, ptr %17, align 8, !tbaa !20
  %133 = trunc i64 %132 to i8
  %134 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %135 = load i64, ptr %17, align 8, !tbaa !20
  %136 = mul i64 %135, 4
  %137 = add i64 %136, 1
  %138 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %134, i64 noundef %137) #6
  store i8 %133, ptr %138, align 1, !tbaa !22
  %139 = load i64, ptr %17, align 8, !tbaa !20
  %140 = trunc i64 %139 to i8
  %141 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %142 = load i64, ptr %17, align 8, !tbaa !20
  %143 = mul i64 %142, 4
  %144 = add i64 %143, 2
  %145 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %141, i64 noundef %144) #6
  store i8 %140, ptr %145, align 1, !tbaa !22
  %146 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %147 = load i64, ptr %17, align 8, !tbaa !20
  %148 = mul i64 %147, 4
  %149 = add i64 %148, 3
  %150 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %146, i64 noundef %149) #6
  store i8 -1, ptr %150, align 1, !tbaa !22
  br label %151

151:                                              ; preds = %124
  %152 = load i64, ptr %17, align 8, !tbaa !20
  %153 = add i64 %152, 1
  store i64 %153, ptr %17, align 8, !tbaa !20
  br label %108, !llvm.loop !26

154:                                              ; preds = %111
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %155 unwind label %170

155:                                              ; preds = %154
  %156 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %157 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %156, i64 noundef 1020) #6
  store i8 -1, ptr %157, align 1, !tbaa !22
  %158 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %159 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %158, i64 noundef 1021) #6
  store i8 -1, ptr %159, align 1, !tbaa !22
  %160 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %161 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %160, i64 noundef 1022) #6
  store i8 -1, ptr %161, align 1, !tbaa !22
  %162 = getelementptr inbounds %struct.Image, ptr %9, i32 0, i32 0
  %163 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %162, i64 noundef 1023) #6
  store i8 -1, ptr %163, align 1, !tbaa !22
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %16)
          to label %164 unwind label %170

164:                                              ; preds = %155
  %165 = load i32, ptr %5, align 4, !tbaa !5
  %166 = load i32, ptr %6, align 4, !tbaa !5
  %167 = load i32, ptr %7, align 4, !tbaa !5
  %168 = load i32, ptr %8, align 4, !tbaa !5
  invoke void @_Z15testSinglePixeliiii(i32 noundef %165, i32 noundef %166, i32 noundef %167, i32 noundef %168)
          to label %169 unwind label %170

169:                                              ; preds = %164
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #6
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #6
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  ret void

170:                                              ; preds = %164, %155, %154
  %171 = landingpad { ptr, i32 }
          cleanup
  %172 = extractvalue { ptr, i32 } %171, 0
  store ptr %172, ptr %10, align 8
  %173 = extractvalue { ptr, i32 } %171, 1
  store i32 %173, ptr %11, align 4
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %16) #6
  br label %174

174:                                              ; preds = %170, %120
  call void @llvm.lifetime.end.p0(i64 40, ptr %16) #6
  br label %175

175:                                              ; preds = %174, %116
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %15) #6
  br label %176

176:                                              ; preds = %175, %112
  call void @llvm.lifetime.end.p0(i64 40, ptr %15) #6
  br label %177

177:                                              ; preds = %176, %41
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %9) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr %9) #6
  br label %178

178:                                              ; preds = %177
  %179 = load ptr, ptr %10, align 8
  %180 = load i32, ptr %11, align 4
  %181 = insertvalue { ptr, i32 } poison, ptr %179, 0
  %182 = insertvalue { ptr, i32 } %181, i32 %180, 1
  resume { ptr, i32 } %182
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5ImageC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { inlinehint 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 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 = { 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 #5 = { inlinehint 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"_ZTS5Image", !11, i64 0, !6, i64 24, !6, i64 28, !16, i64 32, !6, i64 36}
!11 = !{!"_ZTSSt6vectorIhSaIhEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!17 = !{!10, !6, i64 28}
!18 = !{!10, !16, i64 32}
!19 = !{!10, !6, i64 36}
!20 = !{!21, !21, i64 0}
!21 = !{!"long", !7, i64 0}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = distinct !{!26, !24}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%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 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [18 x i8], align 1

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5ImageC2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z15testSinglePixeliiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9testColoriiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %5 = alloca %struct.Image, align 8
  %6 = alloca %struct.Image, align 8
  %7 = alloca %struct.Image, align 8
  %8 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.59)
  %9 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %8, i32 noundef %0)
  %10 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @.str.8)
  %11 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %10, i32 noundef %1)
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull @.str.8)
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %12, i32 noundef %2)
  %14 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull @.str.8)
  %15 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %14, i32 noundef %3)
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %5) #6
  call void @_ZN5ImageC2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  %17 = getelementptr inbounds i8, ptr %5, i64 24
  store <4 x i32> <i32 20, i32 20, i32 6, i32 8>, ptr %17, align 8, !tbaa !5
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 1600)
          to label %.preheader46 unwind label %24

.preheader46:                                     ; preds = %4
  %18 = trunc i32 %0 to i8
  %19 = trunc i32 %1 to i8
  %20 = trunc i32 %2 to i8
  %21 = trunc i32 %3 to i8
  br label %.preheader45

.preheader45:                                     ; preds = %.preheader46, %26
  %.03548 = phi i64 [ 0, %.preheader46 ], [ %27, %26 ]
  %22 = mul nuw nsw i64 %.03548, 80
  br label %28

23:                                               ; preds = %26
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %36 unwind label %24

24:                                               ; preds = %23, %4
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %71

26:                                               ; preds = %28
  %27 = add nuw nsw i64 %.03548, 1
  %exitcond50.not = icmp eq i64 %27, 20
  br i1 %exitcond50.not, label %23, label %.preheader45, !llvm.loop !8

28:                                               ; preds = %.preheader45, %28
  %.03447 = phi i64 [ 0, %.preheader45 ], [ %35, %28 ]
  %29 = shl nuw nsw i64 %.03447, 2
  %30 = add nuw nsw i64 %29, %22
  %31 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %30) #6
  store i8 %18, ptr %31, align 1, !tbaa !5
  %32 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %30) #6
  store i8 %19, ptr %32, align 1, !tbaa !5
  %33 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %30) #6
  store i8 %20, ptr %33, align 1, !tbaa !5
  %34 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %30) #6
  store i8 %21, ptr %34, align 1, !tbaa !5
  %35 = add nuw nsw i64 %.03447, 1
  %exitcond.not = icmp eq i64 %35, 20
  br i1 %exitcond.not, label %26, label %28, !llvm.loop !10

36:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %6) #6
  invoke void @_ZN5ImageC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %6, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %37 unwind label %43

37:                                               ; preds = %36
  %38 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 3) #6
  store i8 0, ptr %38, align 1, !tbaa !5
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %6)
          to label %39 unwind label %45

39:                                               ; preds = %37
  %40 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 3) #6
  store i8 -128, ptr %40, align 1, !tbaa !5
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %6)
          to label %41 unwind label %45

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #6
  invoke void @_ZN5ImageC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40) %7, ptr noundef nonnull align 8 dereferenceable(40) %5)
          to label %.preheader unwind label %47

42:                                               ; preds = %.preheader
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %59 unwind label %66

43:                                               ; preds = %36
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %70

45:                                               ; preds = %39, %37
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %69

47:                                               ; preds = %41
  %48 = landingpad { ptr, i32 }
          cleanup
  br label %68

.preheader:                                       ; preds = %41, %.preheader
  %.049 = phi i64 [ %58, %.preheader ], [ 0, %41 ]
  %49 = trunc nuw i64 %.049 to i8
  %50 = shl nuw nsw i64 %.049, 2
  %51 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %50) #6
  store i8 %49, ptr %51, align 1, !tbaa !5
  %52 = or disjoint i64 %50, 1
  %53 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %52) #6
  store i8 %49, ptr %53, align 1, !tbaa !5
  %54 = or disjoint i64 %50, 2
  %55 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %54) #6
  store i8 %49, ptr %55, align 1, !tbaa !5
  %56 = or disjoint i64 %50, 3
  %57 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %56) #6
  store i8 -1, ptr %57, align 1, !tbaa !5
  %58 = add nuw nsw i64 %.049, 1
  %exitcond51.not = icmp eq i64 %58, 255
  br i1 %exitcond51.not, label %42, label %.preheader, !llvm.loop !11

59:                                               ; preds = %42
  %60 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 1020) #6
  store i8 -1, ptr %60, align 1, !tbaa !5
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 1021) #6
  store i8 -1, ptr %61, align 1, !tbaa !5
  %62 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 1022) #6
  store i8 -1, ptr %62, align 1, !tbaa !5
  %63 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 1023) #6
  store i8 -1, ptr %63, align 1, !tbaa !5
  invoke void @_Z11doCodecTestR5Image(ptr noundef nonnull align 8 dereferenceable(40) %7)
          to label %64 unwind label %66

64:                                               ; preds = %59
  invoke void @_Z15testSinglePixeliiii(i32 noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3)
          to label %65 unwind label %66

65:                                               ; preds = %64
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #6
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #6
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #6
  ret void

66:                                               ; preds = %64, %59, %42
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %7) #6
  br label %68

68:                                               ; preds = %66, %47
  %.pn = phi { ptr, i32 } [ %67, %66 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #6
  br label %69

69:                                               ; preds = %68, %45
  %.pn.pn = phi { ptr, i32 } [ %.pn, %68 ], [ %46, %45 ]
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %6) #6
  br label %70

70:                                               ; preds = %69, %43
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %69 ], [ %44, %43 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %6) #6
  br label %71

71:                                               ; preds = %70, %24
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %70 ], [ %25, %24 ]
  call void @_ZN5ImageD2Ev(ptr noundef nonnull align 8 dereferenceable(40) %5) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5ImageC2ERKS_(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef nonnull align 8 dereferenceable(40)) unnamed_addr #2 align 2

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass