; LLVM IR from JayXon/Leanify :: lib/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 %321

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 = load i32, ptr %11, align 4, !tbaa !9
  %71 = mul i32 %69, %70
  %72 = load i32, ptr %20, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 0
  %74 = zext i1 %73 to i64
  %75 = select i1 %73, i32 8, i32 4
  %76 = mul i32 %71, %75
  %77 = zext i32 %76 to i64
  %78 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %77)
  store ptr %78, ptr %18, align 8, !tbaa !5
  %79 = load ptr, ptr %18, align 8, !tbaa !5
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = load ptr, ptr %16, align 8, !tbaa !5
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %79, ptr noundef %80, ptr noundef %22, ptr noundef %81, i32 noundef %82, i32 noundef %83)
  store i32 %84, ptr %13, align 4, !tbaa !9
  %85 = load i32, ptr %13, align 4, !tbaa !9
  %86 = icmp ne i32 %85, 0
  br i1 %86, label %87, label %88

87:                                               ; preds = %68
  br label %321

88:                                               ; 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
  %89 = load i32, ptr %23, align 4, !tbaa !9
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %124

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

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

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

133:                                              ; preds = %124, %95
  %134 = load i32, ptr %20, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %244

136:                                              ; preds = %133
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %137

137:                                              ; preds = %240, %136
  %138 = load i64, ptr %14, align 8, !tbaa !11
  %139 = load i64, ptr %15, align 8, !tbaa !11
  %140 = icmp ult i64 %138, %139
  br i1 %140, label %141, label %243

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

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

243:                                              ; preds = %137
  br label %313

244:                                              ; preds = %133
  store i64 0, ptr %14, align 8, !tbaa !11
  br label %245

245:                                              ; preds = %309, %244
  %246 = load i64, ptr %14, align 8, !tbaa !11
  %247 = load i64, ptr %15, align 8, !tbaa !11
  %248 = icmp ult i64 %246, %247
  br i1 %248, label %249, label %312

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

309:                                              ; preds = %249
  %310 = load i64, ptr %14, align 8, !tbaa !11
  %311 = add i64 %310, 1
  store i64 %311, ptr %14, align 8, !tbaa !11
  br label %245, !llvm.loop !28

312:                                              ; preds = %245
  br label %313

313:                                              ; preds = %312, %243
  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
  %314 = load ptr, ptr %7, align 8, !tbaa !5
  %315 = load i32, ptr %10, align 4, !tbaa !9
  %316 = load i32, ptr %11, align 4, !tbaa !9
  %317 = load ptr, ptr %17, align 8, !tbaa !5
  %318 = load i32, ptr %23, align 4, !tbaa !9
  %319 = load ptr, ptr %8, align 8, !tbaa !5
  %320 = call noundef i32 @_ZN7lodepngL17convertToXYZ_chrmEPfjjPK11LodePNGInfojPKNS_10LodePNGICCES0_(ptr noundef %314, i32 noundef %315, i32 noundef %316, ptr noundef %317, i32 noundef %318, ptr noundef %24, ptr noundef %319)
  br label %321

321:                                              ; preds = %313, %87, %65
  call void @_ZN7lodepng19lodepng_icc_cleanupEPNS_10LodePNGICCE(ptr noundef %24)
  %322 = load ptr, ptr %18, align 8, !tbaa !5
  call void @_ZN7lodepngL12lodepng_freeEPv(ptr noundef %322)
  %323 = load ptr, ptr %19, align 8, !tbaa !5
  call void @_ZN7lodepngL12lodepng_freeEPv(ptr noundef %323)
  %324 = 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 %324
}

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 %134

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 = select i1 %15, i32 3, i32 2
  %31 = shl i32 %9, %30
  %32 = zext i32 %31 to i64
  %33 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %32)
  %34 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %33, ptr noundef %2, ptr noundef nonnull %7, ptr noundef nonnull %11, i32 noundef %3, i32 noundef %4)
  %.not121 = icmp eq i32 %34, 0
  br i1 %.not121, label %35, label %134

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

39:                                               ; preds = %35
  %40 = select i1 %15, i64 786432, i64 3072
  %41 = call noundef ptr @_ZN7lodepngL14lodepng_mallocEm(i64 noundef %40)
  %42 = getelementptr inbounds float, ptr %41, i64 %16
  %.idx = shl nuw nsw i64 %16, 3
  %43 = getelementptr inbounds i8, ptr %41, i64 %.idx
  call void @_ZN7lodepngL24convertToXYZ_gamma_tableEPfmmPK11LodePNGInfojPKNS_10LodePNGICCE(ptr noundef %41, 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 %42, 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 %43, i64 noundef %16, i64 noundef 2, ptr noundef nonnull %12, i32 noundef %.0111, ptr noundef nonnull %8)
  br label %47

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

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

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

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

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

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

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph126, %.preheader122, %.preheader
  %133 = 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 %134

134:                                              ; preds = %29, %20, %.loopexit
  %.0116 = phi ptr [ null, %20 ], [ %33, %29 ], [ %33, %.loopexit ]
  %.1115 = phi ptr [ null, %20 ], [ null, %29 ], [ %.0110, %.loopexit ]
  %.0112 = phi i32 [ %26, %20 ], [ %34, %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