; LLVM IR from google/zopfli :: src/zopflipng/lodepng (lodepng_util)

; 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.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%"struct.lodepng::LodePNGICC" = type { i32, i32, i32, i32, [3 x float], i32, [9 x float], i32, [3 x float], i32, [3 x float], [3 x float], [3 x float], i32, [3 x %"struct.lodepng::LodePNGICCCurve"] }
%"struct.lodepng::LodePNGICCCurve" = type { i32, ptr, i64, float, float, float, float, float, float, float }
%struct.LodePNGState = type { %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32 }
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32, i32, i32, i64, i64 }
%struct.LodePNGDecompressSettings = type { i32, i32, i64, ptr, ptr, ptr }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32, i32, i32 }
%struct.LodePNGCompressSettings = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode, i32, i32, i32, i32, i64, ptr, ptr, i64, ptr, ptr, ptr, ptr, i32, %struct.LodePNGTime, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr, i32, [3 x ptr], [3 x i64] }
%struct.LodePNGTime = type { i32, i32, i32, i32, i32, i32 }

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7lodepng16lodepng_icc_initEPNS_10LodePNGICCE(ptr noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7lodepng19lodepng_icc_cleanupEPNS_10LodePNGICCE(ptr noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7lodepng12convertToXYZEPfS0_PKhjjPK12LodePNGState(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5) #2 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca i64, align 8
  %22 = alloca %struct.LodePNGColorMode, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"struct.lodepng::LodePNGICC", align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i32 %3, ptr %10, align 4, !tbaa !9
  store i32 %4, ptr %11, align 4, !tbaa !9
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = load i32, ptr %11, align 4, !tbaa !9
  %30 = mul i32 %28, %29
  %31 = zext i32 %30 to i64
  store i64 %31, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %32 = load ptr, ptr %12, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.LodePNGState, ptr %32, i32 0, i32 2
  store ptr %33, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.LodePNGState, ptr %34, i32 0, i32 3
  store ptr %35, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %36 = load ptr, ptr %16, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.LodePNGColorMode, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !13
  %39 = icmp ugt i32 %38, 8
  %40 = zext i1 %39 to i32
  store i32 %40, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %41 = load i32, ptr %20, align 4, !tbaa !9
  %42 = icmp ne i32 %41, 0
  %43 = zext i1 %42 to i64
  %44 = select i1 %42, i32 65536, i32 256
  %45 = sext i32 %44 to i64
  store i64 %45, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 40, ptr %22) #4
  %46 = load i32, ptr %20, align 4, !tbaa !9
  %47 = icmp ne i32 %46, 0
  %48 = zext i1 %47 to i64
  %49 = select i1 %47, i32 16, i32 8
  call void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind writable sret(%struct.LodePNGColorMode) align 8 %22, i32 noundef 6, i32 noundef %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 296, ptr %24) #4
  call void @_ZN7lodepng16lodepng_icc_initEPNS_10LodePNGICCE(ptr noundef %24)
  %50 = load ptr, ptr %17, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.LodePNGInfo, ptr %50, i32 0, i32 35
  %52 = load i32, ptr %51, align 8, !tbaa !16
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %68

54:                                               ; preds = %6
  %55 = load ptr, ptr %17, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.LodePNGInfo, ptr %55, i32 0, i32 37
  %57 = load ptr, ptr %56, align 8, !tbaa !19
  %58 = load ptr, ptr %17, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.LodePNGInfo, ptr %58, i32 0, i32 38
  %60 = load i32, ptr %59, align 8, !tbaa !20
  %61 = zext i32 %60 to i64
  %62 = call noundef i32 @_ZN7lodepngL8parseICCEPNS_10LodePNGICCEPKhm(ptr noundef %24, ptr noundef %57, i64 noundef %61)
  store i32 %62, ptr %13, align 4, !tbaa !9
  %63 = load i32, ptr %13, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %54
  br label %323

66:                                               ; preds = %54
  %67 = call noundef i32 @_ZN7lodepngL11validateICCEPKNS_10LodePNGICCE(ptr noundef %24)
  store i32 %67, ptr %23, align 4, !tbaa !9
  br label %68

68:                                               ; preds = %66, %6
  %69 = load i32, ptr %10, align 4, !tbaa !9
  %70 = zext i32 %69 to i64
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = mul i64 %70, %72
  %74 = load i32, ptr %20, align 4, !tbaa !9
  %75 = icmp ne i32 %74, 0
  %76 = zext i1 %75 to i64
  %77 = select i1 %75, i32 8, i32 4
  %78 = sext i32 %77 to i64
  %79 = mul i64 %73, %78
  %80 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %79)
  store ptr %80, ptr %18, align 8, !tbaa !5
  %81 = load ptr, ptr %18, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %81, ptr noundef %82, ptr noundef %22, ptr noundef %83, i32 noundef %84, i32 noundef %85)
  store i32 %86, ptr %13, align 4, !tbaa !9
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %68
  br label %323

90:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %91 = load i32, ptr %23, align 4, !tbaa !9
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %126

93:                                               ; preds = %90
  %94 = getelementptr inbounds %"struct.lodepng::LodePNGICC", ptr %24, i32 0, i32 0
  %95 = load i32, ptr %94, align 8, !tbaa !21
  %96 = icmp eq i32 %95, 2
  br i1 %96, label %97, label %126

97:                                               ; preds = %93
  %98 = load i64, ptr %21, align 8, !tbaa !11
  %99 = mul i64 %98, 3
  %100 = mul i64 %99, 4
  %101 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %100)
  store ptr %101, ptr %19, align 8, !tbaa !5
  %102 = load ptr, ptr %19, align 8, !tbaa !5
  %103 = load i64, ptr %21, align 8, !tbaa !11
  %104 = mul i64 %103, 0
  %105 = getelementptr inbounds float, ptr %102, i64 %104
  store ptr %105, ptr %25, align 8, !tbaa !5
  %106 = load ptr, ptr %19, align 8, !tbaa !5
  %107 = load i64, ptr %21, align 8, !tbaa !11
  %108 = mul i64 %107, 1
  %109 = getelementptr inbounds float, ptr %106, i64 %108
  store ptr %109, ptr %26, align 8, !tbaa !5
  %110 = load ptr, ptr %19, align 8, !tbaa !5
  %111 = load i64, ptr %21, align 8, !tbaa !11
  %112 = mul i64 %111, 2
  %113 = getelementptr inbounds float, ptr %110, i64 %112
  store ptr %113, ptr %27, align 8, !tbaa !5
  %114 = load ptr, ptr %25, align 8, !tbaa !5
  %115 = load i64, ptr %21, align 8, !tbaa !11
  %116 = load ptr, ptr %17, align 8, !tbaa !5
  %117 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef %114, i64 noundef %115, i64 noundef 0, ptr noundef %116, i32 noundef %117, ptr noundef %24)
  %118 = load ptr, ptr %26, align 8, !tbaa !5
  %119 = load i64, ptr %21, align 8, !tbaa !11
  %120 = load ptr, ptr %17, align 8, !tbaa !5
  %121 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef %118, i64 noundef %119, i64 noundef 1, ptr noundef %120, i32 noundef %121, ptr noundef %24)
  %122 = load ptr, ptr %27, align 8, !tbaa !5
  %123 = load i64, ptr %21, align 8, !tbaa !11
  %124 = load ptr, ptr %17, align 8, !tbaa !5
  %125 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef %122, i64 noundef %123, i64 noundef 2, ptr noundef %124, i32 noundef %125, ptr noundef %24)
  br label %135

126:                                              ; preds = %93, %90
  %127 = load i64, ptr %21, align 8, !tbaa !11
  %128 = mul i64 %127, 4
  %129 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %128)
  store ptr %129, ptr %19, align 8, !tbaa !5
  %130 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %130, ptr %27, align 8, !tbaa !5
  store ptr %130, ptr %26, align 8, !tbaa !5
  store ptr %130, ptr %25, align 8, !tbaa !5
  %131 = load ptr, ptr %19, align 8, !tbaa !5
  %132 = load i64, ptr %21, align 8, !tbaa !11
  %133 = load ptr, ptr %17, align 8, !tbaa !5
  %134 = load i32, ptr %23, align 4, !tbaa !9
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef %131, i64 noundef %132, i64 noundef 0, ptr noundef %133, i32 noundef %134, ptr noundef %24)
  br label %135

135:                                              ; preds = %126, %97
  %136 = load i32, ptr %20, align 4, !tbaa !9
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %246

138:                                              ; preds = %135
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %139

139:                                              ; preds = %242, %138
  %140 = load i64, ptr %14, align 8, !tbaa !11
  %141 = load i64, ptr %15, align 8, !tbaa !11
  %142 = icmp ult i64 %140, %141
  br i1 %142, label %143, label %245

143:                                              ; preds = %139
  %144 = load ptr, ptr %25, align 8, !tbaa !5
  %145 = load ptr, ptr %18, align 8, !tbaa !5
  %146 = load i64, ptr %14, align 8, !tbaa !11
  %147 = mul i64 %146, 8
  %148 = add i64 %147, 0
  %149 = getelementptr inbounds i8, ptr %145, i64 %148
  %150 = load i8, ptr %149, align 1, !tbaa !23
  %151 = zext i8 %150 to i32
  %152 = mul i32 %151, 256
  %153 = load ptr, ptr %18, align 8, !tbaa !5
  %154 = load i64, ptr %14, align 8, !tbaa !11
  %155 = mul i64 %154, 8
  %156 = add i64 %155, 1
  %157 = getelementptr inbounds i8, ptr %153, i64 %156
  %158 = load i8, ptr %157, align 1, !tbaa !23
  %159 = zext i8 %158 to i32
  %160 = add i32 %152, %159
  %161 = zext i32 %160 to i64
  %162 = getelementptr inbounds float, ptr %144, i64 %161
  %163 = load float, ptr %162, align 4, !tbaa !24
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = load i64, ptr %14, align 8, !tbaa !11
  %166 = mul i64 %165, 4
  %167 = add i64 %166, 0
  %168 = getelementptr inbounds float, ptr %164, i64 %167
  store float %163, ptr %168, align 4, !tbaa !24
  %169 = load ptr, ptr %26, align 8, !tbaa !5
  %170 = load ptr, ptr %18, align 8, !tbaa !5
  %171 = load i64, ptr %14, align 8, !tbaa !11
  %172 = mul i64 %171, 8
  %173 = add i64 %172, 2
  %174 = getelementptr inbounds i8, ptr %170, i64 %173
  %175 = load i8, ptr %174, align 1, !tbaa !23
  %176 = zext i8 %175 to i32
  %177 = mul i32 %176, 256
  %178 = load ptr, ptr %18, align 8, !tbaa !5
  %179 = load i64, ptr %14, align 8, !tbaa !11
  %180 = mul i64 %179, 8
  %181 = add i64 %180, 3
  %182 = getelementptr inbounds i8, ptr %178, i64 %181
  %183 = load i8, ptr %182, align 1, !tbaa !23
  %184 = zext i8 %183 to i32
  %185 = add i32 %177, %184
  %186 = zext i32 %185 to i64
  %187 = getelementptr inbounds float, ptr %169, i64 %186
  %188 = load float, ptr %187, align 4, !tbaa !24
  %189 = load ptr, ptr %7, align 8, !tbaa !5
  %190 = load i64, ptr %14, align 8, !tbaa !11
  %191 = mul i64 %190, 4
  %192 = add i64 %191, 1
  %193 = getelementptr inbounds float, ptr %189, i64 %192
  store float %188, ptr %193, align 4, !tbaa !24
  %194 = load ptr, ptr %27, align 8, !tbaa !5
  %195 = load ptr, ptr %18, align 8, !tbaa !5
  %196 = load i64, ptr %14, align 8, !tbaa !11
  %197 = mul i64 %196, 8
  %198 = add i64 %197, 4
  %199 = getelementptr inbounds i8, ptr %195, i64 %198
  %200 = load i8, ptr %199, align 1, !tbaa !23
  %201 = zext i8 %200 to i32
  %202 = mul i32 %201, 256
  %203 = load ptr, ptr %18, align 8, !tbaa !5
  %204 = load i64, ptr %14, align 8, !tbaa !11
  %205 = mul i64 %204, 8
  %206 = add i64 %205, 5
  %207 = getelementptr inbounds i8, ptr %203, i64 %206
  %208 = load i8, ptr %207, align 1, !tbaa !23
  %209 = zext i8 %208 to i32
  %210 = add i32 %202, %209
  %211 = zext i32 %210 to i64
  %212 = getelementptr inbounds float, ptr %194, i64 %211
  %213 = load float, ptr %212, align 4, !tbaa !24
  %214 = load ptr, ptr %7, align 8, !tbaa !5
  %215 = load i64, ptr %14, align 8, !tbaa !11
  %216 = mul i64 %215, 4
  %217 = add i64 %216, 2
  %218 = getelementptr inbounds float, ptr %214, i64 %217
  store float %213, ptr %218, align 4, !tbaa !24
  %219 = load ptr, ptr %18, align 8, !tbaa !5
  %220 = load i64, ptr %14, align 8, !tbaa !11
  %221 = mul i64 %220, 8
  %222 = add i64 %221, 6
  %223 = getelementptr inbounds i8, ptr %219, i64 %222
  %224 = load i8, ptr %223, align 1, !tbaa !23
  %225 = zext i8 %224 to i32
  %226 = mul nsw i32 %225, 256
  %227 = load ptr, ptr %18, align 8, !tbaa !5
  %228 = load i64, ptr %14, align 8, !tbaa !11
  %229 = mul i64 %228, 8
  %230 = add i64 %229, 7
  %231 = getelementptr inbounds i8, ptr %227, i64 %230
  %232 = load i8, ptr %231, align 1, !tbaa !23
  %233 = zext i8 %232 to i32
  %234 = add nsw i32 %226, %233
  %235 = sitofp i32 %234 to float
  %236 = fmul float %235, 0x3EF0001000000000
  %237 = load ptr, ptr %7, align 8, !tbaa !5
  %238 = load i64, ptr %14, align 8, !tbaa !11
  %239 = mul i64 %238, 4
  %240 = add i64 %239, 3
  %241 = getelementptr inbounds float, ptr %237, i64 %240
  store float %236, ptr %241, align 4, !tbaa !24
  br label %242

242:                                              ; preds = %143
  %243 = load i64, ptr %14, align 8, !tbaa !11
  %244 = add i64 %243, 1
  store i64 %244, ptr %14, align 8, !tbaa !11
  br label %139, !llvm.loop !26

245:                                              ; preds = %139
  br label %315

246:                                              ; preds = %135
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %247

247:                                              ; preds = %311, %246
  %248 = load i64, ptr %14, align 8, !tbaa !11
  %249 = load i64, ptr %15, align 8, !tbaa !11
  %250 = icmp ult i64 %248, %249
  br i1 %250, label %251, label %314

251:                                              ; preds = %247
  %252 = load ptr, ptr %25, align 8, !tbaa !5
  %253 = load ptr, ptr %18, align 8, !tbaa !5
  %254 = load i64, ptr %14, align 8, !tbaa !11
  %255 = mul i64 %254, 4
  %256 = add i64 %255, 0
  %257 = getelementptr inbounds i8, ptr %253, i64 %256
  %258 = load i8, ptr %257, align 1, !tbaa !23
  %259 = zext i8 %258 to i64
  %260 = getelementptr inbounds float, ptr %252, i64 %259
  %261 = load float, ptr %260, align 4, !tbaa !24
  %262 = load ptr, ptr %7, align 8, !tbaa !5
  %263 = load i64, ptr %14, align 8, !tbaa !11
  %264 = mul i64 %263, 4
  %265 = add i64 %264, 0
  %266 = getelementptr inbounds float, ptr %262, i64 %265
  store float %261, ptr %266, align 4, !tbaa !24
  %267 = load ptr, ptr %26, align 8, !tbaa !5
  %268 = load ptr, ptr %18, align 8, !tbaa !5
  %269 = load i64, ptr %14, align 8, !tbaa !11
  %270 = mul i64 %269, 4
  %271 = add i64 %270, 1
  %272 = getelementptr inbounds i8, ptr %268, i64 %271
  %273 = load i8, ptr %272, align 1, !tbaa !23
  %274 = zext i8 %273 to i64
  %275 = getelementptr inbounds float, ptr %267, i64 %274
  %276 = load float, ptr %275, align 4, !tbaa !24
  %277 = load ptr, ptr %7, align 8, !tbaa !5
  %278 = load i64, ptr %14, align 8, !tbaa !11
  %279 = mul i64 %278, 4
  %280 = add i64 %279, 1
  %281 = getelementptr inbounds float, ptr %277, i64 %280
  store float %276, ptr %281, align 4, !tbaa !24
  %282 = load ptr, ptr %27, align 8, !tbaa !5
  %283 = load ptr, ptr %18, align 8, !tbaa !5
  %284 = load i64, ptr %14, align 8, !tbaa !11
  %285 = mul i64 %284, 4
  %286 = add i64 %285, 2
  %287 = getelementptr inbounds i8, ptr %283, i64 %286
  %288 = load i8, ptr %287, align 1, !tbaa !23
  %289 = zext i8 %288 to i64
  %290 = getelementptr inbounds float, ptr %282, i64 %289
  %291 = load float, ptr %290, align 4, !tbaa !24
  %292 = load ptr, ptr %7, align 8, !tbaa !5
  %293 = load i64, ptr %14, align 8, !tbaa !11
  %294 = mul i64 %293, 4
  %295 = add i64 %294, 2
  %296 = getelementptr inbounds float, ptr %292, i64 %295
  store float %291, ptr %296, align 4, !tbaa !24
  %297 = load ptr, ptr %18, align 8, !tbaa !5
  %298 = load i64, ptr %14, align 8, !tbaa !11
  %299 = mul i64 %298, 4
  %300 = add i64 %299, 3
  %301 = getelementptr inbounds i8, ptr %297, i64 %300
  %302 = load i8, ptr %301, align 1, !tbaa !23
  %303 = zext i8 %302 to i32
  %304 = sitofp i32 %303 to float
  %305 = fmul float %304, 0x3F70101020000000
  %306 = load ptr, ptr %7, align 8, !tbaa !5
  %307 = load i64, ptr %14, align 8, !tbaa !11
  %308 = mul i64 %307, 4
  %309 = add i64 %308, 3
  %310 = getelementptr inbounds float, ptr %306, i64 %309
  store float %305, ptr %310, align 4, !tbaa !24
  br label %311

311:                                              ; preds = %251
  %312 = load i64, ptr %14, align 8, !tbaa !11
  %313 = add i64 %312, 1
  store i64 %313, ptr %14, align 8, !tbaa !11
  br label %247, !llvm.loop !28

314:                                              ; preds = %247
  br label %315

315:                                              ; preds = %314, %245
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  %316 = load ptr, ptr %7, align 8, !tbaa !5
  %317 = load i32, ptr %10, align 4, !tbaa !9
  %318 = load i32, ptr %11, align 4, !tbaa !9
  %319 = load ptr, ptr %17, align 8, !tbaa !5
  %320 = load i32, ptr %23, align 4, !tbaa !9
  %321 = load ptr, ptr %8, align 8, !tbaa !5
  %322 = call noundef i32 @_ZN7lodepngL17convertToXYZ_chrmEPfjjPK11LodePNGInfojPKNS_10LodePNGICCES0_(ptr noundef %316, i32 noundef %317, i32 noundef %318, ptr noundef %319, i32 noundef %320, ptr noundef %24, ptr noundef %321)
  br label %323

323:                                              ; preds = %315, %89, %65
  call void @_ZN7lodepng19lodepng_icc_cleanupEPNS_10LodePNGICCE(ptr noundef %24)
  %324 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN7lodepngL12lodepng_freeEPv(ptr noundef %324)
  %325 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_ZN7lodepngL12lodepng_freeEPv(ptr noundef %325)
  %326 = load i32, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 296, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  ret i32 %326
}

declare void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind writable sret(%struct.LodePNGColorMode) align 8, i32 noundef, i32 noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef) #1

declare noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) #3

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !10, i64 4}
!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 = !{!17, !10, i64 232}
!17 = !{!"_ZTS11LodePNGInfo", !10, i64 0, !10, i64 4, !10, i64 8, !14, i64 16, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !12, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !10, i64 136, !18, i64 140, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !6, i64 240, !6, i64 248, !10, i64 256, !7, i64 264, !7, i64 288}
!18 = !{!"_ZTS11LodePNGTime", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!19 = !{!17, !6, i64 248}
!20 = !{!17, !10, i64 256}
!21 = !{!22, !10, i64 0}
!22 = !{!"_ZTSN7lodepng10LodePNGICCE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !7, i64 16, !10, i64 28, !7, i64 32, !10, i64 68, !7, i64 72, !10, i64 84, !7, i64 88, !7, i64 100, !7, i64 112, !10, i64 124, !7, i64 128}
!23 = !{!7, !7, i64 0}
!24 = !{!25, !25, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}


; 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.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%"struct.lodepng::LodePNGICC" = type { i32, i32, i32, i32, [3 x float], i32, [9 x float], i32, [3 x float], i32, [3 x float], [3 x float], [3 x float], i32, [3 x %"struct.lodepng::LodePNGICCCurve"] }
%"struct.lodepng::LodePNGICCCurve" = type { i32, ptr, i64, float, float, float, float, float, float, float }

; 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 nounwind uwtable
declare hidden void @_ZN7lodepngL12lodepng_freeEPv(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7lodepng16lodepng_icc_initEPNS_10LodePNGICCE(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7lodepng19lodepng_icc_cleanupEPNS_10LodePNGICCE(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN7lodepng12convertToXYZEPfS0_PKhjjPK12LodePNGState(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5) local_unnamed_addr #2 {
  %7 = alloca %struct.LodePNGColorMode, align 8
  %8 = alloca %"struct.lodepng::LodePNGICC", align 8
  %9 = mul i32 %4, %3
  %10 = zext i32 %9 to i64
  %11 = getelementptr inbounds i8, ptr %5, i64 168
  %12 = getelementptr inbounds i8, ptr %5, i64 208
  %13 = getelementptr inbounds i8, ptr %5, i64 172
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = icmp ugt i32 %14, 8
  %16 = select i1 %15, i64 65536, i64 256
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #4
  %17 = select i1 %15, i32 16, i32 8
  call void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind nonnull writable sret(%struct.LodePNGColorMode) align 8 %7, i32 noundef 6, i32 noundef %17)
  call void @llvm.lifetime.start.p0(i64 296, ptr nonnull %8) #4
  call void @_ZN7lodepng16lodepng_icc_initEPNS_10LodePNGICCE(ptr noundef nonnull %8)
  %18 = getelementptr inbounds i8, ptr %5, i64 440
  %19 = load i32, ptr %18, align 8, !tbaa !13
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %29, label %20

20:                                               ; preds = %6
  %21 = getelementptr inbounds i8, ptr %5, i64 456
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = getelementptr inbounds i8, ptr %5, i64 464
  %24 = load i32, ptr %23, align 8, !tbaa !17
  %25 = zext i32 %24 to i64
  %26 = call noundef i32 @_ZN7lodepngL8parseICCEPNS_10LodePNGICCEPKhm(ptr noundef nonnull %8, ptr noundef %22, i64 noundef %25)
  %.not120 = icmp eq i32 %26, 0
  br i1 %.not120, label %27, label %136

27:                                               ; preds = %20
  %28 = call noundef i32 @_ZN7lodepngL11validateICCEPKNS_10LodePNGICCE(ptr noundef nonnull %8)
  br label %29

29:                                               ; preds = %27, %6
  %.0111 = phi i32 [ %28, %27 ], [ 0, %6 ]
  %30 = zext i32 %3 to i64
  %31 = zext i32 %4 to i64
  %32 = mul nuw i64 %31, %30
  %33 = select i1 %15, i64 3, i64 2
  %34 = shl i64 %32, %33
  %35 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %34)
  %36 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %35, ptr noundef %2, ptr noundef nonnull %7, ptr noundef nonnull %11, i32 noundef %3, i32 noundef %4)
  %.not121 = icmp eq i32 %36, 0
  br i1 %.not121, label %37, label %136

37:                                               ; preds = %29
  %38 = icmp ne i32 %.0111, 0
  %39 = load i32, ptr %8, align 8
  %40 = icmp eq i32 %39, 2
  %or.cond = select i1 %38, i1 %40, i1 false
  br i1 %or.cond, label %41, label %46

41:                                               ; preds = %37
  %42 = select i1 %15, i64 786432, i64 3072
  %43 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %42)
  %44 = getelementptr inbounds float, ptr %43, i64 %16
  %.idx = shl nuw nsw i64 %16, 3
  %45 = getelementptr inbounds i8, ptr %43, i64 %.idx
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef %43, i64 noundef %16, i64 noundef 0, ptr noundef nonnull %12, i32 noundef %.0111, ptr noundef nonnull %8)
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef nonnull %44, i64 noundef %16, i64 noundef 1, ptr noundef nonnull %12, i32 noundef %.0111, ptr noundef nonnull %8)
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef nonnull %45, i64 noundef %16, i64 noundef 2, ptr noundef nonnull %12, i32 noundef %.0111, ptr noundef nonnull %8)
  br label %49

46:                                               ; preds = %37
  %47 = shl nuw nsw i64 %16, 2
  %48 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %47)
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef %48, i64 noundef %16, i64 noundef 0, ptr noundef nonnull %12, i32 noundef %.0111, ptr noundef nonnull %8)
  br label %49

49:                                               ; preds = %46, %41
  %.0110 = phi ptr [ %43, %41 ], [ %48, %46 ]
  %.0109 = phi ptr [ %44, %41 ], [ %48, %46 ]
  %.0 = phi ptr [ %45, %41 ], [ %48, %46 ]
  %.not128 = icmp eq i32 %9, 0
  br i1 %15, label %.preheader, label %.preheader122

.preheader122:                                    ; preds = %49
  br i1 %.not128, label %.loopexit, label %.lr.ph

.preheader:                                       ; preds = %49
  br i1 %.not128, label %.loopexit, label %.lr.ph126

.lr.ph126:                                        ; preds = %.preheader, %.lr.ph126
  %.0113125 = phi i64 [ %106, %.lr.ph126 ], [ 0, %.preheader ]
  %50 = shl nuw nsw i64 %.0113125, 3
  %51 = getelementptr inbounds i8, ptr %35, i64 %50
  %52 = load i8, ptr %51, align 1, !tbaa !18
  %53 = zext i8 %52 to i64
  %54 = shl nuw nsw i64 %53, 8
  %55 = or disjoint i64 %50, 1
  %56 = getelementptr inbounds i8, ptr %35, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !18
  %58 = zext i8 %57 to i64
  %59 = or disjoint i64 %54, %58
  %60 = getelementptr inbounds float, ptr %.0110, i64 %59
  %61 = load float, ptr %60, align 4, !tbaa !19
  %62 = shl nuw nsw i64 %.0113125, 2
  %63 = getelementptr inbounds float, ptr %0, i64 %62
  store float %61, ptr %63, align 4, !tbaa !19
  %64 = or disjoint i64 %50, 2
  %65 = getelementptr inbounds i8, ptr %35, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !18
  %67 = zext i8 %66 to i64
  %68 = shl nuw nsw i64 %67, 8
  %69 = or disjoint i64 %50, 3
  %70 = getelementptr inbounds i8, ptr %35, i64 %69
  %71 = load i8, ptr %70, align 1, !tbaa !18
  %72 = zext i8 %71 to i64
  %73 = or disjoint i64 %68, %72
  %74 = getelementptr inbounds float, ptr %.0109, i64 %73
  %75 = load float, ptr %74, align 4, !tbaa !19
  %76 = or disjoint i64 %62, 1
  %77 = getelementptr inbounds float, ptr %0, i64 %76
  store float %75, ptr %77, align 4, !tbaa !19
  %78 = or disjoint i64 %50, 4
  %79 = getelementptr inbounds i8, ptr %35, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !18
  %81 = zext i8 %80 to i64
  %82 = shl nuw nsw i64 %81, 8
  %83 = or disjoint i64 %50, 5
  %84 = getelementptr inbounds i8, ptr %35, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !18
  %86 = zext i8 %85 to i64
  %87 = or disjoint i64 %82, %86
  %88 = getelementptr inbounds float, ptr %.0, i64 %87
  %89 = load float, ptr %88, align 4, !tbaa !19
  %90 = or disjoint i64 %62, 2
  %91 = getelementptr inbounds float, ptr %0, i64 %90
  store float %89, ptr %91, align 4, !tbaa !19
  %92 = or disjoint i64 %50, 6
  %93 = getelementptr inbounds i8, ptr %35, i64 %92
  %94 = load i8, ptr %93, align 1, !tbaa !18
  %95 = zext i8 %94 to i32
  %96 = shl nuw nsw i32 %95, 8
  %97 = or disjoint i64 %50, 7
  %98 = getelementptr inbounds i8, ptr %35, i64 %97
  %99 = load i8, ptr %98, align 1, !tbaa !18
  %100 = zext i8 %99 to i32
  %101 = or disjoint i32 %96, %100
  %102 = uitofp nneg i32 %101 to float
  %103 = fmul float %102, 0x3EF0001000000000
  %104 = or disjoint i64 %62, 3
  %105 = getelementptr inbounds float, ptr %0, i64 %104
  store float %103, ptr %105, align 4, !tbaa !19
  %106 = add nuw nsw i64 %.0113125, 1
  %exitcond130.not = icmp eq i64 %106, %10
  br i1 %exitcond130.not, label %.loopexit, label %.lr.ph126, !llvm.loop !21

.lr.ph:                                           ; preds = %.preheader122, %.lr.ph
  %.1124 = phi i64 [ %134, %.lr.ph ], [ 0, %.preheader122 ]
  %107 = shl nuw nsw i64 %.1124, 2
  %108 = getelementptr inbounds i8, ptr %35, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !18
  %110 = zext i8 %109 to i64
  %111 = getelementptr inbounds float, ptr %.0110, i64 %110
  %112 = load float, ptr %111, align 4, !tbaa !19
  %113 = getelementptr inbounds float, ptr %0, i64 %107
  store float %112, ptr %113, align 4, !tbaa !19
  %114 = or disjoint i64 %107, 1
  %115 = getelementptr inbounds i8, ptr %35, i64 %114
  %116 = load i8, ptr %115, align 1, !tbaa !18
  %117 = zext i8 %116 to i64
  %118 = getelementptr inbounds float, ptr %.0109, i64 %117
  %119 = load float, ptr %118, align 4, !tbaa !19
  %120 = getelementptr inbounds float, ptr %0, i64 %114
  store float %119, ptr %120, align 4, !tbaa !19
  %121 = or disjoint i64 %107, 2
  %122 = getelementptr inbounds i8, ptr %35, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !18
  %124 = zext i8 %123 to i64
  %125 = getelementptr inbounds float, ptr %.0, i64 %124
  %126 = load float, ptr %125, align 4, !tbaa !19
  %127 = getelementptr inbounds float, ptr %0, i64 %121
  store float %126, ptr %127, align 4, !tbaa !19
  %128 = or disjoint i64 %107, 3
  %129 = getelementptr inbounds i8, ptr %35, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !18
  %131 = uitofp i8 %130 to float
  %132 = fmul float %131, 0x3F70101020000000
  %133 = getelementptr inbounds float, ptr %0, i64 %128
  store float %132, ptr %133, align 4, !tbaa !19
  %134 = add nuw nsw i64 %.1124, 1
  %exitcond.not = icmp eq i64 %134, %10
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !23

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph126, %.preheader122, %.preheader
  %135 = call noundef i32 @_ZN7lodepngL17convertToXYZ_chrmEPfjjPK11LodePNGInfojPKNS_10LodePNGICCES0_(ptr noundef %0, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %12, i32 noundef %.0111, ptr noundef nonnull %8, ptr noundef %1)
  br label %136

136:                                              ; preds = %29, %20, %.loopexit
  %.0116 = phi ptr [ null, %20 ], [ %35, %29 ], [ %35, %.loopexit ]
  %.1115 = phi ptr [ null, %20 ], [ null, %29 ], [ %.0110, %.loopexit ]
  %.0112 = phi i32 [ %26, %20 ], [ %36, %29 ], [ 0, %.loopexit ]
  call void @_ZN7lodepng19lodepng_icc_cleanupEPNS_10LodePNGICCE(ptr noundef nonnull %8)
  call void @_ZN7lodepngL12lodepng_freeEPv(ptr noundef %.0116)
  call void @_ZN7lodepngL12lodepng_freeEPv(ptr noundef %.1115)
  call void @llvm.lifetime.end.p0(i64 296, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #4
  ret i32 %.0112
}

declare void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind writable sret(%struct.LodePNGColorMode) align 8, i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef) local_unnamed_addr #1

declare noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !10, i64 4}
!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 = !{!14, !10, i64 232}
!14 = !{!"_ZTS11LodePNGInfo", !10, i64 0, !10, i64 4, !10, i64 8, !6, i64 16, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !12, i64 72, !11, i64 80, !11, i64 88, !12, i64 96, !11, i64 104, !11, i64 112, !11, i64 120, !11, i64 128, !10, i64 136, !15, i64 140, !10, i64 164, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !10, i64 188, !10, i64 192, !10, i64 196, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !10, i64 220, !10, i64 224, !10, i64 228, !10, i64 232, !11, i64 240, !11, i64 248, !10, i64 256, !8, i64 264, !8, i64 288}
!15 = !{!"_ZTS11LodePNGTime", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!16 = !{!14, !11, i64 248}
!17 = !{!14, !10, i64 256}
!18 = !{!8, !8, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"float", !8, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


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