; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (lodepng)

; 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 i64, align 8
  %19 = alloca i32, align 4
  %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 %10, align 8, !tbaa !5
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef %38, ptr noundef %39)
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %63

42:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %43 = load i32, ptr %12, align 4, !tbaa !9
  %44 = load i32, ptr %13, align 4, !tbaa !9
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %43, i32 noundef %44, ptr noundef %45)
  store i64 %46, ptr %18, align 8, !tbaa !11
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %47

47:                                               ; preds = %59, %42
  %48 = load i64, ptr %14, align 8, !tbaa !11
  %49 = load i64, ptr %18, align 8, !tbaa !11
  %50 = icmp ne i64 %48, %49
  br i1 %50, label %51, label %62

51:                                               ; preds = %47
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = load i64, ptr %14, align 8, !tbaa !11
  %54 = getelementptr inbounds i8, ptr %52, i64 %53
  %55 = load i8, ptr %54, align 1, !tbaa !13
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = load i64, ptr %14, align 8, !tbaa !11
  %58 = getelementptr inbounds i8, ptr %56, i64 %57
  store i8 %55, ptr %58, align 1, !tbaa !13
  br label %59

59:                                               ; preds = %51
  %60 = load i64, ptr %14, align 8, !tbaa !11
  %61 = add i64 %60, 1
  store i64 %61, ptr %14, align 8, !tbaa !11
  br label %47, !llvm.loop !14

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

63:                                               ; preds = %6
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.LodePNGColorMode, ptr %64, i32 0, i32 0
  %66 = load i32, ptr %65, align 8, !tbaa !16
  %67 = icmp eq i32 %66, 3
  br i1 %67, label %68, label %160

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %69 = load ptr, ptr %10, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.LodePNGColorMode, ptr %69, i32 0, i32 3
  %71 = load i64, ptr %70, align 8, !tbaa !19
  store i64 %71, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %72 = load ptr, ptr %10, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.LodePNGColorMode, ptr %72, i32 0, i32 2
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  store ptr %74, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %75 = load ptr, ptr %10, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.LodePNGColorMode, ptr %75, i32 0, i32 1
  %77 = load i32, ptr %76, align 4, !tbaa !21
  %78 = zext i32 %77 to i64
  %79 = shl i64 1, %78
  store i64 %79, ptr %22, align 8, !tbaa !11
  %80 = load i64, ptr %20, align 8, !tbaa !11
  %81 = icmp eq i64 %80, 0
  br i1 %81, label %82, label %123

82:                                               ; preds = %68
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.LodePNGColorMode, ptr %83, i32 0, i32 3
  %85 = load i64, ptr %84, align 8, !tbaa !19
  store i64 %85, ptr %20, align 8, !tbaa !11
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.LodePNGColorMode, ptr %86, i32 0, i32 2
  %88 = load ptr, ptr %87, align 8, !tbaa !20
  store ptr %88, ptr %21, align 8, !tbaa !5
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.LodePNGColorMode, ptr %89, i32 0, i32 0
  %91 = load i32, ptr %90, align 8, !tbaa !16
  %92 = icmp eq i32 %91, 3
  br i1 %92, label %93, label %122

93:                                               ; preds = %82
  %94 = load ptr, ptr %11, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.LodePNGColorMode, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %95, align 4, !tbaa !21
  %97 = load ptr, ptr %10, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.LodePNGColorMode, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !21
  %100 = icmp eq i32 %96, %99
  br i1 %100, label %101, label %122

101:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = load ptr, ptr %11, align 8, !tbaa !5
  %105 = call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %102, i32 noundef %103, ptr noundef %104)
  store i64 %105, ptr %23, align 8, !tbaa !11
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %106

106:                                              ; preds = %118, %101
  %107 = load i64, ptr %14, align 8, !tbaa !11
  %108 = load i64, ptr %23, align 8, !tbaa !11
  %109 = icmp ne i64 %107, %108
  br i1 %109, label %110, label %121

110:                                              ; preds = %106
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = load i64, ptr %14, align 8, !tbaa !11
  %113 = getelementptr inbounds i8, ptr %111, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !13
  %115 = load ptr, ptr %8, align 8, !tbaa !5
  %116 = load i64, ptr %14, align 8, !tbaa !11
  %117 = getelementptr inbounds i8, ptr %115, i64 %116
  store i8 %114, ptr %117, align 1, !tbaa !13
  br label %118

118:                                              ; preds = %110
  %119 = load i64, ptr %14, align 8, !tbaa !11
  %120 = add i64 %119, 1
  store i64 %120, ptr %14, align 8, !tbaa !11
  br label %106, !llvm.loop !22

121:                                              ; preds = %106
  store i32 0, ptr %7, align 4
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  br label %157

122:                                              ; preds = %93, %82
  br label %123

123:                                              ; preds = %122, %68
  %124 = load i64, ptr %20, align 8, !tbaa !11
  %125 = load i64, ptr %22, align 8, !tbaa !11
  %126 = icmp ult i64 %124, %125
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  %128 = load i64, ptr %20, align 8, !tbaa !11
  store i64 %128, ptr %22, align 8, !tbaa !11
  br label %129

129:                                              ; preds = %127, %123
  call void @_ZL15color_tree_initP9ColorTree(ptr noundef %15)
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %130

130:                                              ; preds = %153, %129
  %131 = load i64, ptr %14, align 8, !tbaa !11
  %132 = load i64, ptr %22, align 8, !tbaa !11
  %133 = icmp ne i64 %131, %132
  br i1 %133, label %134, label %156

134:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %135 = load ptr, ptr %21, align 8, !tbaa !5
  %136 = load i64, ptr %14, align 8, !tbaa !11
  %137 = mul i64 %136, 4
  %138 = getelementptr inbounds i8, ptr %135, i64 %137
  store ptr %138, ptr %24, align 8, !tbaa !5
  %139 = load ptr, ptr %24, align 8, !tbaa !5
  %140 = getelementptr inbounds i8, ptr %139, i64 0
  %141 = load i8, ptr %140, align 1, !tbaa !13
  %142 = load ptr, ptr %24, align 8, !tbaa !5
  %143 = getelementptr inbounds i8, ptr %142, i64 1
  %144 = load i8, ptr %143, align 1, !tbaa !13
  %145 = load ptr, ptr %24, align 8, !tbaa !5
  %146 = getelementptr inbounds i8, ptr %145, i64 2
  %147 = load i8, ptr %146, align 1, !tbaa !13
  %148 = load ptr, ptr %24, align 8, !tbaa !5
  %149 = getelementptr inbounds i8, ptr %148, i64 3
  %150 = load i8, ptr %149, align 1, !tbaa !13
  %151 = load i64, ptr %14, align 8, !tbaa !11
  %152 = trunc i64 %151 to i32
  call void @_ZL14color_tree_addP9ColorTreehhhhj(ptr noundef %15, i8 noundef zeroext %141, i8 noundef zeroext %144, i8 noundef zeroext %147, i8 noundef zeroext %150, i32 noundef %152)
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  br label %153

153:                                              ; preds = %134
  %154 = load i64, ptr %14, align 8, !tbaa !11
  %155 = add i64 %154, 1
  store i64 %155, ptr %14, align 8, !tbaa !11
  br label %130, !llvm.loop !23

156:                                              ; preds = %130
  store i32 0, ptr %19, align 4
  br label %157

157:                                              ; preds = %156, %121
  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
  %158 = load i32, ptr %19, align 4
  switch i32 %158, label %255 [
    i32 0, label %159
  ]

159:                                              ; preds = %157
  br label %160

160:                                              ; preds = %159, %63
  %161 = load ptr, ptr %11, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.LodePNGColorMode, ptr %161, i32 0, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !21
  %164 = icmp eq i32 %163, 16
  br i1 %164, label %165, label %190

165:                                              ; preds = %160
  %166 = load ptr, ptr %10, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.LodePNGColorMode, ptr %166, i32 0, i32 1
  %168 = load i32, ptr %167, align 4, !tbaa !21
  %169 = icmp eq i32 %168, 16
  br i1 %169, label %170, label %190

170:                                              ; preds = %165
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %171

171:                                              ; preds = %186, %170
  %172 = load i64, ptr %14, align 8, !tbaa !11
  %173 = load i64, ptr %16, align 8, !tbaa !11
  %174 = icmp ne i64 %172, %173
  br i1 %174, label %175, label %189

175:                                              ; preds = %171
  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
  %176 = load ptr, ptr %9, align 8, !tbaa !5
  %177 = load i64, ptr %14, align 8, !tbaa !11
  %178 = 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 %176, i64 noundef %177, ptr noundef %178)
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = load i64, ptr %14, align 8, !tbaa !11
  %181 = load ptr, ptr %10, align 8, !tbaa !5
  %182 = load i16, ptr %25, align 2, !tbaa !24
  %183 = load i16, ptr %26, align 2, !tbaa !24
  %184 = load i16, ptr %27, align 2, !tbaa !24
  %185 = load i16, ptr %28, align 2, !tbaa !24
  call void @_ZL13rgba16ToPixelPhmPK16LodePNGColorModetttt(ptr noundef %179, i64 noundef %180, ptr noundef %181, i16 noundef zeroext %182, i16 noundef zeroext %183, i16 noundef zeroext %184, i16 noundef zeroext %185)
  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 %186

186:                                              ; preds = %175
  %187 = load i64, ptr %14, align 8, !tbaa !11
  %188 = add i64 %187, 1
  store i64 %188, ptr %14, align 8, !tbaa !11
  br label %171, !llvm.loop !26

189:                                              ; preds = %171
  br label %247

190:                                              ; preds = %165, %160
  %191 = load ptr, ptr %10, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.LodePNGColorMode, ptr %191, i32 0, i32 1
  %193 = load i32, ptr %192, align 4, !tbaa !21
  %194 = icmp eq i32 %193, 8
  br i1 %194, label %195, label %205

195:                                              ; preds = %190
  %196 = load ptr, ptr %10, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.LodePNGColorMode, ptr %196, i32 0, i32 0
  %198 = load i32, ptr %197, align 8, !tbaa !16
  %199 = icmp eq i32 %198, 6
  br i1 %199, label %200, label %205

200:                                              ; preds = %195
  %201 = load ptr, ptr %8, align 8, !tbaa !5
  %202 = load i64, ptr %16, align 8, !tbaa !11
  %203 = load ptr, ptr %9, align 8, !tbaa !5
  %204 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZL19getPixelColorsRGBA8PhmjPKhPK16LodePNGColorMode(ptr noundef %201, i64 noundef %202, i32 noundef 1, ptr noundef %203, ptr noundef %204)
  br label %246

205:                                              ; preds = %195, %190
  %206 = load ptr, ptr %10, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.LodePNGColorMode, ptr %206, i32 0, i32 1
  %208 = load i32, ptr %207, align 4, !tbaa !21
  %209 = icmp eq i32 %208, 8
  br i1 %209, label %210, label %220

210:                                              ; preds = %205
  %211 = load ptr, ptr %10, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.LodePNGColorMode, ptr %211, i32 0, i32 0
  %213 = load i32, ptr %212, align 8, !tbaa !16
  %214 = icmp eq i32 %213, 2
  br i1 %214, label %215, label %220

215:                                              ; preds = %210
  %216 = load ptr, ptr %8, align 8, !tbaa !5
  %217 = load i64, ptr %16, align 8, !tbaa !11
  %218 = load ptr, ptr %9, align 8, !tbaa !5
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  call void @_ZL19getPixelColorsRGBA8PhmjPKhPK16LodePNGColorMode(ptr noundef %216, i64 noundef %217, i32 noundef 0, ptr noundef %218, ptr noundef %219)
  br label %245

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

221:                                              ; preds = %241, %220
  %222 = load i64, ptr %14, align 8, !tbaa !11
  %223 = load i64, ptr %16, align 8, !tbaa !11
  %224 = icmp ne i64 %222, %223
  br i1 %224, label %225, label %244

225:                                              ; preds = %221
  %226 = load ptr, ptr %9, align 8, !tbaa !5
  %227 = load i64, ptr %14, align 8, !tbaa !11
  %228 = 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 %226, i64 noundef %227, ptr noundef %228)
  %229 = load ptr, ptr %8, align 8, !tbaa !5
  %230 = load i64, ptr %14, align 8, !tbaa !11
  %231 = load ptr, ptr %10, align 8, !tbaa !5
  %232 = load i8, ptr %29, align 1, !tbaa !13
  %233 = load i8, ptr %30, align 1, !tbaa !13
  %234 = load i8, ptr %31, align 1, !tbaa !13
  %235 = load i8, ptr %32, align 1, !tbaa !13
  %236 = call noundef i32 @_ZL12rgba8ToPixelPhmPK16LodePNGColorModeP9ColorTreehhhh(ptr noundef %229, i64 noundef %230, ptr noundef %231, ptr noundef %15, i8 noundef zeroext %232, i8 noundef zeroext %233, i8 noundef zeroext %234, i8 noundef zeroext %235)
  store i32 %236, ptr %17, align 4, !tbaa !9
  %237 = load i32, ptr %17, align 4, !tbaa !9
  %238 = icmp ne i32 %237, 0
  br i1 %238, label %239, label %240

239:                                              ; preds = %225
  br label %244

240:                                              ; preds = %225
  br label %241

241:                                              ; preds = %240
  %242 = load i64, ptr %14, align 8, !tbaa !11
  %243 = add i64 %242, 1
  store i64 %243, ptr %14, align 8, !tbaa !11
  br label %221, !llvm.loop !27

244:                                              ; preds = %239, %221
  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 %245

245:                                              ; preds = %244, %215
  br label %246

246:                                              ; preds = %245, %200
  br label %247

247:                                              ; preds = %246, %189
  %248 = load ptr, ptr %10, align 8, !tbaa !5
  %249 = getelementptr inbounds %struct.LodePNGColorMode, ptr %248, i32 0, i32 0
  %250 = load i32, ptr %249, align 8, !tbaa !16
  %251 = icmp eq i32 %250, 3
  br i1 %251, label %252, label %253

252:                                              ; preds = %247
  call void @_ZL18color_tree_cleanupP9ColorTree(ptr noundef %15)
  br label %253

253:                                              ; preds = %252, %247
  %254 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %254, ptr %7, align 4
  store i32 1, ptr %19, align 4
  br label %255

255:                                              ; preds = %253, %157, %62
  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
  %256 = load i32, ptr %7, align 4
  ret i32 %256
}

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


; 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 = tail call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef %2, ptr noundef %3)
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %57, label %24

24:                                               ; preds = %6
  %25 = tail call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %4, i32 noundef %5, ptr noundef %3)
  %.not100103 = icmp eq i64 %25, 0
  br i1 %.not100103, label %.critedge, label %iter.check

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

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

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

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %27 = getelementptr inbounds i8, ptr %1, i64 %index
  %28 = getelementptr inbounds i8, ptr %27, i64 16
  %wide.load = load <16 x i8>, ptr %27, align 1, !tbaa !5
  %wide.load124 = load <16 x i8>, ptr %28, align 1, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %0, i64 %index
  %30 = getelementptr inbounds i8, ptr %29, i64 16
  store <16 x i8> %wide.load, ptr %29, align 1, !tbaa !5
  store <16 x i8> %wide.load124, ptr %30, align 1, !tbaa !5
  %index.next = add nuw i64 %index, 32
  %31 = icmp eq i64 %index.next, %n.vec
  br i1 %31, label %middle.block, label %vector.body, !llvm.loop !8

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %25, %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 %25, 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.vec126 = and i64 %25, -8
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index127 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next129, %vec.epilog.vector.body ]
  %32 = getelementptr inbounds i8, ptr %1, i64 %index127
  %wide.load128 = load <8 x i8>, ptr %32, align 1, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %0, i64 %index127
  store <8 x i8> %wide.load128, ptr %33, align 1, !tbaa !5
  %index.next129 = add nuw i64 %index127, 8
  %34 = icmp eq i64 %index.next129, %n.vec126
  br i1 %34, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !12

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

.lr.ph.preheader:                                 ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %.083104.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec126, %vec.epilog.middle.block ]
  %xtraiter = and i64 %25, 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
  %.083104.prol = phi i64 [ %38, %.lr.ph.prol ], [ %.083104.ph, %.lr.ph.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %35 = getelementptr inbounds i8, ptr %1, i64 %.083104.prol
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %0, i64 %.083104.prol
  store i8 %36, ptr %37, align 1, !tbaa !5
  %38 = add nuw i64 %.083104.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 !13

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %.083104.unr = phi i64 [ %.083104.ph, %.lr.ph.preheader ], [ %38, %.lr.ph.prol ]
  %39 = sub i64 %.083104.ph, %25
  %40 = icmp ugt i64 %39, -4
  br i1 %40, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %.083104 = phi i64 [ %56, %.lr.ph ], [ %.083104.unr, %.lr.ph.prol.loopexit ]
  %41 = getelementptr inbounds i8, ptr %1, i64 %.083104
  %42 = load i8, ptr %41, align 1, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %0, i64 %.083104
  store i8 %42, ptr %43, align 1, !tbaa !5
  %44 = add nuw i64 %.083104, 1
  %45 = getelementptr inbounds i8, ptr %1, i64 %44
  %46 = load i8, ptr %45, align 1, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %0, i64 %44
  store i8 %46, ptr %47, align 1, !tbaa !5
  %48 = add nuw i64 %.083104, 2
  %49 = getelementptr inbounds i8, ptr %1, i64 %48
  %50 = load i8, ptr %49, align 1, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %0, i64 %48
  store i8 %50, ptr %51, align 1, !tbaa !5
  %52 = add nuw i64 %.083104, 3
  %53 = getelementptr inbounds i8, ptr %1, i64 %52
  %54 = load i8, ptr %53, align 1, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %0, i64 %52
  store i8 %54, ptr %55, align 1, !tbaa !5
  %56 = add nuw i64 %.083104, 4
  %.not100.3 = icmp eq i64 %56, %25
  br i1 %.not100.3, label %.critedge, label %.lr.ph, !llvm.loop !15

57:                                               ; preds = %6
  %58 = load i32, ptr %2, align 8, !tbaa !16
  %59 = icmp eq i32 %58, 3
  br i1 %59, label %60, label %.loopexit101

60:                                               ; preds = %57
  %61 = getelementptr inbounds i8, ptr %2, i64 16
  %62 = load i64, ptr %61, align 8, !tbaa !22
  %63 = getelementptr inbounds i8, ptr %2, i64 8
  %64 = load ptr, ptr %63, align 8, !tbaa !23
  %65 = getelementptr inbounds i8, ptr %2, i64 4
  %66 = load i32, ptr %65, align 4, !tbaa !24
  %67 = zext nneg i32 %66 to i64
  %68 = shl nuw i64 1, %67
  %69 = icmp eq i64 %62, 0
  br i1 %69, label %70, label %114

70:                                               ; preds = %60
  %71 = getelementptr inbounds i8, ptr %3, i64 16
  %72 = load i64, ptr %71, align 8, !tbaa !22
  %73 = getelementptr inbounds i8, ptr %3, i64 8
  %74 = load ptr, ptr %73, align 8, !tbaa !23
  %75 = load i32, ptr %3, align 8, !tbaa !16
  %76 = icmp eq i32 %75, 3
  br i1 %76, label %77, label %114

77:                                               ; preds = %70
  %78 = getelementptr inbounds i8, ptr %3, i64 4
  %79 = load i32, ptr %78, align 4, !tbaa !24
  %80 = icmp eq i32 %79, %66
  br i1 %80, label %81, label %114

81:                                               ; preds = %77
  %82 = tail call noundef i64 @_Z20lodepng_get_raw_sizejjPK16LodePNGColorMode(i32 noundef %4, i32 noundef %5, ptr noundef nonnull %3)
  %.not96116 = icmp eq i64 %82, 0
  br i1 %.not96116, label %.critedge, label %iter.check136

iter.check136:                                    ; preds = %81
  %min.iters.check134 = icmp ult i64 %82, 8
  %83 = sub i64 %8, %7
  %diff.check132 = icmp ult i64 %83, 32
  %or.cond164 = or i1 %min.iters.check134, %diff.check132
  br i1 %or.cond164, label %.lr.ph119.preheader, label %vector.main.loop.iter.check138

vector.main.loop.iter.check138:                   ; preds = %iter.check136
  %min.iters.check137 = icmp ult i64 %82, 32
  br i1 %min.iters.check137, label %vec.epilog.ph150, label %vector.ph139

vector.ph139:                                     ; preds = %vector.main.loop.iter.check138
  %n.vec141 = and i64 %82, -32
  br label %vector.body142

vector.body142:                                   ; preds = %vector.body142, %vector.ph139
  %index143 = phi i64 [ 0, %vector.ph139 ], [ %index.next146, %vector.body142 ]
  %84 = getelementptr inbounds i8, ptr %1, i64 %index143
  %85 = getelementptr inbounds i8, ptr %84, i64 16
  %wide.load144 = load <16 x i8>, ptr %84, align 1, !tbaa !5
  %wide.load145 = load <16 x i8>, ptr %85, align 1, !tbaa !5
  %86 = getelementptr inbounds i8, ptr %0, i64 %index143
  %87 = getelementptr inbounds i8, ptr %86, i64 16
  store <16 x i8> %wide.load144, ptr %86, align 1, !tbaa !5
  store <16 x i8> %wide.load145, ptr %87, align 1, !tbaa !5
  %index.next146 = add nuw i64 %index143, 32
  %88 = icmp eq i64 %index.next146, %n.vec141
  br i1 %88, label %middle.block133, label %vector.body142, !llvm.loop !25

middle.block133:                                  ; preds = %vector.body142
  %cmp.n147 = icmp eq i64 %82, %n.vec141
  br i1 %cmp.n147, label %.critedge, label %vec.epilog.iter.check151

vec.epilog.iter.check151:                         ; preds = %middle.block133
  %n.vec.remaining152 = and i64 %82, 24
  %min.epilog.iters.check153 = icmp eq i64 %n.vec.remaining152, 0
  br i1 %min.epilog.iters.check153, label %.lr.ph119.preheader, label %vec.epilog.ph150

vec.epilog.ph150:                                 ; preds = %vector.main.loop.iter.check138, %vec.epilog.iter.check151
  %vec.epilog.resume.val154 = phi i64 [ %n.vec141, %vec.epilog.iter.check151 ], [ 0, %vector.main.loop.iter.check138 ]
  %n.vec156 = and i64 %82, -8
  br label %vec.epilog.vector.body158

vec.epilog.vector.body158:                        ; preds = %vec.epilog.vector.body158, %vec.epilog.ph150
  %index159 = phi i64 [ %vec.epilog.resume.val154, %vec.epilog.ph150 ], [ %index.next161, %vec.epilog.vector.body158 ]
  %89 = getelementptr inbounds i8, ptr %1, i64 %index159
  %wide.load160 = load <8 x i8>, ptr %89, align 1, !tbaa !5
  %90 = getelementptr inbounds i8, ptr %0, i64 %index159
  store <8 x i8> %wide.load160, ptr %90, align 1, !tbaa !5
  %index.next161 = add nuw i64 %index159, 8
  %91 = icmp eq i64 %index.next161, %n.vec156
  br i1 %91, label %vec.epilog.middle.block148, label %vec.epilog.vector.body158, !llvm.loop !26

vec.epilog.middle.block148:                       ; preds = %vec.epilog.vector.body158
  %cmp.n162 = icmp eq i64 %82, %n.vec156
  br i1 %cmp.n162, label %.critedge, label %.lr.ph119.preheader

.lr.ph119.preheader:                              ; preds = %vec.epilog.middle.block148, %iter.check136, %vec.epilog.iter.check151
  %.184117.ph = phi i64 [ 0, %iter.check136 ], [ %n.vec141, %vec.epilog.iter.check151 ], [ %n.vec156, %vec.epilog.middle.block148 ]
  %xtraiter166 = and i64 %82, 3
  %lcmp.mod167.not = icmp eq i64 %xtraiter166, 0
  br i1 %lcmp.mod167.not, label %.lr.ph119.prol.loopexit, label %.lr.ph119.prol

.lr.ph119.prol:                                   ; preds = %.lr.ph119.preheader, %.lr.ph119.prol
  %.184117.prol = phi i64 [ %95, %.lr.ph119.prol ], [ %.184117.ph, %.lr.ph119.preheader ]
  %prol.iter168 = phi i64 [ %prol.iter168.next, %.lr.ph119.prol ], [ 0, %.lr.ph119.preheader ]
  %92 = getelementptr inbounds i8, ptr %1, i64 %.184117.prol
  %93 = load i8, ptr %92, align 1, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %0, i64 %.184117.prol
  store i8 %93, ptr %94, align 1, !tbaa !5
  %95 = add nuw i64 %.184117.prol, 1
  %prol.iter168.next = add i64 %prol.iter168, 1
  %prol.iter168.cmp.not = icmp eq i64 %prol.iter168.next, %xtraiter166
  br i1 %prol.iter168.cmp.not, label %.lr.ph119.prol.loopexit, label %.lr.ph119.prol, !llvm.loop !27

.lr.ph119.prol.loopexit:                          ; preds = %.lr.ph119.prol, %.lr.ph119.preheader
  %.184117.unr = phi i64 [ %.184117.ph, %.lr.ph119.preheader ], [ %95, %.lr.ph119.prol ]
  %96 = sub i64 %.184117.ph, %82
  %97 = icmp ugt i64 %96, -4
  br i1 %97, label %.critedge, label %.lr.ph119

.lr.ph119:                                        ; preds = %.lr.ph119.prol.loopexit, %.lr.ph119
  %.184117 = phi i64 [ %113, %.lr.ph119 ], [ %.184117.unr, %.lr.ph119.prol.loopexit ]
  %98 = getelementptr inbounds i8, ptr %1, i64 %.184117
  %99 = load i8, ptr %98, align 1, !tbaa !5
  %100 = getelementptr inbounds i8, ptr %0, i64 %.184117
  store i8 %99, ptr %100, align 1, !tbaa !5
  %101 = add nuw i64 %.184117, 1
  %102 = getelementptr inbounds i8, ptr %1, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %0, i64 %101
  store i8 %103, ptr %104, align 1, !tbaa !5
  %105 = add nuw i64 %.184117, 2
  %106 = getelementptr inbounds i8, ptr %1, i64 %105
  %107 = load i8, ptr %106, align 1, !tbaa !5
  %108 = getelementptr inbounds i8, ptr %0, i64 %105
  store i8 %107, ptr %108, align 1, !tbaa !5
  %109 = add nuw i64 %.184117, 3
  %110 = getelementptr inbounds i8, ptr %1, i64 %109
  %111 = load i8, ptr %110, align 1, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %0, i64 %109
  store i8 %111, ptr %112, align 1, !tbaa !5
  %113 = add nuw i64 %.184117, 4
  %.not96.3 = icmp eq i64 %113, %82
  br i1 %.not96.3, label %.critedge, label %.lr.ph119, !llvm.loop !28

114:                                              ; preds = %70, %77, %60
  %.087 = phi i64 [ %72, %77 ], [ %72, %70 ], [ %62, %60 ]
  %.086 = phi ptr [ %74, %77 ], [ %74, %70 ], [ %64, %60 ]
  %spec.select = tail call i64 @llvm.umin.i64(i64 %.087, i64 %68)
  call void @_ZL15color_tree_initP9ColorTree(ptr noundef nonnull %11)
  %.not95105 = icmp eq i64 %.087, 0
  br i1 %.not95105, label %.loopexit101, label %.lr.ph107

.lr.ph107:                                        ; preds = %114, %.lr.ph107
  %.2106 = phi i64 [ %125, %.lr.ph107 ], [ 0, %114 ]
  %115 = shl i64 %.2106, 2
  %116 = getelementptr inbounds i8, ptr %.086, i64 %115
  %117 = load i8, ptr %116, align 1, !tbaa !5
  %118 = getelementptr inbounds i8, ptr %116, i64 1
  %119 = load i8, ptr %118, align 1, !tbaa !5
  %120 = getelementptr inbounds i8, ptr %116, i64 2
  %121 = load i8, ptr %120, align 1, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %116, i64 3
  %123 = load i8, ptr %122, align 1, !tbaa !5
  %124 = trunc i64 %.2106 to i32
  call void @_ZL14color_tree_addP9ColorTreehhhhj(ptr noundef nonnull %11, i8 noundef zeroext %117, i8 noundef zeroext %119, i8 noundef zeroext %121, i8 noundef zeroext %123, i32 noundef %124)
  %125 = add i64 %.2106, 1
  %.not95 = icmp eq i64 %125, %spec.select
  br i1 %.not95, label %.loopexit101, label %.lr.ph107, !llvm.loop !29

.loopexit101:                                     ; preds = %.lr.ph107, %114, %57
  %126 = getelementptr inbounds i8, ptr %3, i64 4
  %127 = load i32, ptr %126, align 4, !tbaa !24
  %128 = icmp eq i32 %127, 16
  %129 = getelementptr inbounds i8, ptr %2, i64 4
  %130 = load i32, ptr %129, align 4, !tbaa !24
  %131 = icmp eq i32 %130, 16
  %or.cond = select i1 %128, i1 %131, i1 false
  br i1 %or.cond, label %.preheader, label %.loopexit101._crit_edge

.preheader:                                       ; preds = %.loopexit101
  %.not99113 = icmp eq i64 %22, 0
  br i1 %.not99113, label %.loopexit, label %.lr.ph115

.lr.ph115:                                        ; preds = %.preheader, %.lr.ph115
  %.3114 = phi i64 [ %136, %.lr.ph115 ], [ 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 %.3114, ptr noundef %3)
  %132 = load i16, ptr %12, align 2, !tbaa !30
  %133 = load i16, ptr %13, align 2, !tbaa !30
  %134 = load i16, ptr %14, align 2, !tbaa !30
  %135 = load i16, ptr %15, align 2, !tbaa !30
  call void @_ZL13rgba16ToPixelPhmPK16LodePNGColorModetttt(ptr noundef %0, i64 noundef %.3114, ptr noundef nonnull %2, i16 noundef zeroext %132, i16 noundef zeroext %133, i16 noundef zeroext %134, i16 noundef zeroext %135)
  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
  %136 = add nuw i64 %.3114, 1
  %.not99 = icmp eq i64 %136, %22
  br i1 %.not99, label %.loopexit, label %.lr.ph115, !llvm.loop !32

.loopexit101._crit_edge:                          ; preds = %.loopexit101
  %137 = icmp eq i32 %130, 8
  br i1 %137, label %138, label %142

138:                                              ; preds = %.loopexit101._crit_edge
  %139 = load i32, ptr %2, align 8, !tbaa !16
  switch i32 %139, label %142 [
    i32 6, label %140
    i32 2, label %141
  ]

140:                                              ; preds = %138
  call void @_ZL19getPixelColorsRGBA8PhmjPKhPK16LodePNGColorMode(ptr noundef %0, i64 noundef %22, i32 noundef 1, ptr noundef %1, ptr noundef nonnull %3)
  br label %.loopexit

141:                                              ; preds = %138
  call void @_ZL19getPixelColorsRGBA8PhmjPKhPK16LodePNGColorMode(ptr noundef %0, i64 noundef %22, i32 noundef 0, ptr noundef %1, ptr noundef nonnull %3)
  br label %.loopexit

142:                                              ; preds = %138, %.loopexit101._crit_edge
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #4
  store i8 0, ptr %16, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %17) #4
  store i8 0, ptr %17, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %18) #4
  store i8 0, ptr %18, align 1, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %19) #4
  store i8 0, ptr %19, align 1, !tbaa !5
  %.not97108 = icmp eq i64 %22, 0
  br i1 %.not97108, label %._crit_edge, label %.lr.ph110

143:                                              ; preds = %.lr.ph110
  %144 = add nuw i64 %.4109, 1
  %.not97 = icmp eq i64 %144, %22
  br i1 %.not97, label %._crit_edge, label %.lr.ph110, !llvm.loop !33

.lr.ph110:                                        ; preds = %142, %143
  %.4109 = phi i64 [ %144, %143 ], [ 0, %142 ]
  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 %.4109, ptr noundef %3)
  %145 = load i8, ptr %16, align 1, !tbaa !5
  %146 = load i8, ptr %17, align 1, !tbaa !5
  %147 = load i8, ptr %18, align 1, !tbaa !5
  %148 = load i8, ptr %19, align 1, !tbaa !5
  %149 = call noundef i32 @_ZL12rgba8ToPixelPhmPK16LodePNGColorModeP9ColorTreehhhh(ptr noundef %0, i64 noundef %.4109, ptr noundef nonnull %2, ptr noundef nonnull %11, i8 noundef zeroext %145, i8 noundef zeroext %146, i8 noundef zeroext %147, i8 noundef zeroext %148)
  %.not98 = icmp eq i32 %149, 0
  br i1 %.not98, label %143, label %._crit_edge

._crit_edge:                                      ; preds = %143, %.lr.ph110, %142
  %.190 = phi i32 [ 0, %142 ], [ %149, %.lr.ph110 ], [ 0, %143 ]
  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.ph115, %.preheader, %140, %._crit_edge, %141
  %.291 = phi i32 [ 0, %140 ], [ 0, %141 ], [ %.190, %._crit_edge ], [ 0, %.preheader ], [ 0, %.lr.ph115 ]
  %150 = load i32, ptr %2, align 8, !tbaa !16
  %151 = icmp eq i32 %150, 3
  br i1 %151, label %152, label %.critedge

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

.critedge:                                        ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %.lr.ph119.prol.loopexit, %.lr.ph119, %middle.block, %vec.epilog.middle.block, %middle.block133, %vec.epilog.middle.block148, %24, %81, %.loopexit, %152
  %.1 = phi i32 [ %.291, %152 ], [ %.291, %.loopexit ], [ 0, %81 ], [ 0, %24 ], [ 0, %vec.epilog.middle.block148 ], [ 0, %middle.block133 ], [ 0, %vec.epilog.middle.block ], [ 0, %middle.block ], [ 0, %.lr.ph119 ], [ 0, %.lr.ph119.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 @_ZL19getPixelColorsRGBA8PhmjPKhPK16LodePNGColorMode(ptr noundef, i64 noundef, i32 noundef, ptr 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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9, !10, !11}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!"llvm.loop.isvectorized", i32 1}
!11 = !{!"llvm.loop.unroll.runtime.disable"}
!12 = distinct !{!12, !9, !10, !11}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !9, !10}
!16 = !{!17, !18, i64 0}
!17 = !{!"_ZTS16LodePNGColorMode", !18, i64 0, !19, i64 4, !20, i64 8, !21, i64 16, !19, i64 24, !19, i64 28, !19, i64 32, !19, i64 36}
!18 = !{!"_ZTS16LodePNGColorType", !6, i64 0}
!19 = !{!"int", !6, i64 0}
!20 = !{!"any pointer", !6, i64 0}
!21 = !{!"long", !6, i64 0}
!22 = !{!17, !21, i64 16}
!23 = !{!17, !20, i64 8}
!24 = !{!17, !19, i64 4}
!25 = distinct !{!25, !9, !10, !11}
!26 = distinct !{!26, !9, !10, !11}
!27 = distinct !{!27, !14}
!28 = distinct !{!28, !9, !10}
!29 = distinct !{!29, !9}
!30 = !{!31, !31, i64 0}
!31 = !{!"short", !6, i64 0}
!32 = distinct !{!32, !9}
!33 = distinct !{!33, !9}


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