; LLVM IR from alibaba/GCanvas :: core/test/linux/util/lodepng.ll (Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj)

; 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.ColorTree = type { [16 x ptr], i32 }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, 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 noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef, i32 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) #1 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca %struct.ColorTree, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i16, align 2
  %26 = alloca i16, align 2
  %27 = alloca i16, align 2
  %28 = alloca i16, align 2
  %29 = alloca i8, align 1
  %30 = alloca i8, align 1
  %31 = alloca i8, align 1
  %32 = alloca i8, align 1
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store i32 %4, ptr %12, align 4, !tbaa !9
  store i32 %5, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 136, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  %33 = load i32, ptr %12, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = load i32, ptr %13, align 4, !tbaa !9
  %36 = zext i32 %35 to i64
  %37 = mul i64 %34, %36
  store i64 %37, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !9
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.LodePNGColorMode, ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 8, !tbaa !13
  %41 = icmp eq i32 %40, 3
  br i1 %41, label %42, label %48

42:                                               ; preds = %6
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.LodePNGColorMode, ptr %43, i32 0, i32 2
  %45 = load ptr, ptr %44, align 8, !tbaa !16
  %46 = icmp ne ptr %45, null
  br i1 %46, label %48, label %47

47:                                               ; preds = %42
  store i32 107, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %266

48:                                               ; preds = %42, %6
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef %49, ptr noundef %50)
  %52 = icmp ne i32 %51, 0
  br i1 %52, label %53, label %74

53:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %54 = load i32, ptr %12, align 4, !tbaa !9
  %55 = load i32, ptr %13, align 4, !tbaa !9
  %56 = load ptr, ptr %11, align 8, !tbaa !5
  %57 = call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %54, i32 noundef %55, ptr noundef %56)
  store i64 %57, ptr %19, align 8, !tbaa !11
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %58

58:                                               ; preds = %70, %53
  %59 = load i64, ptr %14, align 8, !tbaa !11
  %60 = load i64, ptr %19, align 8, !tbaa !11
  %61 = icmp ne i64 %59, %60
  br i1 %61, label %62, label %73

62:                                               ; preds = %58
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  %64 = load i64, ptr %14, align 8, !tbaa !11
  %65 = getelementptr inbounds i8, ptr %63, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !17
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = load i64, ptr %14, align 8, !tbaa !11
  %69 = getelementptr inbounds i8, ptr %67, i64 %68
  store i8 %66, ptr %69, align 1, !tbaa !17
  br label %70

70:                                               ; preds = %62
  %71 = load i64, ptr %14, align 8, !tbaa !11
  %72 = add i64 %71, 1
  store i64 %72, ptr %14, align 8, !tbaa !11
  br label %58, !llvm.loop !18

73:                                               ; preds = %58
  store i32 0, ptr %7, align 4
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  br label %266

74:                                               ; preds = %48
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.LodePNGColorMode, ptr %75, i32 0, i32 0
  %77 = load i32, ptr %76, align 8, !tbaa !13
  %78 = icmp eq i32 %77, 3
  br i1 %78, label %79, label %171

79:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %80 = load ptr, ptr %10, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.LodePNGColorMode, ptr %80, i32 0, i32 3
  %82 = load i64, ptr %81, align 8, !tbaa !20
  store i64 %82, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.LodePNGColorMode, ptr %83, i32 0, i32 2
  %85 = load ptr, ptr %84, align 8, !tbaa !16
  store ptr %85, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %86 = load ptr, ptr %10, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.LodePNGColorMode, ptr %86, i32 0, i32 1
  %88 = load i32, ptr %87, align 4, !tbaa !21
  %89 = zext i32 %88 to i64
  %90 = shl i64 1, %89
  store i64 %90, ptr %22, align 8, !tbaa !11
  %91 = load i64, ptr %20, align 8, !tbaa !11
  %92 = icmp eq i64 %91, 0
  br i1 %92, label %93, label %134

93:                                               ; preds = %79
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.LodePNGColorMode, ptr %94, i32 0, i32 3
  %96 = load i64, ptr %95, align 8, !tbaa !20
  store i64 %96, ptr %20, align 8, !tbaa !11
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.LodePNGColorMode, ptr %97, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8, !tbaa !16
  store ptr %99, ptr %21, align 8, !tbaa !5
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.LodePNGColorMode, ptr %100, i32 0, i32 0
  %102 = load i32, ptr %101, align 8, !tbaa !13
  %103 = icmp eq i32 %102, 3
  br i1 %103, label %104, label %133

104:                                              ; preds = %93
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.LodePNGColorMode, ptr %105, i32 0, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !21
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.LodePNGColorMode, ptr %108, i32 0, i32 1
  %110 = load i32, ptr %109, align 4, !tbaa !21
  %111 = icmp eq i32 %107, %110
  br i1 %111, label %112, label %133

112:                                              ; preds = %104
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %113 = load i32, ptr %12, align 4, !tbaa !9
  %114 = load i32, ptr %13, align 4, !tbaa !9
  %115 = load ptr, ptr %11, align 8, !tbaa !5
  %116 = call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %113, i32 noundef %114, ptr noundef %115)
  store i64 %116, ptr %23, align 8, !tbaa !11
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %117

117:                                              ; preds = %129, %112
  %118 = load i64, ptr %14, align 8, !tbaa !11
  %119 = load i64, ptr %23, align 8, !tbaa !11
  %120 = icmp ne i64 %118, %119
  br i1 %120, label %121, label %132

121:                                              ; preds = %117
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = load i64, ptr %14, align 8, !tbaa !11
  %124 = getelementptr inbounds i8, ptr %122, i64 %123
  %125 = load i8, ptr %124, align 1, !tbaa !17
  %126 = load ptr, ptr %8, align 8, !tbaa !5
  %127 = load i64, ptr %14, align 8, !tbaa !11
  %128 = getelementptr inbounds i8, ptr %126, i64 %127
  store i8 %125, ptr %128, align 1, !tbaa !17
  br label %129

129:                                              ; preds = %121
  %130 = load i64, ptr %14, align 8, !tbaa !11
  %131 = add i64 %130, 1
  store i64 %131, ptr %14, align 8, !tbaa !11
  br label %117, !llvm.loop !22

132:                                              ; preds = %117
  store i32 0, ptr %7, align 4
  store i32 1, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %168

133:                                              ; preds = %104, %93
  br label %134

134:                                              ; preds = %133, %79
  %135 = load i64, ptr %20, align 8, !tbaa !11
  %136 = load i64, ptr %22, align 8, !tbaa !11
  %137 = icmp ult i64 %135, %136
  br i1 %137, label %138, label %140

138:                                              ; preds = %134
  %139 = load i64, ptr %20, align 8, !tbaa !11
  store i64 %139, ptr %22, align 8, !tbaa !11
  br label %140

140:                                              ; preds = %138, %134
  call void @_ZL15color_tree_initP9ColorTree(ptr noundef %15)
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %141

141:                                              ; preds = %164, %140
  %142 = load i64, ptr %14, align 8, !tbaa !11
  %143 = load i64, ptr %22, align 8, !tbaa !11
  %144 = icmp ne i64 %142, %143
  br i1 %144, label %145, label %167

145:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %146 = load ptr, ptr %21, align 8, !tbaa !5
  %147 = load i64, ptr %14, align 8, !tbaa !11
  %148 = mul i64 %147, 4
  %149 = getelementptr inbounds i8, ptr %146, i64 %148
  store ptr %149, ptr %24, align 8, !tbaa !5
  %150 = load ptr, ptr %24, align 8, !tbaa !5
  %151 = getelementptr inbounds i8, ptr %150, i64 0
  %152 = load i8, ptr %151, align 1, !tbaa !17
  %153 = load ptr, ptr %24, align 8, !tbaa !5
  %154 = getelementptr inbounds i8, ptr %153, i64 1
  %155 = load i8, ptr %154, align 1, !tbaa !17
  %156 = load ptr, ptr %24, align 8, !tbaa !5
  %157 = getelementptr inbounds i8, ptr %156, i64 2
  %158 = load i8, ptr %157, align 1, !tbaa !17
  %159 = load ptr, ptr %24, align 8, !tbaa !5
  %160 = getelementptr inbounds i8, ptr %159, i64 3
  %161 = load i8, ptr %160, align 1, !tbaa !17
  %162 = load i64, ptr %14, align 8, !tbaa !11
  %163 = trunc i64 %162 to i32
  call void @_ZL14color_tree_addP9ColorTreehhhhj(ptr noundef %15, i8 noundef zeroext %152, i8 noundef zeroext %155, i8 noundef zeroext %158, i8 noundef zeroext %161, i32 noundef %163)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  br label %164

164:                                              ; preds = %145
  %165 = load i64, ptr %14, align 8, !tbaa !11
  %166 = add i64 %165, 1
  store i64 %166, ptr %14, align 8, !tbaa !11
  br label %141, !llvm.loop !23

167:                                              ; preds = %141
  store i32 0, ptr %18, align 4
  br label %168

168:                                              ; preds = %167, %132
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  %169 = load i32, ptr %18, align 4
  switch i32 %169, label %266 [
    i32 0, label %170
  ]

170:                                              ; preds = %168
  br label %171

171:                                              ; preds = %170, %74
  %172 = load ptr, ptr %11, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.LodePNGColorMode, ptr %172, i32 0, i32 1
  %174 = load i32, ptr %173, align 4, !tbaa !21
  %175 = icmp eq i32 %174, 16
  br i1 %175, label %176, label %201

176:                                              ; preds = %171
  %177 = load ptr, ptr %10, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.LodePNGColorMode, ptr %177, i32 0, i32 1
  %179 = load i32, ptr %178, align 4, !tbaa !21
  %180 = icmp eq i32 %179, 16
  br i1 %180, label %181, label %201

181:                                              ; preds = %176
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %182

182:                                              ; preds = %197, %181
  %183 = load i64, ptr %14, align 8, !tbaa !11
  %184 = load i64, ptr %16, align 8, !tbaa !11
  %185 = icmp ne i64 %183, %184
  br i1 %185, label %186, label %200

186:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 2, ptr %25) #3
  store i16 0, ptr %25, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 2, ptr %26) #3
  store i16 0, ptr %26, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 2, ptr %27) #3
  store i16 0, ptr %27, align 2, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 2, ptr %28) #3
  store i16 0, ptr %28, align 2, !tbaa !24
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = load i64, ptr %14, align 8, !tbaa !11
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZL19getPixelColorRGBA16PtS_S_S_PKhmPK16LodePNGColorMode(ptr noundef %25, ptr noundef %26, ptr noundef %27, ptr noundef %28, ptr noundef %187, i64 noundef %188, ptr noundef %189)
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = load i64, ptr %14, align 8, !tbaa !11
  %192 = load ptr, ptr %10, align 8, !tbaa !5
  %193 = load i16, ptr %25, align 2, !tbaa !24
  %194 = load i16, ptr %26, align 2, !tbaa !24
  %195 = load i16, ptr %27, align 2, !tbaa !24
  %196 = load i16, ptr %28, align 2, !tbaa !24
  call void @_ZL13rgba16ToPixelPhmPK16LodePNGColorModetttt(ptr noundef %190, i64 noundef %191, ptr noundef %192, i16 noundef zeroext %193, i16 noundef zeroext %194, i16 noundef zeroext %195, i16 noundef zeroext %196)
  call void @llvm.lifetime.end.p0(i64 2, ptr %28) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %25) #3
  br label %197

197:                                              ; preds = %186
  %198 = load i64, ptr %14, align 8, !tbaa !11
  %199 = add i64 %198, 1
  store i64 %199, ptr %14, align 8, !tbaa !11
  br label %182, !llvm.loop !26

200:                                              ; preds = %182
  br label %258

201:                                              ; preds = %176, %171
  %202 = load ptr, ptr %10, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.LodePNGColorMode, ptr %202, i32 0, i32 1
  %204 = load i32, ptr %203, align 4, !tbaa !21
  %205 = icmp eq i32 %204, 8
  br i1 %205, label %206, label %216

206:                                              ; preds = %201
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.LodePNGColorMode, ptr %207, i32 0, i32 0
  %209 = load i32, ptr %208, align 8, !tbaa !13
  %210 = icmp eq i32 %209, 6
  br i1 %210, label %211, label %216

211:                                              ; preds = %206
  %212 = load ptr, ptr %8, align 8, !tbaa !5
  %213 = load i64, ptr %16, align 8, !tbaa !11
  %214 = load ptr, ptr %9, align 8, !tbaa !5
  %215 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZL19getPixelColorsRGBA8PhmPKhPK16LodePNGColorMode(ptr noundef %212, i64 noundef %213, ptr noundef %214, ptr noundef %215)
  br label %257

216:                                              ; preds = %206, %201
  %217 = load ptr, ptr %10, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.LodePNGColorMode, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !21
  %220 = icmp eq i32 %219, 8
  br i1 %220, label %221, label %231

221:                                              ; preds = %216
  %222 = load ptr, ptr %10, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.LodePNGColorMode, ptr %222, i32 0, i32 0
  %224 = load i32, ptr %223, align 8, !tbaa !13
  %225 = icmp eq i32 %224, 2
  br i1 %225, label %226, label %231

226:                                              ; preds = %221
  %227 = load ptr, ptr %8, align 8, !tbaa !5
  %228 = load i64, ptr %16, align 8, !tbaa !11
  %229 = load ptr, ptr %9, align 8, !tbaa !5
  %230 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZL18getPixelColorsRGB8PhmPKhPK16LodePNGColorMode(ptr noundef %227, i64 noundef %228, ptr noundef %229, ptr noundef %230)
  br label %256

231:                                              ; preds = %221, %216
  call void @llvm.lifetime.start.p0(i64 1, ptr %29) #3
  store i8 0, ptr %29, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #3
  store i8 0, ptr %30, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %31) #3
  store i8 0, ptr %31, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 1, ptr %32) #3
  store i8 0, ptr %32, align 1, !tbaa !17
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %232

232:                                              ; preds = %252, %231
  %233 = load i64, ptr %14, align 8, !tbaa !11
  %234 = load i64, ptr %16, align 8, !tbaa !11
  %235 = icmp ne i64 %233, %234
  br i1 %235, label %236, label %255

236:                                              ; preds = %232
  %237 = load ptr, ptr %9, align 8, !tbaa !5
  %238 = load i64, ptr %14, align 8, !tbaa !11
  %239 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZL18getPixelColorRGBA8PhS_S_S_PKhmPK16LodePNGColorMode(ptr noundef %29, ptr noundef %30, ptr noundef %31, ptr noundef %32, ptr noundef %237, i64 noundef %238, ptr noundef %239)
  %240 = load ptr, ptr %8, align 8, !tbaa !5
  %241 = load i64, ptr %14, align 8, !tbaa !11
  %242 = load ptr, ptr %10, align 8, !tbaa !5
  %243 = load i8, ptr %29, align 1, !tbaa !17
  %244 = load i8, ptr %30, align 1, !tbaa !17
  %245 = load i8, ptr %31, align 1, !tbaa !17
  %246 = load i8, ptr %32, align 1, !tbaa !17
  %247 = call noundef i32 @_ZL12rgba8ToPixelPhmPK16LodePNGColorModeP9ColorTreehhhh(ptr noundef %240, i64 noundef %241, ptr noundef %242, ptr noundef %15, i8 noundef zeroext %243, i8 noundef zeroext %244, i8 noundef zeroext %245, i8 noundef zeroext %246)
  store i32 %247, ptr %17, align 4, !tbaa !9
  %248 = load i32, ptr %17, align 4, !tbaa !9
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %250, label %251

250:                                              ; preds = %236
  br label %255

251:                                              ; preds = %236
  br label %252

252:                                              ; preds = %251
  %253 = load i64, ptr %14, align 8, !tbaa !11
  %254 = add i64 %253, 1
  store i64 %254, ptr %14, align 8, !tbaa !11
  br label %232, !llvm.loop !27

255:                                              ; preds = %250, %232
  call void @llvm.lifetime.end.p0(i64 1, ptr %32) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %31) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %29) #3
  br label %256

256:                                              ; preds = %255, %226
  br label %257

257:                                              ; preds = %256, %211
  br label %258

258:                                              ; preds = %257, %200
  %259 = load ptr, ptr %10, align 8, !tbaa !5
  %260 = getelementptr inbounds %struct.LodePNGColorMode, ptr %259, i32 0, i32 0
  %261 = load i32, ptr %260, align 8, !tbaa !13
  %262 = icmp eq i32 %261, 3
  br i1 %262, label %263, label %264

263:                                              ; preds = %258
  call void @_ZL18color_tree_cleanupP9ColorTree(ptr noundef %15)
  br label %264

264:                                              ; preds = %263, %258
  %265 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %265, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %266

266:                                              ; preds = %264, %168, %73, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 136, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %267 = load i32, ptr %7, align 4
  ret i32 %267
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL14color_tree_addP9ColorTreehhhhj(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL19getPixelColorRGBA16PtS_S_S_PKhmPK16LodePNGColorMode(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13rgba16ToPixelPhmPK16LodePNGColorModetttt(ptr noundef, i64 noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL19getPixelColorsRGBA8PhmPKhPK16LodePNGColorMode(ptr noalias noundef, i64 noundef, ptr noalias noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18getPixelColorsRGB8PhmPKhPK16LodePNGColorMode(ptr noalias noundef, i64 noundef, ptr noalias noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18getPixelColorRGBA8PhS_S_S_PKhmPK16LodePNGColorMode(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL12rgba8ToPixelPhmPK16LodePNGColorModeP9ColorTreehhhh(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18color_tree_cleanupP9ColorTree(ptr noundef) #1

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 = !{!"long", !7, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"_ZTS16LodePNGColorMode", !15, i64 0, !10, i64 4, !6, i64 8, !12, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!15 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!16 = !{!14, !6, i64 8}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!14, !12, i64 16}
!21 = !{!14, !10, i64 4}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}
!24 = !{!25, !25, i64 0}
!25 = !{!"short", !7, i64 0}
!26 = distinct !{!26, !19}
!27 = distinct !{!27, !19}


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

%struct.ColorTree = type { [16 x ptr], i32 }

; 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 noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #1 {
  %7 = ptrtoint ptr %1 to i64
  %8 = ptrtoint ptr %0 to i64
  %9 = ptrtoint ptr %1 to i64
  %10 = ptrtoint ptr %0 to i64
  %11 = alloca %struct.ColorTree, align 8
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca i16, align 2
  %15 = alloca i16, align 2
  %16 = alloca i8, align 1
  %17 = alloca i8, align 1
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  call void @llvm.lifetime.start.p0(i64 136, ptr nonnull %11) #4
  %20 = zext i32 %4 to i64
  %21 = zext i32 %5 to i64
  %22 = mul nuw i64 %21, %20
  %23 = load i32, ptr %3, align 8, !tbaa !5
  %24 = icmp eq i32 %23, 3
  br i1 %24, label %25, label %28

25:                                               ; preds = %6
  %26 = getelementptr inbounds i8, ptr %3, i64 8
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %.not = icmp eq ptr %27, null
  br i1 %.not, label %.critedge, label %28

28:                                               ; preds = %25, %6
  %29 = tail call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef %2, ptr noundef nonnull %3)
  %.not97 = icmp eq i32 %29, 0
  br i1 %.not97, label %63, label %30

30:                                               ; preds = %28
  %31 = tail call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %4, i32 noundef %5, ptr noundef nonnull %3)
  %.not103106 = icmp eq i64 %31, 0
  br i1 %.not103106, label %.critedge, label %iter.check

iter.check:                                       ; preds = %30
  %min.iters.check = icmp ult i64 %31, 8
  %32 = sub i64 %10, %9
  %diff.check = icmp ult i64 %32, 32
  %or.cond166 = or i1 %min.iters.check, %diff.check
  br i1 %or.cond166, label %.lr.ph.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check126 = icmp ult i64 %31, 32
  br i1 %min.iters.check126, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %31, -32
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %33 = getelementptr inbounds i8, ptr %1, i64 %index
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %wide.load = load <16 x i8>, ptr %33, align 1, !tbaa !14
  %wide.load127 = load <16 x i8>, ptr %34, align 1, !tbaa !14
  %35 = getelementptr inbounds i8, ptr %0, i64 %index
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store <16 x i8> %wide.load, ptr %35, align 1, !tbaa !14
  store <16 x i8> %wide.load127, ptr %36, align 1, !tbaa !14
  %index.next = add nuw i64 %index, 32
  %37 = icmp eq i64 %index.next, %n.vec
  br i1 %37, label %middle.block, label %vector.body, !llvm.loop !15

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %31, %n.vec
  br i1 %cmp.n, label %.critedge, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %n.vec.remaining = and i64 %31, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.lr.ph.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec129 = and i64 %31, -8
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index130 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next132, %vec.epilog.vector.body ]
  %38 = getelementptr inbounds i8, ptr %1, i64 %index130
  %wide.load131 = load <8 x i8>, ptr %38, align 1, !tbaa !14
  %39 = getelementptr inbounds i8, ptr %0, i64 %index130
  store <8 x i8> %wide.load131, ptr %39, align 1, !tbaa !14
  %index.next132 = add nuw i64 %index130, 8
  %40 = icmp eq i64 %index.next132, %n.vec129
  br i1 %40, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !19

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n133 = icmp eq i64 %31, %n.vec129
  br i1 %cmp.n133, label %.critedge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %.085107.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec129, %vec.epilog.middle.block ]
  %xtraiter = and i64 %31, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %.085107.prol = phi i64 [ %44, %.lr.ph.prol ], [ %.085107.ph, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %41 = getelementptr inbounds i8, ptr %1, i64 %.085107.prol
  %42 = load i8, ptr %41, align 1, !tbaa !14
  %43 = getelementptr inbounds i8, ptr %0, i64 %.085107.prol
  store i8 %42, ptr %43, align 1, !tbaa !14
  %44 = add nuw i64 %.085107.prol, 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !20

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.085107.unr = phi i64 [ %.085107.ph, %.lr.ph.preheader ], [ %44, %.lr.ph.prol ]
  %45 = sub i64 %.085107.ph, %31
  %46 = icmp ugt i64 %45, -4
  br i1 %46, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.085107 = phi i64 [ %62, %.lr.ph ], [ %.085107.unr, %.lr.ph.prol.loopexit ]
  %47 = getelementptr inbounds i8, ptr %1, i64 %.085107
  %48 = load i8, ptr %47, align 1, !tbaa !14
  %49 = getelementptr inbounds i8, ptr %0, i64 %.085107
  store i8 %48, ptr %49, align 1, !tbaa !14
  %50 = add nuw i64 %.085107, 1
  %51 = getelementptr inbounds i8, ptr %1, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !14
  %53 = getelementptr inbounds i8, ptr %0, i64 %50
  store i8 %52, ptr %53, align 1, !tbaa !14
  %54 = add nuw i64 %.085107, 2
  %55 = getelementptr inbounds i8, ptr %1, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !14
  %57 = getelementptr inbounds i8, ptr %0, i64 %54
  store i8 %56, ptr %57, align 1, !tbaa !14
  %58 = add nuw i64 %.085107, 3
  %59 = getelementptr inbounds i8, ptr %1, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !14
  %61 = getelementptr inbounds i8, ptr %0, i64 %58
  store i8 %60, ptr %61, align 1, !tbaa !14
  %62 = add nuw i64 %.085107, 4
  %.not103.3 = icmp eq i64 %62, %31
  br i1 %.not103.3, label %.critedge, label %.lr.ph, !llvm.loop !22

63:                                               ; preds = %28
  %64 = load i32, ptr %2, align 8, !tbaa !5
  %65 = icmp eq i32 %64, 3
  br i1 %65, label %66, label %.loopexit104

66:                                               ; preds = %63
  %67 = getelementptr inbounds i8, ptr %2, i64 16
  %68 = load i64, ptr %67, align 8, !tbaa !23
  %69 = getelementptr inbounds i8, ptr %2, i64 8
  %70 = load ptr, ptr %69, align 8, !tbaa !13
  %71 = getelementptr inbounds i8, ptr %2, i64 4
  %72 = load i32, ptr %71, align 4, !tbaa !24
  %73 = zext nneg i32 %72 to i64
  %74 = shl nuw i64 1, %73
  %75 = icmp eq i64 %68, 0
  br i1 %75, label %76, label %120

76:                                               ; preds = %66
  %77 = getelementptr inbounds i8, ptr %3, i64 16
  %78 = load i64, ptr %77, align 8, !tbaa !23
  %79 = getelementptr inbounds i8, ptr %3, i64 8
  %80 = load ptr, ptr %79, align 8, !tbaa !13
  %81 = load i32, ptr %3, align 8, !tbaa !5
  %82 = icmp eq i32 %81, 3
  br i1 %82, label %83, label %120

83:                                               ; preds = %76
  %84 = getelementptr inbounds i8, ptr %3, i64 4
  %85 = load i32, ptr %84, align 4, !tbaa !24
  %86 = icmp eq i32 %85, %72
  br i1 %86, label %87, label %120

87:                                               ; preds = %83
  %88 = tail call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %4, i32 noundef %5, ptr noundef nonnull %3)
  %.not99119 = icmp eq i64 %88, 0
  br i1 %.not99119, label %.critedge, label %iter.check139

iter.check139:                                    ; preds = %87
  %min.iters.check137 = icmp ult i64 %88, 8
  %89 = sub i64 %8, %7
  %diff.check135 = icmp ult i64 %89, 32
  %or.cond167 = or i1 %min.iters.check137, %diff.check135
  br i1 %or.cond167, label %.lr.ph122.preheader, label %vector.main.loop.iter.check141

vector.main.loop.iter.check141:                   ; preds = %iter.check139
  %min.iters.check140 = icmp ult i64 %88, 32
  br i1 %min.iters.check140, label %vec.epilog.ph153, label %vector.ph142

vector.ph142:                                     ; preds = %vector.main.loop.iter.check141
  %n.vec144 = and i64 %88, -32
  br label %vector.body145

vector.body145:                                   ; preds = %vector.body145, %vector.ph142
  %index146 = phi i64 [ 0, %vector.ph142 ], [ %index.next149, %vector.body145 ]
  %90 = getelementptr inbounds i8, ptr %1, i64 %index146
  %91 = getelementptr inbounds i8, ptr %90, i64 16
  %wide.load147 = load <16 x i8>, ptr %90, align 1, !tbaa !14
  %wide.load148 = load <16 x i8>, ptr %91, align 1, !tbaa !14
  %92 = getelementptr inbounds i8, ptr %0, i64 %index146
  %93 = getelementptr inbounds i8, ptr %92, i64 16
  store <16 x i8> %wide.load147, ptr %92, align 1, !tbaa !14
  store <16 x i8> %wide.load148, ptr %93, align 1, !tbaa !14
  %index.next149 = add nuw i64 %index146, 32
  %94 = icmp eq i64 %index.next149, %n.vec144
  br i1 %94, label %middle.block136, label %vector.body145, !llvm.loop !25

middle.block136:                                  ; preds = %vector.body145
  %cmp.n150 = icmp eq i64 %88, %n.vec144
  br i1 %cmp.n150, label %.critedge, label %vec.epilog.iter.check154

vec.epilog.iter.check154:                         ; preds = %middle.block136
  %n.vec.remaining155 = and i64 %88, 24
  %min.epilog.iters.check156 = icmp eq i64 %n.vec.remaining155, 0
  br i1 %min.epilog.iters.check156, label %.lr.ph122.preheader, label %vec.epilog.ph153

vec.epilog.ph153:                                 ; preds = %vector.main.loop.iter.check141, %vec.epilog.iter.check154
  %vec.epilog.resume.val157 = phi i64 [ %n.vec144, %vec.epilog.iter.check154 ], [ 0, %vector.main.loop.iter.check141 ]
  %n.vec159 = and i64 %88, -8
  br label %vec.epilog.vector.body161

vec.epilog.vector.body161:                        ; preds = %vec.epilog.vector.body161, %vec.epilog.ph153
  %index162 = phi i64 [ %vec.epilog.resume.val157, %vec.epilog.ph153 ], [ %index.next164, %vec.epilog.vector.body161 ]
  %95 = getelementptr inbounds i8, ptr %1, i64 %index162
  %wide.load163 = load <8 x i8>, ptr %95, align 1, !tbaa !14
  %96 = getelementptr inbounds i8, ptr %0, i64 %index162
  store <8 x i8> %wide.load163, ptr %96, align 1, !tbaa !14
  %index.next164 = add nuw i64 %index162, 8
  %97 = icmp eq i64 %index.next164, %n.vec159
  br i1 %97, label %vec.epilog.middle.block151, label %vec.epilog.vector.body161, !llvm.loop !26

vec.epilog.middle.block151:                       ; preds = %vec.epilog.vector.body161
  %cmp.n165 = icmp eq i64 %88, %n.vec159
  br i1 %cmp.n165, label %.critedge, label %.lr.ph122.preheader

.lr.ph122.preheader:                              ; preds = %vec.epilog.middle.block151, %iter.check139, %vec.epilog.iter.check154
  %.186120.ph = phi i64 [ 0, %iter.check139 ], [ %n.vec144, %vec.epilog.iter.check154 ], [ %n.vec159, %vec.epilog.middle.block151 ]
  %xtraiter169 = and i64 %88, 3
  %lcmp.mod170.not = icmp eq i64 %xtraiter169, 0
  br i1 %lcmp.mod170.not, label %.lr.ph122.prol.loopexit, label %.lr.ph122.prol

.lr.ph122.prol:                                   ; preds = %.lr.ph122.preheader, %.lr.ph122.prol
  %.186120.prol = phi i64 [ %101, %.lr.ph122.prol ], [ %.186120.ph, %.lr.ph122.preheader ]
  %prol.iter171 = phi i64 [ %prol.iter171.next, %.lr.ph122.prol ], [ 0, %.lr.ph122.preheader ]
  %98 = getelementptr inbounds i8, ptr %1, i64 %.186120.prol
  %99 = load i8, ptr %98, align 1, !tbaa !14
  %100 = getelementptr inbounds i8, ptr %0, i64 %.186120.prol
  store i8 %99, ptr %100, align 1, !tbaa !14
  %101 = add nuw i64 %.186120.prol, 1
  %prol.iter171.next = add i64 %prol.iter171, 1
  %prol.iter171.cmp.not = icmp eq i64 %prol.iter171.next, %xtraiter169
  br i1 %prol.iter171.cmp.not, label %.lr.ph122.prol.loopexit, label %.lr.ph122.prol, !llvm.loop !27

.lr.ph122.prol.loopexit:                          ; preds = %.lr.ph122.prol, %.lr.ph122.preheader
  %.186120.unr = phi i64 [ %.186120.ph, %.lr.ph122.preheader ], [ %101, %.lr.ph122.prol ]
  %102 = sub i64 %.186120.ph, %88
  %103 = icmp ugt i64 %102, -4
  br i1 %103, label %.critedge, label %.lr.ph122

.lr.ph122:                                        ; preds = %.lr.ph122.prol.loopexit, %.lr.ph122
  %.186120 = phi i64 [ %119, %.lr.ph122 ], [ %.186120.unr, %.lr.ph122.prol.loopexit ]
  %104 = getelementptr inbounds i8, ptr %1, i64 %.186120
  %105 = load i8, ptr %104, align 1, !tbaa !14
  %106 = getelementptr inbounds i8, ptr %0, i64 %.186120
  store i8 %105, ptr %106, align 1, !tbaa !14
  %107 = add nuw i64 %.186120, 1
  %108 = getelementptr inbounds i8, ptr %1, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !14
  %110 = getelementptr inbounds i8, ptr %0, i64 %107
  store i8 %109, ptr %110, align 1, !tbaa !14
  %111 = add nuw i64 %.186120, 2
  %112 = getelementptr inbounds i8, ptr %1, i64 %111
  %113 = load i8, ptr %112, align 1, !tbaa !14
  %114 = getelementptr inbounds i8, ptr %0, i64 %111
  store i8 %113, ptr %114, align 1, !tbaa !14
  %115 = add nuw i64 %.186120, 3
  %116 = getelementptr inbounds i8, ptr %1, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !14
  %118 = getelementptr inbounds i8, ptr %0, i64 %115
  store i8 %117, ptr %118, align 1, !tbaa !14
  %119 = add nuw i64 %.186120, 4
  %.not99.3 = icmp eq i64 %119, %88
  br i1 %.not99.3, label %.critedge, label %.lr.ph122, !llvm.loop !28

120:                                              ; preds = %76, %83, %66
  %.089 = phi i64 [ %78, %83 ], [ %78, %76 ], [ %68, %66 ]
  %.088 = phi ptr [ %80, %83 ], [ %80, %76 ], [ %70, %66 ]
  %spec.select = tail call i64 @llvm.umin.i64(i64 %.089, i64 %74)
  call void @_ZL15color_tree_initP9ColorTree(ptr noundef nonnull %11)
  %.not98108 = icmp eq i64 %.089, 0
  br i1 %.not98108, label %.loopexit104, label %.lr.ph110

.lr.ph110:                                        ; preds = %120, %.lr.ph110
  %.2109 = phi i64 [ %131, %.lr.ph110 ], [ 0, %120 ]
  %121 = shl i64 %.2109, 2
  %122 = getelementptr inbounds i8, ptr %.088, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !14
  %124 = getelementptr inbounds i8, ptr %122, i64 1
  %125 = load i8, ptr %124, align 1, !tbaa !14
  %126 = getelementptr inbounds i8, ptr %122, i64 2
  %127 = load i8, ptr %126, align 1, !tbaa !14
  %128 = getelementptr inbounds i8, ptr %122, i64 3
  %129 = load i8, ptr %128, align 1, !tbaa !14
  %130 = trunc i64 %.2109 to i32
  call void @_ZL14color_tree_addP9ColorTreehhhhj(ptr noundef nonnull %11, i8 noundef zeroext %123, i8 noundef zeroext %125, i8 noundef zeroext %127, i8 noundef zeroext %129, i32 noundef %130)
  %131 = add i64 %.2109, 1
  %.not98 = icmp eq i64 %131, %spec.select
  br i1 %.not98, label %.loopexit104, label %.lr.ph110, !llvm.loop !29

.loopexit104:                                     ; preds = %.lr.ph110, %120, %63
  %132 = getelementptr inbounds i8, ptr %3, i64 4
  %133 = load i32, ptr %132, align 4, !tbaa !24
  %134 = icmp eq i32 %133, 16
  %135 = getelementptr inbounds i8, ptr %2, i64 4
  %136 = load i32, ptr %135, align 4, !tbaa !24
  %137 = icmp eq i32 %136, 16
  %or.cond = select i1 %134, i1 %137, i1 false
  br i1 %or.cond, label %.preheader, label %.loopexit104._crit_edge

.preheader:                                       ; preds = %.loopexit104
  %.not102116 = icmp eq i64 %22, 0
  br i1 %.not102116, label %.loopexit, label %.lr.ph118

.lr.ph118:                                        ; preds = %.preheader, %.lr.ph118
  %.3117 = phi i64 [ %142, %.lr.ph118 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %12) #4
  store i16 0, ptr %12, align 2, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %13) #4
  store i16 0, ptr %13, align 2, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %14) #4
  store i16 0, ptr %14, align 2, !tbaa !30
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %15) #4
  store i16 0, ptr %15, align 2, !tbaa !30
  call void @_ZL19getPixelColorRGBA16PtS_S_S_PKhmPK16LodePNGColorMode(ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14, ptr noundef nonnull %15, ptr noundef %1, i64 noundef %.3117, ptr noundef nonnull %3)
  %138 = load i16, ptr %12, align 2, !tbaa !30
  %139 = load i16, ptr %13, align 2, !tbaa !30
  %140 = load i16, ptr %14, align 2, !tbaa !30
  %141 = load i16, ptr %15, align 2, !tbaa !30
  call void @_ZL13rgba16ToPixelPhmPK16LodePNGColorModetttt(ptr noundef %0, i64 noundef %.3117, ptr noundef nonnull %2, i16 noundef zeroext %138, i16 noundef zeroext %139, i16 noundef zeroext %140, i16 noundef zeroext %141)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %12) #4
  %142 = add nuw i64 %.3117, 1
  %.not102 = icmp eq i64 %142, %22
  br i1 %.not102, label %.loopexit, label %.lr.ph118, !llvm.loop !32

.loopexit104._crit_edge:                          ; preds = %.loopexit104
  %143 = icmp eq i32 %136, 8
  br i1 %143, label %144, label %148

144:                                              ; preds = %.loopexit104._crit_edge
  %145 = load i32, ptr %2, align 8, !tbaa !5
  switch i32 %145, label %148 [
    i32 6, label %146
    i32 2, label %147
  ]

146:                                              ; preds = %144
  call void @_ZL19getPixelColorsRGBA8PhmPKhPK16LodePNGColorMode(ptr noundef %0, i64 noundef %22, ptr noundef %1, ptr noundef nonnull %3)
  br label %.loopexit

147:                                              ; preds = %144
  call void @_ZL18getPixelColorsRGB8PhmPKhPK16LodePNGColorMode(ptr noundef %0, i64 noundef %22, ptr noundef %1, ptr noundef nonnull %3)
  br label %.loopexit

148:                                              ; preds = %144, %.loopexit104._crit_edge
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #4
  store i8 0, ptr %16, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #4
  store i8 0, ptr %17, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %18) #4
  store i8 0, ptr %18, align 1, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %19) #4
  store i8 0, ptr %19, align 1, !tbaa !14
  %.not100111 = icmp eq i64 %22, 0
  br i1 %.not100111, label %._crit_edge, label %.lr.ph113

149:                                              ; preds = %.lr.ph113
  %150 = add nuw i64 %.4112, 1
  %.not100 = icmp eq i64 %150, %22
  br i1 %.not100, label %._crit_edge, label %.lr.ph113, !llvm.loop !33

.lr.ph113:                                        ; preds = %148, %149
  %.4112 = phi i64 [ %150, %149 ], [ 0, %148 ]
  call void @_ZL18getPixelColorRGBA8PhS_S_S_PKhmPK16LodePNGColorMode(ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18, ptr noundef nonnull %19, ptr noundef %1, i64 noundef %.4112, ptr noundef nonnull %3)
  %151 = load i8, ptr %16, align 1, !tbaa !14
  %152 = load i8, ptr %17, align 1, !tbaa !14
  %153 = load i8, ptr %18, align 1, !tbaa !14
  %154 = load i8, ptr %19, align 1, !tbaa !14
  %155 = call noundef i32 @_ZL12rgba8ToPixelPhmPK16LodePNGColorModeP9ColorTreehhhh(ptr noundef %0, i64 noundef %.4112, ptr noundef nonnull %2, ptr noundef nonnull %11, i8 noundef zeroext %151, i8 noundef zeroext %152, i8 noundef zeroext %153, i8 noundef zeroext %154)
  %.not101 = icmp eq i32 %155, 0
  br i1 %.not101, label %149, label %._crit_edge

._crit_edge:                                      ; preds = %149, %.lr.ph113, %148
  %.191 = phi i32 [ 0, %148 ], [ %155, %.lr.ph113 ], [ 0, %149 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %18) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %17) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #4
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph118, %.preheader, %146, %._crit_edge, %147
  %.292 = phi i32 [ 0, %146 ], [ 0, %147 ], [ %.191, %._crit_edge ], [ 0, %.preheader ], [ 0, %.lr.ph118 ]
  %156 = load i32, ptr %2, align 8, !tbaa !5
  %157 = icmp eq i32 %156, 3
  br i1 %157, label %158, label %.critedge

158:                                              ; preds = %.loopexit
  call void @_ZL18color_tree_cleanupP9ColorTree(ptr noundef nonnull %11)
  br label %.critedge

.critedge:                                        ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %.lr.ph122.prol.loopexit, %.lr.ph122, %middle.block, %vec.epilog.middle.block, %middle.block136, %vec.epilog.middle.block151, %30, %87, %.loopexit, %158, %25
  %.1 = phi i32 [ 107, %25 ], [ %.292, %158 ], [ %.292, %.loopexit ], [ 0, %87 ], [ 0, %30 ], [ 0, %vec.epilog.middle.block151 ], [ 0, %middle.block136 ], [ 0, %vec.epilog.middle.block ], [ 0, %middle.block ], [ 0, %.lr.ph122 ], [ 0, %.lr.ph122.prol.loopexit ], [ 0, %.lr.ph ], [ 0, %.lr.ph.prol.loopexit ]
  call void @llvm.lifetime.end.p0(i64 136, ptr nonnull %11) #4
  ret i32 %.1
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL14color_tree_addP9ColorTreehhhhj(ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL19getPixelColorRGBA16PtS_S_S_PKhmPK16LodePNGColorMode(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZL13rgba16ToPixelPhmPK16LodePNGColorModetttt(ptr noundef, i64 noundef, ptr noundef, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext, i16 noundef zeroext) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL19getPixelColorsRGBA8PhmPKhPK16LodePNGColorMode(ptr noalias noundef, i64 noundef, ptr noalias noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18getPixelColorsRGB8PhmPKhPK16LodePNGColorMode(ptr noalias noundef, i64 noundef, ptr noalias noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18getPixelColorRGBA8PhS_S_S_PKhmPK16LodePNGColorMode(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL12rgba8ToPixelPhmPK16LodePNGColorModeP9ColorTreehhhh(ptr noundef, i64 noundef, ptr noundef, ptr noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL18color_tree_cleanupP9ColorTree(ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #3

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !7, i64 0}
!6 = !{!"_ZTS16LodePNGColorMode", !7, i64 0, !10, i64 4, !11, i64 8, !12, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!7 = !{!"_ZTS16LodePNGColorType", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long", !8, i64 0}
!13 = !{!6, !11, i64 8}
!14 = !{!8, !8, i64 0}
!15 = distinct !{!15, !16, !17, !18}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!"llvm.loop.isvectorized", i32 1}
!18 = !{!"llvm.loop.unroll.runtime.disable"}
!19 = distinct !{!19, !16, !17, !18}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = distinct !{!22, !16, !17}
!23 = !{!6, !12, i64 16}
!24 = !{!6, !10, i64 4}
!25 = distinct !{!25, !16, !17, !18}
!26 = distinct !{!26, !16, !17, !18}
!27 = distinct !{!27, !21}
!28 = distinct !{!28, !16, !17}
!29 = distinct !{!29, !16}
!30 = !{!31, !31, i64 0}
!31 = !{!"short", !8, i64 0}
!32 = distinct !{!32, !16}
!33 = distinct !{!33, !16}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass