; LLVM IR from alibaba/GCanvas :: core/android/png/thirdparty (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.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.ucvector = type { ptr, i64, i64 }
%struct.LodePNGState = type { %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32 }
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32 }
%struct.LodePNGDecompressSettings = type { i32, ptr, ptr, ptr }
%struct.LodePNGEncoderSettings = type { %struct.LodePNGCompressSettings, i32, i32, i32, ptr, i32 }
%struct.LodePNGCompressSettings = type { i32, i32, i32, i32, i32, i32, ptr, ptr, ptr }

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @lodepng_get_bpp(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @lodepng_info_copy(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @lodepng_convert(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @checkColorValidity(i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @lodepng_encode(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr 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 i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %struct.LodePNGInfo, align 8
  %15 = alloca %struct.ucvector, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca i64, align 8
  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 i32 %3, ptr %11, align 4, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %14) #2
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #2
  store ptr null, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #2
  store i64 0, ptr %17, align 8, !tbaa !11
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %21, align 8, !tbaa !5
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %22, align 8, !tbaa !11
  %23 = load ptr, ptr %13, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.LodePNGState, ptr %23, i32 0, i32 4
  store i32 0, ptr %24, align 8, !tbaa !13
  call void @lodepng_info_init(ptr noundef %14)
  %25 = load ptr, ptr %13, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.LodePNGState, ptr %25, i32 0, i32 3
  %27 = call i32 @lodepng_info_copy(ptr noundef %14, ptr noundef %26)
  %28 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %29 = getelementptr inbounds %struct.LodePNGColorMode, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !21
  %31 = icmp eq i32 %30, 3
  br i1 %31, label %38, label %32

32:                                               ; preds = %6
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.LodePNGState, ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %34, i32 0, i32 5
  %36 = load i32, ptr %35, align 8, !tbaa !22
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %38, label %54

38:                                               ; preds = %32, %6
  %39 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %40 = getelementptr inbounds %struct.LodePNGColorMode, ptr %39, i32 0, i32 3
  %41 = load i64, ptr %40, align 8, !tbaa !23
  %42 = icmp eq i64 %41, 0
  br i1 %42, label %48, label %43

43:                                               ; preds = %38
  %44 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %45 = getelementptr inbounds %struct.LodePNGColorMode, ptr %44, i32 0, i32 3
  %46 = load i64, ptr %45, align 8, !tbaa !23
  %47 = icmp ugt i64 %46, 256
  br i1 %47, label %48, label %54

48:                                               ; preds = %43, %38
  %49 = load ptr, ptr %13, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.LodePNGState, ptr %49, i32 0, i32 4
  store i32 68, ptr %50, align 8, !tbaa !13
  %51 = load ptr, ptr %13, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.LodePNGState, ptr %51, i32 0, i32 4
  %53 = load i32, ptr %52, align 8, !tbaa !13
  store i32 %53, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

54:                                               ; preds = %43, %32
  %55 = load ptr, ptr %13, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.LodePNGState, ptr %55, i32 0, i32 1
  %57 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %56, i32 0, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !24
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %74

60:                                               ; preds = %54
  %61 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %62 = load ptr, ptr %10, align 8, !tbaa !5
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = load i32, ptr %12, align 4, !tbaa !9
  %65 = load ptr, ptr %13, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.LodePNGState, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.LodePNGState, ptr %67, i32 0, i32 1
  %69 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %68, i32 0, i32 1
  %70 = load i32, ptr %69, align 8, !tbaa !24
  %71 = call i32 @doAutoChooseColor(ptr noundef %61, ptr noundef %62, i32 noundef %63, i32 noundef %64, ptr noundef %66, i32 noundef %70)
  %72 = load ptr, ptr %13, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.LodePNGState, ptr %72, i32 0, i32 4
  store i32 %71, ptr %73, align 8, !tbaa !13
  br label %74

74:                                               ; preds = %60, %54
  %75 = load ptr, ptr %13, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.LodePNGState, ptr %75, i32 0, i32 4
  %77 = load i32, ptr %76, align 8, !tbaa !13
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %83

79:                                               ; preds = %74
  %80 = load ptr, ptr %13, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.LodePNGState, ptr %80, i32 0, i32 4
  %82 = load i32, ptr %81, align 8, !tbaa !13
  store i32 %82, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

83:                                               ; preds = %74
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.LodePNGState, ptr %84, i32 0, i32 1
  %86 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %85, i32 0, i32 0
  %87 = getelementptr inbounds %struct.LodePNGCompressSettings, ptr %86, i32 0, i32 2
  %88 = load i32, ptr %87, align 8, !tbaa !25
  %89 = icmp ugt i32 %88, 32768
  br i1 %89, label %90, label %93

90:                                               ; preds = %83
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.LodePNGState, ptr %91, i32 0, i32 4
  store i32 60, ptr %92, align 8, !tbaa !13
  store i32 60, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

93:                                               ; preds = %83
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.LodePNGState, ptr %94, i32 0, i32 1
  %96 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %95, i32 0, i32 0
  %97 = getelementptr inbounds %struct.LodePNGCompressSettings, ptr %96, i32 0, i32 0
  %98 = load i32, ptr %97, align 8, !tbaa !26
  %99 = icmp ugt i32 %98, 2
  br i1 %99, label %100, label %103

100:                                              ; preds = %93
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.LodePNGState, ptr %101, i32 0, i32 4
  store i32 61, ptr %102, align 8, !tbaa !13
  store i32 61, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

103:                                              ; preds = %93
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.LodePNGState, ptr %104, i32 0, i32 3
  %106 = getelementptr inbounds %struct.LodePNGInfo, ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 8, !tbaa !27
  %108 = icmp ugt i32 %107, 1
  br i1 %108, label %109, label %112

109:                                              ; preds = %103
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.LodePNGState, ptr %110, i32 0, i32 4
  store i32 71, ptr %111, align 8, !tbaa !13
  store i32 71, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

112:                                              ; preds = %103
  %113 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %114 = getelementptr inbounds %struct.LodePNGColorMode, ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 8, !tbaa !21
  %116 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %117 = getelementptr inbounds %struct.LodePNGColorMode, ptr %116, i32 0, i32 1
  %118 = load i32, ptr %117, align 4, !tbaa !28
  %119 = call i32 @checkColorValidity(i32 noundef %115, i32 noundef %118)
  %120 = load ptr, ptr %13, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.LodePNGState, ptr %120, i32 0, i32 4
  store i32 %119, ptr %121, align 8, !tbaa !13
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.LodePNGState, ptr %122, i32 0, i32 4
  %124 = load i32, ptr %123, align 8, !tbaa !13
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %112
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.LodePNGState, ptr %127, i32 0, i32 4
  %129 = load i32, ptr %128, align 8, !tbaa !13
  store i32 %129, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

130:                                              ; preds = %112
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.LodePNGState, ptr %131, i32 0, i32 2
  %133 = getelementptr inbounds %struct.LodePNGColorMode, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 8, !tbaa !29
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.LodePNGState, ptr %135, i32 0, i32 2
  %137 = getelementptr inbounds %struct.LodePNGColorMode, ptr %136, i32 0, i32 1
  %138 = load i32, ptr %137, align 4, !tbaa !30
  %139 = call i32 @checkColorValidity(i32 noundef %134, i32 noundef %138)
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.LodePNGState, ptr %140, i32 0, i32 4
  store i32 %139, ptr %141, align 8, !tbaa !13
  %142 = load ptr, ptr %13, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.LodePNGState, ptr %142, i32 0, i32 4
  %144 = load i32, ptr %143, align 8, !tbaa !13
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %150

146:                                              ; preds = %130
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.LodePNGState, ptr %147, i32 0, i32 4
  %149 = load i32, ptr %148, align 8, !tbaa !13
  store i32 %149, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

150:                                              ; preds = %130
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.LodePNGState, ptr %151, i32 0, i32 2
  %153 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %154 = call i32 @lodepng_color_mode_equal(ptr noundef %152, ptr noundef %153)
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %206, label %156

156:                                              ; preds = %150
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #2
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = load i32, ptr %12, align 4, !tbaa !9
  %159 = mul i32 %157, %158
  %160 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %161 = call i32 @lodepng_get_bpp(ptr noundef %160)
  %162 = mul i32 %159, %161
  %163 = add i32 %162, 7
  %164 = udiv i32 %163, 8
  %165 = zext i32 %164 to i64
  store i64 %165, ptr %20, align 8, !tbaa !11
  %166 = load i64, ptr %20, align 8, !tbaa !11
  %167 = call ptr @lodepng_malloc(i64 noundef %166)
  store ptr %167, ptr %19, align 8, !tbaa !5
  %168 = load ptr, ptr %19, align 8, !tbaa !5
  %169 = icmp ne ptr %168, null
  br i1 %169, label %176, label %170

170:                                              ; preds = %156
  %171 = load i64, ptr %20, align 8, !tbaa !11
  %172 = icmp ne i64 %171, 0
  br i1 %172, label %173, label %176

173:                                              ; preds = %170
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.LodePNGState, ptr %174, i32 0, i32 4
  store i32 83, ptr %175, align 8, !tbaa !13
  br label %176

176:                                              ; preds = %173, %170, %156
  %177 = load ptr, ptr %13, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.LodePNGState, ptr %177, i32 0, i32 4
  %179 = load i32, ptr %178, align 8, !tbaa !13
  %180 = icmp ne i32 %179, 0
  br i1 %180, label %192, label %181

181:                                              ; preds = %176
  %182 = load ptr, ptr %19, align 8, !tbaa !5
  %183 = load ptr, ptr %10, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %185 = load ptr, ptr %13, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.LodePNGState, ptr %185, i32 0, i32 2
  %187 = load i32, ptr %11, align 4, !tbaa !9
  %188 = load i32, ptr %12, align 4, !tbaa !9
  %189 = call i32 @lodepng_convert(ptr noundef %182, ptr noundef %183, ptr noundef %184, ptr noundef %186, i32 noundef %187, i32 noundef %188, i32 noundef 0)
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.LodePNGState, ptr %190, i32 0, i32 4
  store i32 %189, ptr %191, align 8, !tbaa !13
  br label %192

192:                                              ; preds = %181, %176
  %193 = load ptr, ptr %13, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.LodePNGState, ptr %193, i32 0, i32 4
  %195 = load i32, ptr %194, align 8, !tbaa !13
  %196 = icmp ne i32 %195, 0
  br i1 %196, label %204, label %197

197:                                              ; preds = %192
  %198 = load ptr, ptr %19, align 8, !tbaa !5
  %199 = load i32, ptr %11, align 4, !tbaa !9
  %200 = load i32, ptr %12, align 4, !tbaa !9
  %201 = load ptr, ptr %13, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.LodePNGState, ptr %201, i32 0, i32 1
  %203 = call i32 @preProcessScanlines(ptr noundef %16, ptr noundef %17, ptr noundef %198, i32 noundef %199, i32 noundef %200, ptr noundef %14, ptr noundef %202)
  br label %204

204:                                              ; preds = %197, %192
  %205 = load ptr, ptr %19, align 8, !tbaa !5
  call void @lodepng_free(ptr noundef %205)
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #2
  br label %213

206:                                              ; preds = %150
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = load i32, ptr %11, align 4, !tbaa !9
  %209 = load i32, ptr %12, align 4, !tbaa !9
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.LodePNGState, ptr %210, i32 0, i32 1
  %212 = call i32 @preProcessScanlines(ptr noundef %16, ptr noundef %17, ptr noundef %207, i32 noundef %208, i32 noundef %209, ptr noundef %14, ptr noundef %211)
  br label %213

213:                                              ; preds = %206, %204
  call void @ucvector_init(ptr noundef %15)
  br label %214

214:                                              ; preds = %213
  %215 = load ptr, ptr %13, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.LodePNGState, ptr %215, i32 0, i32 4
  %217 = load i32, ptr %216, align 8, !tbaa !13
  %218 = icmp ne i32 %217, 0
  %219 = xor i1 %218, true
  br i1 %219, label %220, label %309

220:                                              ; preds = %214
  call void @writeSignature(ptr noundef %15)
  %221 = load i32, ptr %11, align 4, !tbaa !9
  %222 = load i32, ptr %12, align 4, !tbaa !9
  %223 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %224 = getelementptr inbounds %struct.LodePNGColorMode, ptr %223, i32 0, i32 0
  %225 = load i32, ptr %224, align 8, !tbaa !21
  %226 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %227 = getelementptr inbounds %struct.LodePNGColorMode, ptr %226, i32 0, i32 1
  %228 = load i32, ptr %227, align 4, !tbaa !28
  %229 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 2
  %230 = load i32, ptr %229, align 8, !tbaa !31
  %231 = call i32 @addChunk_IHDR(ptr noundef %15, i32 noundef %221, i32 noundef %222, i32 noundef %225, i32 noundef %228, i32 noundef %230)
  %232 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %233 = getelementptr inbounds %struct.LodePNGColorMode, ptr %232, i32 0, i32 0
  %234 = load i32, ptr %233, align 8, !tbaa !21
  %235 = icmp eq i32 %234, 3
  br i1 %235, label %236, label %239

236:                                              ; preds = %220
  %237 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %238 = call i32 @addChunk_PLTE(ptr noundef %15, ptr noundef %237)
  br label %239

239:                                              ; preds = %236, %220
  %240 = load ptr, ptr %13, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.LodePNGState, ptr %240, i32 0, i32 1
  %242 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %241, i32 0, i32 5
  %243 = load i32, ptr %242, align 8, !tbaa !22
  %244 = icmp ne i32 %243, 0
  br i1 %244, label %245, label %258

245:                                              ; preds = %239
  %246 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %247 = getelementptr inbounds %struct.LodePNGColorMode, ptr %246, i32 0, i32 0
  %248 = load i32, ptr %247, align 8, !tbaa !21
  %249 = icmp eq i32 %248, 2
  br i1 %249, label %255, label %250

250:                                              ; preds = %245
  %251 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %252 = getelementptr inbounds %struct.LodePNGColorMode, ptr %251, i32 0, i32 0
  %253 = load i32, ptr %252, align 8, !tbaa !21
  %254 = icmp eq i32 %253, 6
  br i1 %254, label %255, label %258

255:                                              ; preds = %250, %245
  %256 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %257 = call i32 @addChunk_PLTE(ptr noundef %15, ptr noundef %256)
  br label %258

258:                                              ; preds = %255, %250, %239
  %259 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %260 = getelementptr inbounds %struct.LodePNGColorMode, ptr %259, i32 0, i32 0
  %261 = load i32, ptr %260, align 8, !tbaa !21
  %262 = icmp eq i32 %261, 3
  br i1 %262, label %263, label %275

263:                                              ; preds = %258
  %264 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %265 = getelementptr inbounds %struct.LodePNGColorMode, ptr %264, i32 0, i32 2
  %266 = load ptr, ptr %265, align 8, !tbaa !32
  %267 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %268 = getelementptr inbounds %struct.LodePNGColorMode, ptr %267, i32 0, i32 3
  %269 = load i64, ptr %268, align 8, !tbaa !23
  %270 = call i32 @getPaletteTranslucency(ptr noundef %266, i64 noundef %269)
  %271 = icmp ne i32 %270, 0
  br i1 %271, label %272, label %275

272:                                              ; preds = %263
  %273 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %274 = call i32 @addChunk_tRNS(ptr noundef %15, ptr noundef %273)
  br label %275

275:                                              ; preds = %272, %263, %258
  %276 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %277 = getelementptr inbounds %struct.LodePNGColorMode, ptr %276, i32 0, i32 0
  %278 = load i32, ptr %277, align 8, !tbaa !21
  %279 = icmp eq i32 %278, 0
  br i1 %279, label %285, label %280

280:                                              ; preds = %275
  %281 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %282 = getelementptr inbounds %struct.LodePNGColorMode, ptr %281, i32 0, i32 0
  %283 = load i32, ptr %282, align 8, !tbaa !21
  %284 = icmp eq i32 %283, 2
  br i1 %284, label %285, label %293

285:                                              ; preds = %280, %275
  %286 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %287 = getelementptr inbounds %struct.LodePNGColorMode, ptr %286, i32 0, i32 4
  %288 = load i32, ptr %287, align 8, !tbaa !33
  %289 = icmp ne i32 %288, 0
  br i1 %289, label %290, label %293

290:                                              ; preds = %285
  %291 = getelementptr inbounds %struct.LodePNGInfo, ptr %14, i32 0, i32 3
  %292 = call i32 @addChunk_tRNS(ptr noundef %15, ptr noundef %291)
  br label %293

293:                                              ; preds = %290, %285, %280
  %294 = load ptr, ptr %16, align 8, !tbaa !5
  %295 = load i64, ptr %17, align 8, !tbaa !11
  %296 = load ptr, ptr %13, align 8, !tbaa !5
  %297 = getelementptr inbounds %struct.LodePNGState, ptr %296, i32 0, i32 1
  %298 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %297, i32 0, i32 0
  %299 = call i32 @addChunk_IDAT(ptr noundef %15, ptr noundef %294, i64 noundef %295, ptr noundef %298)
  %300 = load ptr, ptr %13, align 8, !tbaa !5
  %301 = getelementptr inbounds %struct.LodePNGState, ptr %300, i32 0, i32 4
  store i32 %299, ptr %301, align 8, !tbaa !13
  %302 = load ptr, ptr %13, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.LodePNGState, ptr %302, i32 0, i32 4
  %304 = load i32, ptr %303, align 8, !tbaa !13
  %305 = icmp ne i32 %304, 0
  br i1 %305, label %306, label %307

306:                                              ; preds = %293
  br label %309

307:                                              ; preds = %293
  %308 = call i32 @addChunk_IEND(ptr noundef %15)
  br label %309

309:                                              ; preds = %307, %306, %214
  call void @lodepng_info_cleanup(ptr noundef %14)
  %310 = load ptr, ptr %16, align 8, !tbaa !5
  call void @lodepng_free(ptr noundef %310)
  %311 = getelementptr inbounds %struct.ucvector, ptr %15, i32 0, i32 0
  %312 = load ptr, ptr %311, align 8, !tbaa !34
  %313 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %312, ptr %313, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.ucvector, ptr %15, i32 0, i32 1
  %315 = load i64, ptr %314, align 8, !tbaa !36
  %316 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %315, ptr %316, align 8, !tbaa !11
  %317 = load ptr, ptr %13, align 8, !tbaa !5
  %318 = getelementptr inbounds %struct.LodePNGState, ptr %317, i32 0, i32 4
  %319 = load i32, ptr %318, align 8, !tbaa !13
  store i32 %319, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %320

320:                                              ; preds = %309, %146, %126, %109, %100, %90, %79, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 56, ptr %14) #2
  %321 = load i32, ptr %7, align 4
  ret i32 %321
}

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @getPaletteTranslucency(ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @addChunk_IDAT(ptr noundef, ptr noundef, i64 noundef, ptr noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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/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 224}
!14 = !{!"LodePNGState", !15, i64 0, !17, i64 48, !19, i64 128, !20, i64 168, !10, i64 224}
!15 = !{!"LodePNGDecoderSettings", !16, i64 0, !10, i64 32, !10, i64 36, !10, i64 40}
!16 = !{!"LodePNGDecompressSettings", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"LodePNGEncoderSettings", !18, i64 0, !10, i64 48, !10, i64 52, !10, i64 56, !6, i64 64, !10, i64 72}
!18 = !{!"LodePNGCompressSettings", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!19 = !{!"LodePNGColorMode", !10, i64 0, !10, i64 4, !6, i64 8, !12, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!20 = !{!"LodePNGInfo", !10, i64 0, !10, i64 4, !10, i64 8, !19, i64 16}
!21 = !{!20, !10, i64 16}
!22 = !{!14, !10, i64 120}
!23 = !{!20, !12, i64 32}
!24 = !{!14, !10, i64 96}
!25 = !{!14, !10, i64 56}
!26 = !{!14, !10, i64 48}
!27 = !{!14, !10, i64 176}
!28 = !{!20, !10, i64 20}
!29 = !{!14, !10, i64 128}
!30 = !{!14, !10, i64 132}
!31 = !{!20, !10, i64 8}
!32 = !{!20, !6, i64 24}
!33 = !{!20, !10, i64 40}
!34 = !{!35, !6, i64 0}
!35 = !{!"ucvector", !6, i64 0, !12, i64 8, !12, i64 16}
!36 = !{!35, !12, i64 8}


; 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.LodePNGInfo = type { i32, i32, i32, %struct.LodePNGColorMode }
%struct.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.ucvector = type { ptr, i64, i64 }

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

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @lodepng_get_bpp(ptr noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @lodepng_info_copy(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @lodepng_convert(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @checkColorValidity(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local i32 @lodepng_encode(ptr nocapture noundef writeonly %0, ptr nocapture noundef writeonly %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = alloca %struct.LodePNGInfo, align 8
  %8 = alloca %struct.ucvector, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #2
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #2
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #2
  store i64 0, ptr %10, align 8, !tbaa !9
  store ptr null, ptr %0, align 8, !tbaa !5
  store i64 0, ptr %1, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %5, i64 224
  store i32 0, ptr %11, align 8, !tbaa !11
  call void @lodepng_info_init(ptr noundef nonnull %7)
  %12 = getelementptr inbounds i8, ptr %5, i64 168
  %13 = call i32 @lodepng_info_copy(ptr noundef nonnull %7, ptr noundef nonnull %12)
  %14 = getelementptr inbounds i8, ptr %7, i64 16
  %15 = load i32, ptr %14, align 8, !tbaa !20
  %16 = icmp eq i32 %15, 3
  br i1 %16, label %20, label %17

17:                                               ; preds = %6
  %18 = getelementptr inbounds i8, ptr %5, i64 120
  %19 = load i32, ptr %18, align 8, !tbaa !21
  %.not = icmp eq i32 %19, 0
  br i1 %.not, label %25, label %20

20:                                               ; preds = %17, %6
  %21 = getelementptr inbounds i8, ptr %7, i64 32
  %22 = load i64, ptr %21, align 8
  %23 = add i64 %22, -257
  %or.cond = icmp ult i64 %23, -256
  br i1 %or.cond, label %24, label %25

24:                                               ; preds = %20
  store i32 68, ptr %11, align 8, !tbaa !11
  br label %126

25:                                               ; preds = %20, %17
  %26 = getelementptr inbounds i8, ptr %5, i64 48
  %27 = getelementptr inbounds i8, ptr %5, i64 96
  %28 = load i32, ptr %27, align 8, !tbaa !22
  %.not85 = icmp eq i32 %28, 0
  br i1 %.not85, label %thread-pre-split, label %29

29:                                               ; preds = %25
  %30 = getelementptr inbounds i8, ptr %5, i64 128
  %31 = call i32 @doAutoChooseColor(ptr noundef nonnull %14, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %30, i32 noundef %28)
  store i32 %31, ptr %11, align 8, !tbaa !11
  br label %32

thread-pre-split:                                 ; preds = %25
  %.pr = load i32, ptr %11, align 8, !tbaa !11
  br label %32

32:                                               ; preds = %thread-pre-split, %29
  %33 = phi i32 [ %.pr, %thread-pre-split ], [ %31, %29 ]
  %.not86 = icmp eq i32 %33, 0
  br i1 %.not86, label %34, label %126

34:                                               ; preds = %32
  %35 = getelementptr inbounds i8, ptr %5, i64 56
  %36 = load i32, ptr %35, align 8, !tbaa !23
  %37 = icmp ugt i32 %36, 32768
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  store i32 60, ptr %11, align 8, !tbaa !11
  br label %126

39:                                               ; preds = %34
  %40 = load i32, ptr %26, align 8, !tbaa !24
  %41 = icmp ugt i32 %40, 2
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  store i32 61, ptr %11, align 8, !tbaa !11
  br label %126

43:                                               ; preds = %39
  %44 = getelementptr inbounds i8, ptr %5, i64 176
  %45 = load i32, ptr %44, align 8, !tbaa !25
  %46 = icmp ugt i32 %45, 1
  br i1 %46, label %47, label %48

47:                                               ; preds = %43
  store i32 71, ptr %11, align 8, !tbaa !11
  br label %126

48:                                               ; preds = %43
  %49 = load i32, ptr %14, align 8, !tbaa !20
  %50 = getelementptr inbounds i8, ptr %7, i64 20
  %51 = load i32, ptr %50, align 4, !tbaa !26
  %52 = call i32 @checkColorValidity(i32 noundef %49, i32 noundef %51)
  store i32 %52, ptr %11, align 8, !tbaa !11
  %.not87 = icmp eq i32 %52, 0
  br i1 %.not87, label %53, label %126

53:                                               ; preds = %48
  %54 = getelementptr inbounds i8, ptr %5, i64 128
  %55 = load i32, ptr %54, align 8, !tbaa !27
  %56 = getelementptr inbounds i8, ptr %5, i64 132
  %57 = load i32, ptr %56, align 4, !tbaa !28
  %58 = call i32 @checkColorValidity(i32 noundef %55, i32 noundef %57)
  store i32 %58, ptr %11, align 8, !tbaa !11
  %.not88 = icmp eq i32 %58, 0
  br i1 %.not88, label %59, label %126

59:                                               ; preds = %53
  %60 = call i32 @lodepng_color_mode_equal(ptr noundef nonnull %54, ptr noundef nonnull %14)
  %.not89 = icmp eq i32 %60, 0
  br i1 %.not89, label %61, label %76

61:                                               ; preds = %59
  %62 = mul i32 %4, %3
  %63 = call i32 @lodepng_get_bpp(ptr noundef nonnull %14)
  %64 = mul i32 %62, %63
  %65 = add i32 %64, 7
  %66 = lshr i32 %65, 3
  %67 = zext nneg i32 %66 to i64
  %68 = call ptr @lodepng_malloc(i64 noundef %67)
  %69 = icmp eq ptr %68, null
  %70 = icmp ugt i32 %65, 7
  %or.cond5 = and i1 %69, %70
  br i1 %or.cond5, label %.thread, label %71

.thread:                                          ; preds = %61
  store i32 83, ptr %11, align 8, !tbaa !11
  br label %.thread99

71:                                               ; preds = %61
  %.pr97 = load i32, ptr %11, align 8, !tbaa !11
  %.not90 = icmp eq i32 %.pr97, 0
  br i1 %.not90, label %72, label %.thread99

72:                                               ; preds = %71
  %73 = call i32 @lodepng_convert(ptr noundef %68, ptr noundef %2, ptr noundef nonnull %14, ptr noundef nonnull %54, i32 noundef %3, i32 noundef %4, i32 noundef 0)
  store i32 %73, ptr %11, align 8, !tbaa !11
  %.not91 = icmp eq i32 %73, 0
  br i1 %.not91, label %74, label %.thread99

74:                                               ; preds = %72
  %75 = call i32 @preProcessScanlines(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %68, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %7, ptr noundef nonnull %26)
  br label %.thread99

.thread99:                                        ; preds = %71, %.thread, %74, %72
  call void @lodepng_free(ptr noundef %68)
  br label %78

76:                                               ; preds = %59
  %77 = call i32 @preProcessScanlines(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %7, ptr noundef nonnull %26)
  br label %78

78:                                               ; preds = %76, %.thread99
  call void @ucvector_init(ptr noundef nonnull %8)
  %79 = load i32, ptr %11, align 8, !tbaa !11
  %.not92 = icmp eq i32 %79, 0
  br i1 %.not92, label %80, label %120

80:                                               ; preds = %78
  call void @writeSignature(ptr noundef nonnull %8)
  %81 = load i32, ptr %14, align 8, !tbaa !20
  %82 = load i32, ptr %50, align 4, !tbaa !26
  %83 = getelementptr inbounds i8, ptr %7, i64 8
  %84 = load i32, ptr %83, align 8, !tbaa !29
  %85 = call i32 @addChunk_IHDR(ptr noundef nonnull %8, i32 noundef %3, i32 noundef %4, i32 noundef %81, i32 noundef %82, i32 noundef %84)
  %86 = load i32, ptr %14, align 8
  %87 = icmp eq i32 %86, 3
  br i1 %87, label %88, label %90

88:                                               ; preds = %80
  %89 = call i32 @addChunk_PLTE(ptr noundef nonnull %8, ptr noundef nonnull %14)
  %.pr102.pre103.pre = load i32, ptr %14, align 8
  br label %90

90:                                               ; preds = %88, %80
  %.pr102.pre103 = phi i32 [ %.pr102.pre103.pre, %88 ], [ %86, %80 ]
  %91 = getelementptr inbounds i8, ptr %5, i64 120
  %92 = load i32, ptr %91, align 8, !tbaa !21
  %.not93 = icmp ne i32 %92, 0
  %93 = and i32 %.pr102.pre103, -5
  %or.cond9 = icmp eq i32 %93, 2
  %or.cond106 = select i1 %.not93, i1 %or.cond9, i1 false
  br i1 %or.cond106, label %94, label %thread-pre-split101

94:                                               ; preds = %90
  %95 = call i32 @addChunk_PLTE(ptr noundef nonnull %8, ptr noundef nonnull %14)
  %.pr102.pre = load i32, ptr %14, align 8, !tbaa !20
  br label %thread-pre-split101

thread-pre-split101:                              ; preds = %94, %90
  %96 = phi i32 [ %.pr102.pre103, %90 ], [ %.pr102.pre, %94 ]
  %97 = icmp eq i32 %96, 3
  br i1 %97, label %98, label %106

98:                                               ; preds = %thread-pre-split101
  %99 = getelementptr inbounds i8, ptr %7, i64 24
  %100 = load ptr, ptr %99, align 8, !tbaa !30
  %101 = getelementptr inbounds i8, ptr %7, i64 32
  %102 = load i64, ptr %101, align 8, !tbaa !31
  %103 = call i32 @getPaletteTranslucency(ptr noundef %100, i64 noundef %102)
  %.not94 = icmp eq i32 %103, 0
  br i1 %.not94, label %106, label %104

104:                                              ; preds = %98
  %105 = call i32 @addChunk_tRNS(ptr noundef nonnull %8, ptr noundef nonnull %14)
  br label %106

106:                                              ; preds = %104, %98, %thread-pre-split101
  %107 = load i32, ptr %14, align 8
  %108 = and i32 %107, -3
  %or.cond13 = icmp eq i32 %108, 0
  %109 = getelementptr inbounds i8, ptr %7, i64 40
  %110 = load i32, ptr %109, align 8
  %111 = icmp ne i32 %110, 0
  %or.cond17 = select i1 %or.cond13, i1 %111, i1 false
  br i1 %or.cond17, label %112, label %114

112:                                              ; preds = %106
  %113 = call i32 @addChunk_tRNS(ptr noundef nonnull %8, ptr noundef nonnull %14)
  br label %114

114:                                              ; preds = %106, %112
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = load i64, ptr %10, align 8, !tbaa !9
  %117 = call i32 @addChunk_IDAT(ptr noundef nonnull %8, ptr noundef %115, i64 noundef %116, ptr noundef nonnull %26)
  store i32 %117, ptr %11, align 8, !tbaa !11
  %.not95 = icmp eq i32 %117, 0
  br i1 %.not95, label %118, label %120

118:                                              ; preds = %114
  %119 = call i32 @addChunk_IEND(ptr noundef nonnull %8)
  br label %120

120:                                              ; preds = %114, %118, %78
  call void @lodepng_info_cleanup(ptr noundef nonnull %7)
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  call void @lodepng_free(ptr noundef %121)
  %122 = load ptr, ptr %8, align 8, !tbaa !32
  store ptr %122, ptr %0, align 8, !tbaa !5
  %123 = getelementptr inbounds i8, ptr %8, i64 8
  %124 = load i64, ptr %123, align 8, !tbaa !34
  store i64 %124, ptr %1, align 8, !tbaa !9
  %125 = load i32, ptr %11, align 8, !tbaa !11
  br label %126

126:                                              ; preds = %53, %48, %32, %120, %47, %42, %38, %24
  %.0 = phi i32 [ 68, %24 ], [ 60, %38 ], [ 61, %42 ], [ 71, %47 ], [ %125, %120 ], [ %33, %32 ], [ %52, %48 ], [ %58, %53 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #2
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #2
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #2
  ret i32 %.0
}

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
declare hidden i32 @getPaletteTranslucency(ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @addChunk_IDAT(ptr noundef, ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !15, i64 224}
!12 = !{!"LodePNGState", !13, i64 0, !16, i64 48, !18, i64 128, !19, i64 168, !15, i64 224}
!13 = !{!"LodePNGDecoderSettings", !14, i64 0, !15, i64 32, !15, i64 36, !15, i64 40}
!14 = !{!"LodePNGDecompressSettings", !15, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!"LodePNGEncoderSettings", !17, i64 0, !15, i64 48, !15, i64 52, !15, i64 56, !6, i64 64, !15, i64 72}
!17 = !{!"LodePNGCompressSettings", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !6, i64 24, !6, i64 32, !6, i64 40}
!18 = !{!"LodePNGColorMode", !15, i64 0, !15, i64 4, !6, i64 8, !10, i64 16, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36}
!19 = !{!"LodePNGInfo", !15, i64 0, !15, i64 4, !15, i64 8, !18, i64 16}
!20 = !{!19, !15, i64 16}
!21 = !{!12, !15, i64 120}
!22 = !{!12, !15, i64 96}
!23 = !{!12, !15, i64 56}
!24 = !{!12, !15, i64 48}
!25 = !{!12, !15, i64 176}
!26 = !{!19, !15, i64 20}
!27 = !{!12, !15, i64 128}
!28 = !{!12, !15, i64 132}
!29 = !{!19, !15, i64 8}
!30 = !{!19, !6, i64 24}
!31 = !{!19, !10, i64 32}
!32 = !{!33, !6, i64 0}
!33 = !{!"ucvector", !6, i64 0, !10, i64 8, !10, i64 16}
!34 = !{!33, !10, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass