; LLVM IR from JayXon/Leanify :: lib/zopflipng/zopflipng_lib.ll (Z24LossyOptimizeTransparentPN7lodepng5StateEPhjj)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = 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 }
%struct.LodePNGState = type { %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32 }
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32, i32, i32, i64, i64 }
%struct.LodePNGDecompressSettings = type { i32, i32, i64, ptr, ptr, ptr }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32, i32, i32 }
%struct.LodePNGCompressSettings = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode, i32, i32, i32, i32, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, %struct.LodePNGTime, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, [3 x ptr], [3 x i64] }
%struct.LodePNGTime = type { i32, i32, i32, i32, i32, i32 }

; 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 uwtable
declare dso_local void @_Z11CountColorsPSt3setIjSt4lessIjESaIjEEPKhjjb(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL10ColorIndexPKh(ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z24LossyOptimizeTransparentPN7lodepng5StateEPhjj(ptr noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::set", align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i8, align 1
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca %"class.std::vector.8", align 8
  %22 = alloca ptr, align 8
  %23 = alloca i64, align 8
  %24 = alloca i32, align 4
  %25 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  store i8 1, ptr %9, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store i64 0, ptr %10, align 8, !tbaa !13
  br label %26

26:                                               ; preds = %54, %4
  %27 = load i64, ptr %10, align 8, !tbaa !13
  %28 = load i32, ptr %7, align 4, !tbaa !9
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = mul i32 %28, %29
  %31 = zext i32 %30 to i64
  %32 = icmp ult i64 %27, %31
  br i1 %32, label %34, label %33

33:                                               ; preds = %26
  store i32 2, ptr %11, align 4
  br label %57

34:                                               ; preds = %26
  %35 = load ptr, ptr %6, align 8, !tbaa !5
  %36 = load i64, ptr %10, align 8, !tbaa !13
  %37 = mul i64 %36, 4
  %38 = add i64 %37, 3
  %39 = getelementptr inbounds i8, ptr %35, i64 %38
  %40 = load i8, ptr %39, align 1, !tbaa !15
  %41 = zext i8 %40 to i32
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %53

43:                                               ; preds = %34
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = load i64, ptr %10, align 8, !tbaa !13
  %46 = mul i64 %45, 4
  %47 = add i64 %46, 3
  %48 = getelementptr inbounds i8, ptr %44, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !15
  %50 = zext i8 %49 to i32
  %51 = icmp slt i32 %50, 255
  br i1 %51, label %52, label %53

52:                                               ; preds = %43
  store i8 0, ptr %9, align 1, !tbaa !11
  store i32 2, ptr %11, align 4
  br label %57

53:                                               ; preds = %43, %34
  br label %54

54:                                               ; preds = %53
  %55 = load i64, ptr %10, align 8, !tbaa !13
  %56 = add i64 %55, 1
  store i64 %56, ptr %10, align 8, !tbaa !13
  br label %26, !llvm.loop !16

57:                                               ; preds = %52, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  br label %58

58:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #3
  call void @_ZNSt3setIjSt4lessIjESaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #3
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  %60 = load i32, ptr %7, align 4, !tbaa !9
  %61 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @_Z11CountColorsPSt3setIjSt4lessIjESaIjEEPKhjjb(ptr noundef %12, ptr noundef %59, i32 noundef %60, i32 noundef %61, i1 noundef zeroext true)
          to label %62 unwind label %80

62:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 1, ptr %15) #3
  %63 = call noundef i64 @_ZNKSt3setIjSt4lessIjESaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #3
  %64 = icmp ule i64 %63, 256
  %65 = zext i1 %64 to i8
  store i8 %65, ptr %15, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  store i32 0, ptr %18, align 4, !tbaa !9
  %66 = load i8, ptr %9, align 1, !tbaa !11, !range !18, !noundef !19
  %67 = trunc i8 %66 to i1
  br i1 %67, label %71, label %68

68:                                               ; preds = %62
  %69 = load i8, ptr %15, align 1, !tbaa !11, !range !18, !noundef !19
  %70 = trunc i8 %69 to i1
  br i1 %70, label %71, label %121

71:                                               ; preds = %68, %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  store i64 0, ptr %19, align 8, !tbaa !13
  br label %72

72:                                               ; preds = %116, %71
  %73 = load i64, ptr %19, align 8, !tbaa !13
  %74 = load i32, ptr %7, align 4, !tbaa !9
  %75 = load i32, ptr %8, align 4, !tbaa !9
  %76 = mul i32 %74, %75
  %77 = zext i32 %76 to i64
  %78 = icmp ult i64 %73, %77
  br i1 %78, label %84, label %79

79:                                               ; preds = %72
  store i32 5, ptr %11, align 4
  br label %119

80:                                               ; preds = %58
  %81 = landingpad { ptr, i32 }
          cleanup
  %82 = extractvalue { ptr, i32 } %81, 0
  store ptr %82, ptr %13, align 8
  %83 = extractvalue { ptr, i32 } %81, 1
  store i32 %83, ptr %14, align 4
  br label %309

84:                                               ; preds = %72
  %85 = load ptr, ptr %6, align 8, !tbaa !5
  %86 = load i64, ptr %19, align 8, !tbaa !13
  %87 = mul i64 %86, 4
  %88 = add i64 %87, 3
  %89 = getelementptr inbounds i8, ptr %85, i64 %88
  %90 = load i8, ptr %89, align 1, !tbaa !15
  %91 = zext i8 %90 to i32
  %92 = icmp eq i32 %91, 0
  br i1 %92, label %93, label %115

93:                                               ; preds = %84
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = load i64, ptr %19, align 8, !tbaa !13
  %96 = mul i64 %95, 4
  %97 = add i64 %96, 0
  %98 = getelementptr inbounds i8, ptr %94, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !15
  %100 = zext i8 %99 to i32
  store i32 %100, ptr %16, align 4, !tbaa !9
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = load i64, ptr %19, align 8, !tbaa !13
  %103 = mul i64 %102, 4
  %104 = add i64 %103, 1
  %105 = getelementptr inbounds i8, ptr %101, i64 %104
  %106 = load i8, ptr %105, align 1, !tbaa !15
  %107 = zext i8 %106 to i32
  store i32 %107, ptr %17, align 4, !tbaa !9
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = load i64, ptr %19, align 8, !tbaa !13
  %110 = mul i64 %109, 4
  %111 = add i64 %110, 2
  %112 = getelementptr inbounds i8, ptr %108, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !15
  %114 = zext i8 %113 to i32
  store i32 %114, ptr %18, align 4, !tbaa !9
  store i32 5, ptr %11, align 4
  br label %119

115:                                              ; preds = %84
  br label %116

116:                                              ; preds = %115
  %117 = load i64, ptr %19, align 8, !tbaa !13
  %118 = add i64 %117, 1
  store i64 %118, ptr %19, align 8, !tbaa !13
  br label %72, !llvm.loop !20

119:                                              ; preds = %93, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %120

120:                                              ; preds = %119
  br label %121

121:                                              ; preds = %120, %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  store i64 0, ptr %20, align 8, !tbaa !13
  br label %122

122:                                              ; preds = %191, %121
  %123 = load i64, ptr %20, align 8, !tbaa !13
  %124 = load i32, ptr %7, align 4, !tbaa !9
  %125 = load i32, ptr %8, align 4, !tbaa !9
  %126 = mul i32 %124, %125
  %127 = zext i32 %126 to i64
  %128 = icmp ult i64 %123, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %122
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  br label %194

130:                                              ; preds = %122
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = load i64, ptr %20, align 8, !tbaa !13
  %133 = mul i64 %132, 4
  %134 = add i64 %133, 3
  %135 = getelementptr inbounds i8, ptr %131, i64 %134
  %136 = load i8, ptr %135, align 1, !tbaa !15
  %137 = zext i8 %136 to i32
  %138 = icmp eq i32 %137, 0
  br i1 %138, label %139, label %161

139:                                              ; preds = %130
  %140 = load i32, ptr %16, align 4, !tbaa !9
  %141 = trunc i32 %140 to i8
  %142 = load ptr, ptr %6, align 8, !tbaa !5
  %143 = load i64, ptr %20, align 8, !tbaa !13
  %144 = mul i64 %143, 4
  %145 = add i64 %144, 0
  %146 = getelementptr inbounds i8, ptr %142, i64 %145
  store i8 %141, ptr %146, align 1, !tbaa !15
  %147 = load i32, ptr %17, align 4, !tbaa !9
  %148 = trunc i32 %147 to i8
  %149 = load ptr, ptr %6, align 8, !tbaa !5
  %150 = load i64, ptr %20, align 8, !tbaa !13
  %151 = mul i64 %150, 4
  %152 = add i64 %151, 1
  %153 = getelementptr inbounds i8, ptr %149, i64 %152
  store i8 %148, ptr %153, align 1, !tbaa !15
  %154 = load i32, ptr %18, align 4, !tbaa !9
  %155 = trunc i32 %154 to i8
  %156 = load ptr, ptr %6, align 8, !tbaa !5
  %157 = load i64, ptr %20, align 8, !tbaa !13
  %158 = mul i64 %157, 4
  %159 = add i64 %158, 2
  %160 = getelementptr inbounds i8, ptr %156, i64 %159
  store i8 %155, ptr %160, align 1, !tbaa !15
  br label %190

161:                                              ; preds = %130
  %162 = load i8, ptr %9, align 1, !tbaa !11, !range !18, !noundef !19
  %163 = trunc i8 %162 to i1
  br i1 %163, label %189, label %164

164:                                              ; preds = %161
  %165 = load i8, ptr %15, align 1, !tbaa !11, !range !18, !noundef !19
  %166 = trunc i8 %165 to i1
  br i1 %166, label %189, label %167

167:                                              ; preds = %164
  %168 = load ptr, ptr %6, align 8, !tbaa !5
  %169 = load i64, ptr %20, align 8, !tbaa !13
  %170 = mul i64 %169, 4
  %171 = add i64 %170, 0
  %172 = getelementptr inbounds i8, ptr %168, i64 %171
  %173 = load i8, ptr %172, align 1, !tbaa !15
  %174 = zext i8 %173 to i32
  store i32 %174, ptr %16, align 4, !tbaa !9
  %175 = load ptr, ptr %6, align 8, !tbaa !5
  %176 = load i64, ptr %20, align 8, !tbaa !13
  %177 = mul i64 %176, 4
  %178 = add i64 %177, 1
  %179 = getelementptr inbounds i8, ptr %175, i64 %178
  %180 = load i8, ptr %179, align 1, !tbaa !15
  %181 = zext i8 %180 to i32
  store i32 %181, ptr %17, align 4, !tbaa !9
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = load i64, ptr %20, align 8, !tbaa !13
  %184 = mul i64 %183, 4
  %185 = add i64 %184, 2
  %186 = getelementptr inbounds i8, ptr %182, i64 %185
  %187 = load i8, ptr %186, align 1, !tbaa !15
  %188 = zext i8 %187 to i32
  store i32 %188, ptr %18, align 4, !tbaa !9
  br label %189

189:                                              ; preds = %167, %164, %161
  br label %190

190:                                              ; preds = %189, %139
  br label %191

191:                                              ; preds = %190
  %192 = load i64, ptr %20, align 8, !tbaa !13
  %193 = add i64 %192, 1
  store i64 %193, ptr %20, align 8, !tbaa !13
  br label %122, !llvm.loop !21

194:                                              ; preds = %129
  %195 = load i8, ptr %15, align 1, !tbaa !11, !range !18, !noundef !19
  %196 = trunc i8 %195 to i1
  br i1 %196, label %197, label %307

197:                                              ; preds = %194
  %198 = load ptr, ptr %5, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.LodePNGState, ptr %198, i32 0, i32 3
  %200 = getelementptr inbounds %struct.LodePNGInfo, ptr %199, i32 0, i32 3
  %201 = getelementptr inbounds %struct.LodePNGColorMode, ptr %200, i32 0, i32 3
  %202 = load i64, ptr %201, align 8, !tbaa !22
  %203 = icmp ugt i64 %202, 0
  br i1 %203, label %204, label %307

204:                                              ; preds = %197
  %205 = load ptr, ptr %6, align 8, !tbaa !5
  %206 = load i32, ptr %7, align 4, !tbaa !9
  %207 = load i32, ptr %8, align 4, !tbaa !9
  invoke void @_Z11CountColorsPSt3setIjSt4lessIjESaIjEEPKhjjb(ptr noundef %12, ptr noundef %205, i32 noundef %206, i32 noundef %207, i1 noundef zeroext false)
          to label %208 unwind label %231

208:                                              ; preds = %204
  %209 = call noundef i64 @_ZNKSt3setIjSt4lessIjESaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %12) #3
  %210 = load ptr, ptr %5, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.LodePNGState, ptr %210, i32 0, i32 3
  %212 = getelementptr inbounds %struct.LodePNGInfo, ptr %211, i32 0, i32 3
  %213 = getelementptr inbounds %struct.LodePNGColorMode, ptr %212, i32 0, i32 3
  %214 = load i64, ptr %213, align 8, !tbaa !22
  %215 = icmp ult i64 %209, %214
  br i1 %215, label %216, label %306

216:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #3
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %217 = load ptr, ptr %5, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.LodePNGState, ptr %217, i32 0, i32 3
  %219 = getelementptr inbounds %struct.LodePNGInfo, ptr %218, i32 0, i32 3
  %220 = getelementptr inbounds %struct.LodePNGColorMode, ptr %219, i32 0, i32 2
  %221 = load ptr, ptr %220, align 8, !tbaa !33
  store ptr %221, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  store i64 0, ptr %23, align 8, !tbaa !13
  br label %222

222:                                              ; preds = %279, %216
  %223 = load i64, ptr %23, align 8, !tbaa !13
  %224 = load ptr, ptr %5, align 8, !tbaa !5
  %225 = getelementptr inbounds %struct.LodePNGState, ptr %224, i32 0, i32 3
  %226 = getelementptr inbounds %struct.LodePNGInfo, ptr %225, i32 0, i32 3
  %227 = getelementptr inbounds %struct.LodePNGColorMode, ptr %226, i32 0, i32 3
  %228 = load i64, ptr %227, align 8, !tbaa !22
  %229 = icmp ult i64 %223, %228
  br i1 %229, label %235, label %230

230:                                              ; preds = %222
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %283

231:                                              ; preds = %204
  %232 = landingpad { ptr, i32 }
          cleanup
  %233 = extractvalue { ptr, i32 } %232, 0
  store ptr %233, ptr %13, align 8
  %234 = extractvalue { ptr, i32 } %232, 1
  store i32 %234, ptr %14, align 4
  br label %308

235:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  %236 = load ptr, ptr %22, align 8, !tbaa !5
  %237 = load i64, ptr %23, align 8, !tbaa !13
  %238 = mul i64 %237, 4
  %239 = getelementptr inbounds i8, ptr %236, i64 %238
  %240 = invoke noundef i32 @_ZL10ColorIndexPKh(ptr noundef %239)
          to label %241 unwind label %270

241:                                              ; preds = %235
  store i32 %240, ptr %24, align 4, !tbaa !9
  %242 = invoke noundef i64 @_ZNKSt3setIjSt4lessIjESaIjEE5countERKj(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef nonnull align 4 dereferenceable(4) %24)
          to label %243 unwind label %270

243:                                              ; preds = %241
  %244 = icmp ne i64 %242, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  br i1 %244, label %245, label %278

245:                                              ; preds = %243
  %246 = load ptr, ptr %22, align 8, !tbaa !5
  %247 = load i64, ptr %23, align 8, !tbaa !13
  %248 = mul i64 %247, 4
  %249 = add i64 %248, 0
  %250 = getelementptr inbounds i8, ptr %246, i64 %249
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 1 dereferenceable(1) %250)
          to label %251 unwind label %274

251:                                              ; preds = %245
  %252 = load ptr, ptr %22, align 8, !tbaa !5
  %253 = load i64, ptr %23, align 8, !tbaa !13
  %254 = mul i64 %253, 4
  %255 = add i64 %254, 1
  %256 = getelementptr inbounds i8, ptr %252, i64 %255
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 1 dereferenceable(1) %256)
          to label %257 unwind label %274

257:                                              ; preds = %251
  %258 = load ptr, ptr %22, align 8, !tbaa !5
  %259 = load i64, ptr %23, align 8, !tbaa !13
  %260 = mul i64 %259, 4
  %261 = add i64 %260, 2
  %262 = getelementptr inbounds i8, ptr %258, i64 %261
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 1 dereferenceable(1) %262)
          to label %263 unwind label %274

263:                                              ; preds = %257
  %264 = load ptr, ptr %22, align 8, !tbaa !5
  %265 = load i64, ptr %23, align 8, !tbaa !13
  %266 = mul i64 %265, 4
  %267 = add i64 %266, 3
  %268 = getelementptr inbounds i8, ptr %264, i64 %267
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %21, ptr noundef nonnull align 1 dereferenceable(1) %268)
          to label %269 unwind label %274

269:                                              ; preds = %263
  br label %278

270:                                              ; preds = %241, %235
  %271 = landingpad { ptr, i32 }
          cleanup
  %272 = extractvalue { ptr, i32 } %271, 0
  store ptr %272, ptr %13, align 8
  %273 = extractvalue { ptr, i32 } %271, 1
  store i32 %273, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  br label %282

274:                                              ; preds = %263, %257, %251, %245
  %275 = landingpad { ptr, i32 }
          cleanup
  %276 = extractvalue { ptr, i32 } %275, 0
  store ptr %276, ptr %13, align 8
  %277 = extractvalue { ptr, i32 } %275, 1
  store i32 %277, ptr %14, align 4
  br label %282

278:                                              ; preds = %269, %243
  br label %279

279:                                              ; preds = %278
  %280 = load i64, ptr %23, align 8, !tbaa !13
  %281 = add i64 %280, 1
  store i64 %281, ptr %23, align 8, !tbaa !13
  br label %222, !llvm.loop !34

282:                                              ; preds = %274, %270
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #3
  br label %308

283:                                              ; preds = %230
  %284 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  %285 = udiv i64 %284, 4
  %286 = load ptr, ptr %5, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.LodePNGState, ptr %286, i32 0, i32 3
  %288 = getelementptr inbounds %struct.LodePNGInfo, ptr %287, i32 0, i32 3
  %289 = getelementptr inbounds %struct.LodePNGColorMode, ptr %288, i32 0, i32 3
  store i64 %285, ptr %289, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #3
  store i64 0, ptr %25, align 8, !tbaa !13
  br label %290

290:                                              ; preds = %302, %283
  %291 = load i64, ptr %25, align 8, !tbaa !13
  %292 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  %293 = icmp ult i64 %291, %292
  br i1 %293, label %295, label %294

294:                                              ; preds = %290
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  br label %305

295:                                              ; preds = %290
  %296 = load i64, ptr %25, align 8, !tbaa !13
  %297 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef %296) #3
  %298 = load i8, ptr %297, align 1, !tbaa !15
  %299 = load ptr, ptr %22, align 8, !tbaa !5
  %300 = load i64, ptr %25, align 8, !tbaa !13
  %301 = getelementptr inbounds i8, ptr %299, i64 %300
  store i8 %298, ptr %301, align 1, !tbaa !15
  br label %302

302:                                              ; preds = %295
  %303 = load i64, ptr %25, align 8, !tbaa !13
  %304 = add i64 %303, 1
  store i64 %304, ptr %25, align 8, !tbaa !13
  br label %290, !llvm.loop !35

305:                                              ; preds = %294
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #3
  br label %306

306:                                              ; preds = %305, %208
  br label %307

307:                                              ; preds = %306, %197, %194
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  call void @_ZNSt3setIjSt4lessIjESaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  ret void

308:                                              ; preds = %282, %231
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %15) #3
  br label %309

309:                                              ; preds = %308, %80
  call void @_ZNSt3setIjSt4lessIjESaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %12) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  br label %310

310:                                              ; preds = %309
  %311 = load ptr, ptr %13, align 8
  %312 = load i32, ptr %14, align 4
  %313 = insertvalue { ptr, i32 } poison, ptr %311, 0
  %314 = insertvalue { ptr, i32 } %313, i32 %312, 1
  resume { ptr, i32 } %314
}

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 = !{!"bool", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !17}
!21 = distinct !{!21, !17}
!22 = !{!23, !14, i64 240}
!23 = !{!"_ZTS12LodePNGState", !24, i64 0, !26, i64 80, !29, i64 168, !31, i64 208, !10, i64 520}
!24 = !{!"_ZTS22LodePNGDecoderSettings", !25, i64 0, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !14, i64 64, !14, i64 72}
!25 = !{!"_ZTS25LodePNGDecompressSettings", !10, i64 0, !10, i64 4, !14, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!26 = !{!"_ZTS22LodePNGEncoderSettings", !27, i64 0, !10, i64 48, !10, i64 52, !28, i64 56, !6, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!27 = !{!"_ZTS23LodePNGCompressSettings", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!28 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!29 = !{!"_ZTS16LodePNGColorMode", !30, i64 0, !10, i64 4, !6, i64 8, !14, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!30 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!31 = !{!"_ZTS11LodePNGInfo", !10, i64 0, !10, i64 4, !10, i64 8, !29, i64 16, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !14, i64 72, !6, i64 80, !6, i64 88, !14, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !32, i64 140, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !6, i64 240, !6, i64 248, !10, i64 256, !7, i64 264, !7, i64 288}
!32 = !{!"_ZTS11LodePNGTime", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!33 = !{!23, !6, i64 232}
!34 = distinct !{!34, !17}
!35 = distinct !{!35, !17}


; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.8" = type { %"struct.std::_Vector_base.9" }
%"struct.std::_Vector_base.9" = 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11CountColorsPSt3setIjSt4lessIjESaIjEEPKhjjb(ptr noundef, ptr noundef, i32 noundef, i32 noundef, i1 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZL10ColorIndexPKh(ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z24LossyOptimizeTransparentPN7lodepng5StateEPhjj(ptr nocapture noundef %0, ptr noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::set", align 8
  %6 = alloca %"class.std::vector.8", align 8
  %7 = alloca i32, align 4
  %8 = mul i32 %3, %2
  %9 = zext i32 %8 to i64
  %.not97106 = icmp eq i32 %8, 0
  br i1 %.not97106, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %4, %14
  %.not97108 = phi i1 [ %.not97, %14 ], [ false, %4 ]
  %.088107 = phi i64 [ %15, %14 ], [ 0, %4 ]
  %10 = shl nuw nsw i64 %.088107, 2
  %11 = or disjoint i64 %10, 3
  %12 = getelementptr inbounds i8, ptr %1, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !5
  switch i8 %13, label %._crit_edge [
    i8 0, label %14
    i8 -1, label %14
  ]

14:                                               ; preds = %.lr.ph, %.lr.ph
  %15 = add nuw nsw i64 %.088107, 1
  %.not97 = icmp uge i64 %15, %9
  %exitcond = icmp eq i64 %15, %9
  br i1 %exitcond, label %._crit_edge, label %.lr.ph, !llvm.loop !8

._crit_edge:                                      ; preds = %14, %.lr.ph, %4
  %.not97.lcssa = phi i1 [ true, %4 ], [ %.not97108, %.lr.ph ], [ %.not97, %14 ]
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %5) #3
  call void @_ZNSt3setIjSt4lessIjESaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #3
  invoke void @_Z11CountColorsPSt3setIjSt4lessIjESaIjEEPKhjjb(ptr noundef nonnull %5, ptr noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext true)
          to label %16 unwind label %22

16:                                               ; preds = %._crit_edge
  %17 = call noundef i64 @_ZNKSt3setIjSt4lessIjESaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #3
  %18 = icmp ult i64 %17, 257
  %brmerge = or i1 %.not97.lcssa, %18
  %19 = icmp ne i32 %8, 0
  %or.cond = and i1 %brmerge, %19
  br i1 %or.cond, label %.lr.ph114, label %.loopexit

20:                                               ; preds = %.lr.ph114
  %21 = add nuw nsw i64 %.078113, 1
  %exitcond134.not = icmp eq i64 %21, %9
  br i1 %exitcond134.not, label %.loopexit, label %.lr.ph114, !llvm.loop !10

22:                                               ; preds = %._crit_edge
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %116

.lr.ph114:                                        ; preds = %16, %20
  %.078113 = phi i64 [ %21, %20 ], [ 0, %16 ]
  %24 = shl nuw nsw i64 %.078113, 2
  %25 = or disjoint i64 %24, 3
  %26 = getelementptr inbounds i8, ptr %1, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !5
  %28 = icmp eq i8 %27, 0
  br i1 %28, label %29, label %20

29:                                               ; preds = %.lr.ph114
  %30 = getelementptr inbounds i8, ptr %1, i64 %24
  %31 = load i8, ptr %30, align 1, !tbaa !5
  %32 = or disjoint i64 %24, 1
  %33 = getelementptr inbounds i8, ptr %1, i64 %32
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %35 = or disjoint i64 %24, 2
  %36 = getelementptr inbounds i8, ptr %1, i64 %35
  %37 = load i8, ptr %36, align 1, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %20, %29, %16
  %.185 = phi i8 [ 0, %16 ], [ %31, %29 ], [ 0, %20 ]
  %.181 = phi i8 [ 0, %16 ], [ %34, %29 ], [ 0, %20 ]
  %.1 = phi i8 [ 0, %16 ], [ %37, %29 ], [ 0, %20 ]
  br i1 %.not97106, label %._crit_edge121, label %.lr.ph120

.lr.ph120:                                        ; preds = %.loopexit
  br i1 %brmerge, label %.lr.ph120.split.us, label %.lr.ph120.split

.lr.ph120.split.us:                               ; preds = %.lr.ph120, %49
  %.077118.us = phi i64 [ %50, %49 ], [ 0, %.lr.ph120 ]
  %38 = shl nuw nsw i64 %.077118.us, 2
  %39 = or disjoint i64 %38, 3
  %40 = getelementptr inbounds i8, ptr %1, i64 %39
  %41 = load i8, ptr %40, align 1, !tbaa !5
  %42 = icmp eq i8 %41, 0
  br i1 %42, label %43, label %49

43:                                               ; preds = %.lr.ph120.split.us
  %44 = getelementptr inbounds i8, ptr %1, i64 %38
  store i8 %.185, ptr %44, align 1, !tbaa !5
  %45 = or disjoint i64 %38, 1
  %46 = getelementptr inbounds i8, ptr %1, i64 %45
  store i8 %.181, ptr %46, align 1, !tbaa !5
  %47 = or disjoint i64 %38, 2
  %48 = getelementptr inbounds i8, ptr %1, i64 %47
  store i8 %.1, ptr %48, align 1, !tbaa !5
  br label %49

49:                                               ; preds = %.lr.ph120.split.us, %43
  %50 = add nuw nsw i64 %.077118.us, 1
  %exitcond136.not = icmp eq i64 %50, %9
  br i1 %exitcond136.not, label %._crit_edge121, label %.lr.ph120.split.us, !llvm.loop !11

._crit_edge121:                                   ; preds = %66, %49, %.loopexit
  br i1 %18, label %68, label %115

.lr.ph120.split:                                  ; preds = %.lr.ph120, %66
  %.077118 = phi i64 [ %67, %66 ], [ 0, %.lr.ph120 ]
  %.2117 = phi i8 [ %.3, %66 ], [ %.1, %.lr.ph120 ]
  %.282116 = phi i8 [ %.383, %66 ], [ %.181, %.lr.ph120 ]
  %.286115 = phi i8 [ %.387, %66 ], [ %.185, %.lr.ph120 ]
  %51 = shl nuw nsw i64 %.077118, 2
  %52 = or disjoint i64 %51, 3
  %53 = getelementptr inbounds i8, ptr %1, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !5
  %55 = icmp eq i8 %54, 0
  %56 = getelementptr inbounds i8, ptr %1, i64 %51
  %57 = or disjoint i64 %51, 1
  %58 = getelementptr inbounds i8, ptr %1, i64 %57
  %59 = or disjoint i64 %51, 2
  %60 = getelementptr inbounds i8, ptr %1, i64 %59
  br i1 %55, label %61, label %62

61:                                               ; preds = %.lr.ph120.split
  store i8 %.286115, ptr %56, align 1, !tbaa !5
  store i8 %.282116, ptr %58, align 1, !tbaa !5
  store i8 %.2117, ptr %60, align 1, !tbaa !5
  br label %66

62:                                               ; preds = %.lr.ph120.split
  %63 = load i8, ptr %56, align 1, !tbaa !5
  %64 = load i8, ptr %58, align 1, !tbaa !5
  %65 = load i8, ptr %60, align 1, !tbaa !5
  br label %66

66:                                               ; preds = %61, %62
  %.387 = phi i8 [ %.286115, %61 ], [ %63, %62 ]
  %.383 = phi i8 [ %.282116, %61 ], [ %64, %62 ]
  %.3 = phi i8 [ %.2117, %61 ], [ %65, %62 ]
  %67 = add nuw nsw i64 %.077118, 1
  %exitcond135.not = icmp eq i64 %67, %9
  br i1 %exitcond135.not, label %._crit_edge121, label %.lr.ph120.split, !llvm.loop !11

68:                                               ; preds = %._crit_edge121
  %69 = getelementptr inbounds i8, ptr %0, i64 240
  %70 = load i64, ptr %69, align 8, !tbaa !12
  %.not98 = icmp eq i64 %70, 0
  br i1 %.not98, label %115, label %71

71:                                               ; preds = %68
  invoke void @_Z11CountColorsPSt3setIjSt4lessIjESaIjEEPKhjjb(ptr noundef nonnull %5, ptr noundef %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext false)
          to label %72 unwind label %83

72:                                               ; preds = %71
  %73 = call noundef i64 @_ZNKSt3setIjSt4lessIjESaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(48) %5) #3
  %74 = load i64, ptr %69, align 8, !tbaa !12
  %75 = icmp ult i64 %73, %74
  br i1 %75, label %76, label %115

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #3
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  %77 = getelementptr inbounds i8, ptr %0, i64 232
  %78 = load ptr, ptr %77, align 8, !tbaa !26
  %79 = load i64, ptr %69, align 8, !tbaa !12
  %.not130 = icmp eq i64 %79, 0
  br i1 %.not130, label %._crit_edge125, label %.lr.ph124

._crit_edge125:                                   ; preds = %104, %76
  %80 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  %81 = lshr i64 %80, 2
  store i64 %81, ptr %69, align 8, !tbaa !12
  %82 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  %.not131 = icmp eq i64 %82, 0
  br i1 %.not131, label %._crit_edge129, label %.lr.ph128

83:                                               ; preds = %71
  %84 = landingpad { ptr, i32 }
          cleanup
  br label %116

.lr.ph124:                                        ; preds = %76, %104
  %.075122 = phi i64 [ %105, %104 ], [ 0, %76 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  %85 = shl i64 %.075122, 2
  %86 = getelementptr inbounds i8, ptr %78, i64 %85
  %87 = call noundef i32 @_ZL10ColorIndexPKh(ptr noundef %86)
  store i32 %87, ptr %7, align 4, !tbaa !27
  %88 = invoke noundef i64 @_ZNKSt3setIjSt4lessIjESaIjEE5countERKj(ptr noundef nonnull align 8 dereferenceable(48) %5, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %89 unwind label %100

89:                                               ; preds = %.lr.ph124
  %.not99 = icmp eq i64 %88, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br i1 %.not99, label %104, label %90

90:                                               ; preds = %89
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 1 dereferenceable(1) %86)
          to label %91 unwind label %102

91:                                               ; preds = %90
  %92 = or disjoint i64 %85, 1
  %93 = getelementptr inbounds i8, ptr %78, i64 %92
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 1 dereferenceable(1) %93)
          to label %94 unwind label %102

94:                                               ; preds = %91
  %95 = or disjoint i64 %85, 2
  %96 = getelementptr inbounds i8, ptr %78, i64 %95
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 1 dereferenceable(1) %96)
          to label %97 unwind label %102

97:                                               ; preds = %94
  %98 = or disjoint i64 %85, 3
  %99 = getelementptr inbounds i8, ptr %78, i64 %98
  invoke void @_ZNSt6vectorIhSaIhEE9push_backERKh(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 1 dereferenceable(1) %99)
          to label %104 unwind label %102

100:                                              ; preds = %.lr.ph124
  %101 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  br label %108

102:                                              ; preds = %97, %94, %91, %90
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %108

104:                                              ; preds = %89, %97
  %105 = add nuw i64 %.075122, 1
  %106 = load i64, ptr %69, align 8, !tbaa !12
  %107 = icmp ult i64 %105, %106
  br i1 %107, label %.lr.ph124, label %._crit_edge125, !llvm.loop !28

108:                                              ; preds = %102, %100
  %.pn = phi { ptr, i32 } [ %103, %102 ], [ %101, %100 ]
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  br label %116

._crit_edge129:                                   ; preds = %.lr.ph128, %._crit_edge125
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #3
  br label %115

.lr.ph128:                                        ; preds = %._crit_edge125, %.lr.ph128
  %.0126 = phi i64 [ %112, %.lr.ph128 ], [ 0, %._crit_edge125 ]
  %109 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %.0126) #3
  %110 = load i8, ptr %109, align 1, !tbaa !5
  %111 = getelementptr inbounds i8, ptr %78, i64 %.0126
  store i8 %110, ptr %111, align 1, !tbaa !5
  %112 = add nuw i64 %.0126, 1
  %113 = call noundef i64 @_ZNKSt6vectorIhSaIhEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #3
  %114 = icmp ult i64 %112, %113
  br i1 %114, label %.lr.ph128, label %._crit_edge129, !llvm.loop !29

115:                                              ; preds = %72, %._crit_edge129, %68, %._crit_edge121
  call void @_ZNSt3setIjSt4lessIjESaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #3
  ret void

116:                                              ; preds = %83, %108, %22
  %.pn.pn.pn = phi { ptr, i32 } [ %23, %22 ], [ %.pn, %108 ], [ %84, %83 ]
  call void @_ZNSt3setIjSt4lessIjESaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %5) #3
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %5) #3
  resume { ptr, i32 } %.pn.pn.pn
}

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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}
!12 = !{!13, !17, i64 240}
!13 = !{!"_ZTS12LodePNGState", !14, i64 0, !19, i64 80, !22, i64 168, !24, i64 208, !16, i64 520}
!14 = !{!"_ZTS22LodePNGDecoderSettings", !15, i64 0, !16, i64 40, !16, i64 44, !16, i64 48, !16, i64 52, !16, i64 56, !16, i64 60, !17, i64 64, !17, i64 72}
!15 = !{!"_ZTS25LodePNGDecompressSettings", !16, i64 0, !16, i64 4, !17, i64 8, !18, i64 16, !18, i64 24, !18, i64 32}
!16 = !{!"int", !6, i64 0}
!17 = !{!"long", !6, i64 0}
!18 = !{!"any pointer", !6, i64 0}
!19 = !{!"_ZTS22LodePNGEncoderSettings", !20, i64 0, !16, i64 48, !16, i64 52, !21, i64 56, !18, i64 64, !16, i64 72, !16, i64 76, !16, i64 80}
!20 = !{!"_ZTS23LodePNGCompressSettings", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20, !18, i64 24, !18, i64 32, !18, i64 40}
!21 = !{!"_ZTS21LodePNGFilterStrategy", !6, i64 0}
!22 = !{!"_ZTS16LodePNGColorMode", !23, i64 0, !16, i64 4, !18, i64 8, !17, i64 16, !16, i64 24, !16, i64 28, !16, i64 32, !16, i64 36}
!23 = !{!"_ZTS16LodePNGColorType", !6, i64 0}
!24 = !{!"_ZTS11LodePNGInfo", !16, i64 0, !16, i64 4, !16, i64 8, !22, i64 16, !16, i64 56, !16, i64 60, !16, i64 64, !16, i64 68, !17, i64 72, !18, i64 80, !18, i64 88, !17, i64 96, !18, i64 104, !18, i64 112, !18, i64 120, !18, i64 128, !16, i64 136, !25, i64 140, !16, i64 164, !16, i64 168, !16, i64 172, !16, i64 176, !16, i64 180, !16, i64 184, !16, i64 188, !16, i64 192, !16, i64 196, !16, i64 200, !16, i64 204, !16, i64 208, !16, i64 212, !16, i64 216, !16, i64 220, !16, i64 224, !16, i64 228, !16, i64 232, !18, i64 240, !18, i64 248, !16, i64 256, !6, i64 264, !6, i64 288}
!25 = !{!"_ZTS11LodePNGTime", !16, i64 0, !16, i64 4, !16, i64 8, !16, i64 12, !16, i64 16, !16, i64 20}
!26 = !{!13, !18, i64 232}
!27 = !{!16, !16, i64 0}
!28 = distinct !{!28, !9}
!29 = distinct !{!29, !9}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass