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

; 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.ucvector = type { ptr, i64, i64 }
%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 }
%struct.LodePNGColorStats = type { i32, i32, i16, i16, i16, i32, i32, [1024 x i8], i32, i64, i32, i32 }
%struct.LodePNGState = type <{ ptr, %struct.LodePNGDecoderSettings, %struct.LodePNGEncoderSettings, %struct.LodePNGColorMode, %struct.LodePNGInfo, i32, [4 x i8] }>
%struct.LodePNGDecoderSettings = type { %struct.LodePNGDecompressSettings, i32, i32, i32, i32, i32, i32 }
%struct.LodePNGDecompressSettings = type { i32, i32, 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 }

@LODEPNG_VERSION_STRING = external dso_local global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZL14lodepng_mallocm(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: mustprogress nounwind uwtable
declare hidden void @_ZL12lodepng_freePv(ptr noundef) #1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind noalias writable sret(%struct.LodePNGColorMode) align 8, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z15lodepng_get_bppPK16LodePNGColorMode(ptr noundef) #2

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z14lodepng_encodePPhPmPKhjjP12LodePNGState(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef %5) #2 {
  %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 ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca %struct.ucvector, align 8
  %17 = alloca %struct.LodePNGInfo, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %struct.LodePNGColorStats, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca %struct.LodePNGColorMode, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca ptr, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i32, align 4
  %32 = alloca ptr, 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 8, ptr %14) #3
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  store i64 0, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 312, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.LodePNGState, ptr %33, i32 0, i32 4
  store ptr %34, ptr %18, align 8, !tbaa !5
  call void @_ZL13ucvector_initP8ucvector(ptr noundef %16)
  call void @_Z17lodepng_info_initP11LodePNGInfo(ptr noundef %17)
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %35, align 8, !tbaa !5
  %36 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %36, align 8, !tbaa !11
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.LodePNGState, ptr %37, i32 0, i32 5
  store i32 0, ptr %38, align 8, !tbaa !13
  %39 = load ptr, ptr %18, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.LodePNGInfo, ptr %39, i32 0, i32 3
  %41 = getelementptr inbounds %struct.LodePNGColorMode, ptr %40, i32 0, i32 0
  %42 = load i32, ptr %41, align 8, !tbaa !24
  %43 = icmp eq i32 %42, 3
  br i1 %43, label %50, label %44

44:                                               ; preds = %6
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.LodePNGState, ptr %45, i32 0, i32 2
  %47 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %46, i32 0, i32 5
  %48 = load i32, ptr %47, align 8, !tbaa !25
  %49 = icmp ne i32 %48, 0
  br i1 %49, label %50, label %65

50:                                               ; preds = %44, %6
  %51 = load ptr, ptr %18, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.LodePNGInfo, ptr %51, i32 0, i32 3
  %53 = getelementptr inbounds %struct.LodePNGColorMode, ptr %52, i32 0, i32 3
  %54 = load i64, ptr %53, align 8, !tbaa !26
  %55 = icmp eq i64 %54, 0
  br i1 %55, label %62, label %56

56:                                               ; preds = %50
  %57 = load ptr, ptr %18, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.LodePNGInfo, ptr %57, i32 0, i32 3
  %59 = getelementptr inbounds %struct.LodePNGColorMode, ptr %58, i32 0, i32 3
  %60 = load i64, ptr %59, align 8, !tbaa !26
  %61 = icmp ugt i64 %60, 256
  br i1 %61, label %62, label %65

62:                                               ; preds = %56, %50
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.LodePNGState, ptr %63, i32 0, i32 5
  store i32 68, ptr %64, align 8, !tbaa !13
  br label %773

65:                                               ; preds = %56, %44
  %66 = load ptr, ptr %13, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.LodePNGState, ptr %66, i32 0, i32 2
  %68 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %67, i32 0, i32 0
  %69 = getelementptr inbounds %struct.LodePNGCompressSettings, ptr %68, i32 0, i32 0
  %70 = load i32, ptr %69, align 8, !tbaa !27
  %71 = icmp ugt i32 %70, 2
  br i1 %71, label %72, label %75

72:                                               ; preds = %65
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.LodePNGState, ptr %73, i32 0, i32 5
  store i32 61, ptr %74, align 8, !tbaa !13
  br label %773

75:                                               ; preds = %65
  %76 = load ptr, ptr %18, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.LodePNGInfo, ptr %76, i32 0, i32 2
  %78 = load i32, ptr %77, align 8, !tbaa !28
  %79 = icmp ugt i32 %78, 1
  br i1 %79, label %80, label %83

80:                                               ; preds = %75
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.LodePNGState, ptr %81, i32 0, i32 5
  store i32 71, ptr %82, align 8, !tbaa !13
  br label %773

83:                                               ; preds = %75
  %84 = load ptr, ptr %18, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.LodePNGInfo, ptr %84, i32 0, i32 3
  %86 = getelementptr inbounds %struct.LodePNGColorMode, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 8, !tbaa !24
  %88 = load ptr, ptr %18, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.LodePNGInfo, ptr %88, i32 0, i32 3
  %90 = getelementptr inbounds %struct.LodePNGColorMode, ptr %89, i32 0, i32 1
  %91 = load i32, ptr %90, align 4, !tbaa !29
  %92 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %87, i32 noundef %91)
  %93 = load ptr, ptr %13, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.LodePNGState, ptr %93, i32 0, i32 5
  store i32 %92, ptr %94, align 8, !tbaa !13
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.LodePNGState, ptr %95, i32 0, i32 5
  %97 = load i32, ptr %96, align 8, !tbaa !13
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %100

99:                                               ; preds = %83
  br label %773

100:                                              ; preds = %83
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.LodePNGState, ptr %101, i32 0, i32 3
  %103 = getelementptr inbounds %struct.LodePNGColorMode, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !30
  %105 = load ptr, ptr %13, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.LodePNGState, ptr %105, i32 0, i32 3
  %107 = getelementptr inbounds %struct.LodePNGColorMode, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !31
  %109 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %104, i32 noundef %108)
  %110 = load ptr, ptr %13, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.LodePNGState, ptr %110, i32 0, i32 5
  store i32 %109, ptr %111, align 8, !tbaa !13
  %112 = load ptr, ptr %13, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.LodePNGState, ptr %112, i32 0, i32 5
  %114 = load i32, ptr %113, align 8, !tbaa !13
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %117

116:                                              ; preds = %100
  br label %773

117:                                              ; preds = %100
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.LodePNGState, ptr %118, i32 0, i32 4
  %120 = call noundef i32 @_Z17lodepng_info_copyP11LodePNGInfoPKS_(ptr noundef %17, ptr noundef %119)
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.LodePNGState, ptr %121, i32 0, i32 2
  %123 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %122, i32 0, i32 1
  %124 = load i32, ptr %123, align 8, !tbaa !32
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %227

126:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 1072, ptr %19) #3
  call void @_Z24lodepng_color_stats_initP17LodePNGColorStats(ptr noundef %19)
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.LodePNGInfo, ptr %127, i32 0, i32 35
  %129 = load i32, ptr %128, align 8, !tbaa !33
  %130 = icmp ne i32 %129, 0
  br i1 %130, label %131, label %142

131:                                              ; preds = %126
  %132 = load ptr, ptr %18, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.LodePNGInfo, ptr %132, i32 0, i32 37
  %134 = load ptr, ptr %133, align 8, !tbaa !34
  %135 = load ptr, ptr %18, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.LodePNGInfo, ptr %135, i32 0, i32 38
  %137 = load i32, ptr %136, align 8, !tbaa !35
  %138 = call noundef i32 @_ZL16isGrayICCProfilePKhj(ptr noundef %134, i32 noundef %137)
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %142

140:                                              ; preds = %131
  %141 = getelementptr inbounds %struct.LodePNGColorStats, ptr %19, i32 0, i32 10
  store i32 0, ptr %141, align 8, !tbaa !36
  br label %142

142:                                              ; preds = %140, %131, %126
  %143 = load ptr, ptr %18, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.LodePNGInfo, ptr %143, i32 0, i32 35
  %145 = load i32, ptr %144, align 8, !tbaa !33
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %158

147:                                              ; preds = %142
  %148 = load ptr, ptr %18, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.LodePNGInfo, ptr %148, i32 0, i32 37
  %150 = load ptr, ptr %149, align 8, !tbaa !34
  %151 = load ptr, ptr %18, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.LodePNGInfo, ptr %151, i32 0, i32 38
  %153 = load i32, ptr %152, align 8, !tbaa !35
  %154 = call noundef i32 @_ZL15isRGBICCProfilePKhj(ptr noundef %150, i32 noundef %153)
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %158

156:                                              ; preds = %147
  %157 = getelementptr inbounds %struct.LodePNGColorStats, ptr %19, i32 0, i32 11
  store i32 0, ptr %157, align 4, !tbaa !39
  br label %158

158:                                              ; preds = %156, %147, %142
  %159 = load ptr, ptr %10, align 8, !tbaa !5
  %160 = load i32, ptr %11, align 4, !tbaa !9
  %161 = load i32, ptr %12, align 4, !tbaa !9
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.LodePNGState, ptr %162, i32 0, i32 3
  call void @_Z27lodepng_compute_color_statsP17LodePNGColorStatsPKhjjPK16LodePNGColorMode(ptr noundef %19, ptr noundef %159, i32 noundef %160, i32 noundef %161, ptr noundef %163)
  %164 = load ptr, ptr %18, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.LodePNGInfo, ptr %164, i32 0, i32 4
  %166 = load i32, ptr %165, align 8, !tbaa !40
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %184

168:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #3
  store i32 0, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #3
  store i32 0, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 40, ptr %23) #3
  call void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind writable sret(%struct.LodePNGColorMode) align 8 %23, i32 noundef 2, i32 noundef 16)
  %169 = load ptr, ptr %18, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.LodePNGInfo, ptr %169, i32 0, i32 5
  %171 = load i32, ptr %170, align 4, !tbaa !41
  %172 = load ptr, ptr %18, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.LodePNGInfo, ptr %172, i32 0, i32 6
  %174 = load i32, ptr %173, align 8, !tbaa !42
  %175 = load ptr, ptr %18, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.LodePNGInfo, ptr %175, i32 0, i32 7
  %177 = load i32, ptr %176, align 4, !tbaa !43
  %178 = load ptr, ptr %18, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.LodePNGInfo, ptr %178, i32 0, i32 3
  %180 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef %20, ptr noundef %21, ptr noundef %22, i32 noundef %171, i32 noundef %174, i32 noundef %177, ptr noundef %23, ptr noundef %179)
  %181 = load i32, ptr %20, align 4, !tbaa !9
  %182 = load i32, ptr %21, align 4, !tbaa !9
  %183 = load i32, ptr %22, align 4, !tbaa !9
  call void @_ZL23lodepng_color_stats_addP17LodePNGColorStatsjjjj(ptr noundef %19, i32 noundef %181, i32 noundef %182, i32 noundef %183, i32 noundef 65535)
  call void @llvm.lifetime.end.p0(i64 40, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #3
  br label %184

184:                                              ; preds = %168, %158
  %185 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %186 = load ptr, ptr %13, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.LodePNGState, ptr %186, i32 0, i32 3
  %188 = call noundef i32 @_Z17auto_choose_colorP16LodePNGColorModePKS_PK17LodePNGColorStats(ptr noundef %185, ptr noundef %187, ptr noundef %19)
  %189 = load ptr, ptr %13, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.LodePNGState, ptr %189, i32 0, i32 5
  store i32 %188, ptr %190, align 8, !tbaa !13
  %191 = load ptr, ptr %13, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.LodePNGState, ptr %191, i32 0, i32 5
  %193 = load i32, ptr %192, align 8, !tbaa !13
  %194 = icmp ne i32 %193, 0
  br i1 %194, label %195, label %196

195:                                              ; preds = %184
  store i32 2, ptr %24, align 4
  br label %224

196:                                              ; preds = %184
  %197 = load ptr, ptr %18, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.LodePNGInfo, ptr %197, i32 0, i32 4
  %199 = load i32, ptr %198, align 8, !tbaa !40
  %200 = icmp ne i32 %199, 0
  br i1 %200, label %201, label %223

201:                                              ; preds = %196
  %202 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 5
  %203 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 6
  %204 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 7
  %205 = load ptr, ptr %18, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.LodePNGInfo, ptr %205, i32 0, i32 5
  %207 = load i32, ptr %206, align 4, !tbaa !41
  %208 = load ptr, ptr %18, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.LodePNGInfo, ptr %208, i32 0, i32 6
  %210 = load i32, ptr %209, align 8, !tbaa !42
  %211 = load ptr, ptr %18, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.LodePNGInfo, ptr %211, i32 0, i32 7
  %213 = load i32, ptr %212, align 4, !tbaa !43
  %214 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %215 = load ptr, ptr %18, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.LodePNGInfo, ptr %215, i32 0, i32 3
  %217 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef %202, ptr noundef %203, ptr noundef %204, i32 noundef %207, i32 noundef %210, i32 noundef %213, ptr noundef %214, ptr noundef %216)
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %219, label %222

219:                                              ; preds = %201
  %220 = load ptr, ptr %13, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.LodePNGState, ptr %220, i32 0, i32 5
  store i32 104, ptr %221, align 8, !tbaa !13
  store i32 2, ptr %24, align 4
  br label %224

222:                                              ; preds = %201
  br label %223

223:                                              ; preds = %222, %196
  store i32 0, ptr %24, align 4
  br label %224

224:                                              ; preds = %223, %219, %195
  call void @llvm.lifetime.end.p0(i64 1072, ptr %19) #3
  %225 = load i32, ptr %24, align 4
  switch i32 %225, label %784 [
    i32 0, label %226
    i32 2, label %773
  ]

226:                                              ; preds = %224
  br label %227

227:                                              ; preds = %226, %117
  %228 = load ptr, ptr %18, align 8, !tbaa !5
  %229 = getelementptr inbounds %struct.LodePNGInfo, ptr %228, i32 0, i32 35
  %230 = load i32, ptr %229, align 8, !tbaa !33
  %231 = icmp ne i32 %230, 0
  br i1 %231, label %232, label %285

232:                                              ; preds = %227
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  %233 = load ptr, ptr %18, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.LodePNGInfo, ptr %233, i32 0, i32 37
  %235 = load ptr, ptr %234, align 8, !tbaa !34
  %236 = load ptr, ptr %18, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.LodePNGInfo, ptr %236, i32 0, i32 38
  %238 = load i32, ptr %237, align 8, !tbaa !35
  %239 = call noundef i32 @_ZL16isGrayICCProfilePKhj(ptr noundef %235, i32 noundef %238)
  store i32 %239, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #3
  %240 = load ptr, ptr %18, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.LodePNGInfo, ptr %240, i32 0, i32 37
  %242 = load ptr, ptr %241, align 8, !tbaa !34
  %243 = load ptr, ptr %18, align 8, !tbaa !5
  %244 = getelementptr inbounds %struct.LodePNGInfo, ptr %243, i32 0, i32 38
  %245 = load i32, ptr %244, align 8, !tbaa !35
  %246 = call noundef i32 @_ZL15isRGBICCProfilePKhj(ptr noundef %242, i32 noundef %245)
  store i32 %246, ptr %26, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #3
  %247 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %248 = getelementptr inbounds %struct.LodePNGColorMode, ptr %247, i32 0, i32 0
  %249 = load i32, ptr %248, align 8, !tbaa !24
  %250 = icmp eq i32 %249, 0
  br i1 %250, label %256, label %251

251:                                              ; preds = %232
  %252 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %253 = getelementptr inbounds %struct.LodePNGColorMode, ptr %252, i32 0, i32 0
  %254 = load i32, ptr %253, align 8, !tbaa !24
  %255 = icmp eq i32 %254, 4
  br label %256

256:                                              ; preds = %251, %232
  %257 = phi i1 [ true, %232 ], [ %255, %251 ]
  %258 = zext i1 %257 to i32
  store i32 %258, ptr %27, align 4, !tbaa !9
  %259 = load i32, ptr %25, align 4, !tbaa !9
  %260 = icmp ne i32 %259, 0
  br i1 %260, label %267, label %261

261:                                              ; preds = %256
  %262 = load i32, ptr %26, align 4, !tbaa !9
  %263 = icmp ne i32 %262, 0
  br i1 %263, label %267, label %264

264:                                              ; preds = %261
  %265 = load ptr, ptr %13, align 8, !tbaa !5
  %266 = getelementptr inbounds %struct.LodePNGState, ptr %265, i32 0, i32 5
  store i32 100, ptr %266, align 8, !tbaa !13
  store i32 2, ptr %24, align 4
  br label %282

267:                                              ; preds = %261, %256
  %268 = load i32, ptr %25, align 4, !tbaa !9
  %269 = load i32, ptr %27, align 4, !tbaa !9
  %270 = icmp ne i32 %268, %269
  br i1 %270, label %271, label %281

271:                                              ; preds = %267
  %272 = load ptr, ptr %13, align 8, !tbaa !5
  %273 = getelementptr inbounds %struct.LodePNGState, ptr %272, i32 0, i32 2
  %274 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %273, i32 0, i32 1
  %275 = load i32, ptr %274, align 8, !tbaa !32
  %276 = icmp ne i32 %275, 0
  %277 = zext i1 %276 to i64
  %278 = select i1 %276, i32 102, i32 101
  %279 = load ptr, ptr %13, align 8, !tbaa !5
  %280 = getelementptr inbounds %struct.LodePNGState, ptr %279, i32 0, i32 5
  store i32 %278, ptr %280, align 8, !tbaa !13
  store i32 2, ptr %24, align 4
  br label %282

281:                                              ; preds = %267
  store i32 0, ptr %24, align 4
  br label %282

282:                                              ; preds = %281, %271, %264
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  %283 = load i32, ptr %24, align 4
  switch i32 %283, label %784 [
    i32 0, label %284
    i32 2, label %773
  ]

284:                                              ; preds = %282
  br label %285

285:                                              ; preds = %284, %227
  %286 = load ptr, ptr %13, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.LodePNGState, ptr %286, i32 0, i32 3
  %288 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %289 = call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef %287, ptr noundef %288)
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %352, label %291

291:                                              ; preds = %285
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #3
  %292 = load i32, ptr %11, align 4, !tbaa !9
  %293 = zext i32 %292 to i64
  %294 = load i32, ptr %12, align 4, !tbaa !9
  %295 = zext i32 %294 to i64
  %296 = mul i64 %293, %295
  %297 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %298 = call noundef i32 @_Z15lodepng_get_bppPK16LodePNGColorMode(ptr noundef %297)
  %299 = zext i32 %298 to i64
  %300 = mul i64 %296, %299
  %301 = add i64 %300, 7
  %302 = udiv i64 %301, 8
  store i64 %302, ptr %29, align 8, !tbaa !11
  %303 = load i64, ptr %29, align 8, !tbaa !11
  %304 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %303)
  store ptr %304, ptr %28, align 8, !tbaa !5
  %305 = load ptr, ptr %28, align 8, !tbaa !5
  %306 = icmp ne ptr %305, null
  br i1 %306, label %313, label %307

307:                                              ; preds = %291
  %308 = load i64, ptr %29, align 8, !tbaa !11
  %309 = icmp ne i64 %308, 0
  br i1 %309, label %310, label %313

310:                                              ; preds = %307
  %311 = load ptr, ptr %13, align 8, !tbaa !5
  %312 = getelementptr inbounds %struct.LodePNGState, ptr %311, i32 0, i32 5
  store i32 83, ptr %312, align 8, !tbaa !13
  br label %313

313:                                              ; preds = %310, %307, %291
  %314 = load ptr, ptr %13, align 8, !tbaa !5
  %315 = getelementptr inbounds %struct.LodePNGState, ptr %314, i32 0, i32 5
  %316 = load i32, ptr %315, align 8, !tbaa !13
  %317 = icmp ne i32 %316, 0
  br i1 %317, label %329, label %318

318:                                              ; preds = %313
  %319 = load ptr, ptr %28, align 8, !tbaa !5
  %320 = load ptr, ptr %10, align 8, !tbaa !5
  %321 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %322 = load ptr, ptr %13, align 8, !tbaa !5
  %323 = getelementptr inbounds %struct.LodePNGState, ptr %322, i32 0, i32 3
  %324 = load i32, ptr %11, align 4, !tbaa !9
  %325 = load i32, ptr %12, align 4, !tbaa !9
  %326 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %319, ptr noundef %320, ptr noundef %321, ptr noundef %323, i32 noundef %324, i32 noundef %325)
  %327 = load ptr, ptr %13, align 8, !tbaa !5
  %328 = getelementptr inbounds %struct.LodePNGState, ptr %327, i32 0, i32 5
  store i32 %326, ptr %328, align 8, !tbaa !13
  br label %329

329:                                              ; preds = %318, %313
  %330 = load ptr, ptr %13, align 8, !tbaa !5
  %331 = getelementptr inbounds %struct.LodePNGState, ptr %330, i32 0, i32 5
  %332 = load i32, ptr %331, align 8, !tbaa !13
  %333 = icmp ne i32 %332, 0
  br i1 %333, label %341, label %334

334:                                              ; preds = %329
  %335 = load ptr, ptr %28, align 8, !tbaa !5
  %336 = load i32, ptr %11, align 4, !tbaa !9
  %337 = load i32, ptr %12, align 4, !tbaa !9
  %338 = load ptr, ptr %13, align 8, !tbaa !5
  %339 = getelementptr inbounds %struct.LodePNGState, ptr %338, i32 0, i32 2
  %340 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef %14, ptr noundef %15, ptr noundef %335, i32 noundef %336, i32 noundef %337, ptr noundef %17, ptr noundef %339)
  br label %341

341:                                              ; preds = %334, %329
  %342 = load ptr, ptr %28, align 8, !tbaa !5
  call void @_ZL12lodepng_freePv(ptr noundef %342)
  %343 = load ptr, ptr %13, align 8, !tbaa !5
  %344 = getelementptr inbounds %struct.LodePNGState, ptr %343, i32 0, i32 5
  %345 = load i32, ptr %344, align 8, !tbaa !13
  %346 = icmp ne i32 %345, 0
  br i1 %346, label %347, label %348

347:                                              ; preds = %341
  store i32 2, ptr %24, align 4
  br label %349

348:                                              ; preds = %341
  store i32 0, ptr %24, align 4
  br label %349

349:                                              ; preds = %348, %347
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #3
  %350 = load i32, ptr %24, align 4
  switch i32 %350, label %784 [
    i32 0, label %351
    i32 2, label %773
  ]

351:                                              ; preds = %349
  br label %359

352:                                              ; preds = %285
  %353 = load ptr, ptr %10, align 8, !tbaa !5
  %354 = load i32, ptr %11, align 4, !tbaa !9
  %355 = load i32, ptr %12, align 4, !tbaa !9
  %356 = load ptr, ptr %13, align 8, !tbaa !5
  %357 = getelementptr inbounds %struct.LodePNGState, ptr %356, i32 0, i32 2
  %358 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef %14, ptr noundef %15, ptr noundef %353, i32 noundef %354, i32 noundef %355, ptr noundef %17, ptr noundef %357)
  br label %359

359:                                              ; preds = %352, %351
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #3
  call void @_ZL14writeSignatureP8ucvector(ptr noundef %16)
  %360 = load i32, ptr %11, align 4, !tbaa !9
  %361 = load i32, ptr %12, align 4, !tbaa !9
  %362 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %363 = getelementptr inbounds %struct.LodePNGColorMode, ptr %362, i32 0, i32 0
  %364 = load i32, ptr %363, align 8, !tbaa !24
  %365 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %366 = getelementptr inbounds %struct.LodePNGColorMode, ptr %365, i32 0, i32 1
  %367 = load i32, ptr %366, align 4, !tbaa !29
  %368 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 2
  %369 = load i32, ptr %368, align 8, !tbaa !28
  %370 = call noundef i32 @_ZL13addChunk_IHDRP8ucvectorjj16LodePNGColorTypejj(ptr noundef %16, i32 noundef %360, i32 noundef %361, i32 noundef %364, i32 noundef %367, i32 noundef %369)
  %371 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %372 = getelementptr inbounds [3 x ptr], ptr %371, i64 0, i64 0
  %373 = load ptr, ptr %372, align 8, !tbaa !5
  %374 = icmp ne ptr %373, null
  br i1 %374, label %375, label %391

375:                                              ; preds = %359
  %376 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %377 = getelementptr inbounds [3 x ptr], ptr %376, i64 0, i64 0
  %378 = load ptr, ptr %377, align 8, !tbaa !5
  %379 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 40
  %380 = getelementptr inbounds [3 x i64], ptr %379, i64 0, i64 0
  %381 = load i64, ptr %380, align 8, !tbaa !11
  %382 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %16, ptr noundef %378, i64 noundef %381)
  %383 = load ptr, ptr %13, align 8, !tbaa !5
  %384 = getelementptr inbounds %struct.LodePNGState, ptr %383, i32 0, i32 5
  store i32 %382, ptr %384, align 8, !tbaa !13
  %385 = load ptr, ptr %13, align 8, !tbaa !5
  %386 = getelementptr inbounds %struct.LodePNGState, ptr %385, i32 0, i32 5
  %387 = load i32, ptr %386, align 8, !tbaa !13
  %388 = icmp ne i32 %387, 0
  br i1 %388, label %389, label %390

389:                                              ; preds = %375
  store i32 2, ptr %24, align 4
  br label %770

390:                                              ; preds = %375
  br label %391

391:                                              ; preds = %390, %359
  %392 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 35
  %393 = load i32, ptr %392, align 8, !tbaa !33
  %394 = icmp ne i32 %393, 0
  br i1 %394, label %395, label %400

395:                                              ; preds = %391
  %396 = load ptr, ptr %13, align 8, !tbaa !5
  %397 = getelementptr inbounds %struct.LodePNGState, ptr %396, i32 0, i32 2
  %398 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %397, i32 0, i32 0
  %399 = call noundef i32 @_ZL13addChunk_iCCPP8ucvectorPK11LodePNGInfoP23LodePNGCompressSettings(ptr noundef %16, ptr noundef %17, ptr noundef %398)
  br label %400

400:                                              ; preds = %395, %391
  %401 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 33
  %402 = load i32, ptr %401, align 8, !tbaa !44
  %403 = icmp ne i32 %402, 0
  br i1 %403, label %404, label %406

404:                                              ; preds = %400
  %405 = call noundef i32 @_ZL13addChunk_sRGBP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %406

406:                                              ; preds = %404, %400
  %407 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 22
  %408 = load i32, ptr %407, align 4, !tbaa !45
  %409 = icmp ne i32 %408, 0
  br i1 %409, label %410, label %412

410:                                              ; preds = %406
  %411 = call noundef i32 @_ZL13addChunk_gAMAP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %412

412:                                              ; preds = %410, %406
  %413 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 24
  %414 = load i32, ptr %413, align 4, !tbaa !46
  %415 = icmp ne i32 %414, 0
  br i1 %415, label %416, label %418

416:                                              ; preds = %412
  %417 = call noundef i32 @_ZL13addChunk_cHRMP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %418

418:                                              ; preds = %416, %412
  %419 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %420 = getelementptr inbounds %struct.LodePNGColorMode, ptr %419, i32 0, i32 0
  %421 = load i32, ptr %420, align 8, !tbaa !24
  %422 = icmp eq i32 %421, 3
  br i1 %422, label %423, label %426

423:                                              ; preds = %418
  %424 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %425 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %424)
  br label %426

426:                                              ; preds = %423, %418
  %427 = load ptr, ptr %13, align 8, !tbaa !5
  %428 = getelementptr inbounds %struct.LodePNGState, ptr %427, i32 0, i32 2
  %429 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %428, i32 0, i32 5
  %430 = load i32, ptr %429, align 8, !tbaa !25
  %431 = icmp ne i32 %430, 0
  br i1 %431, label %432, label %445

432:                                              ; preds = %426
  %433 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %434 = getelementptr inbounds %struct.LodePNGColorMode, ptr %433, i32 0, i32 0
  %435 = load i32, ptr %434, align 8, !tbaa !24
  %436 = icmp eq i32 %435, 2
  br i1 %436, label %442, label %437

437:                                              ; preds = %432
  %438 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %439 = getelementptr inbounds %struct.LodePNGColorMode, ptr %438, i32 0, i32 0
  %440 = load i32, ptr %439, align 8, !tbaa !24
  %441 = icmp eq i32 %440, 6
  br i1 %441, label %442, label %445

442:                                              ; preds = %437, %432
  %443 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %444 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %443)
  br label %445

445:                                              ; preds = %442, %437, %426
  %446 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %447 = getelementptr inbounds %struct.LodePNGColorMode, ptr %446, i32 0, i32 0
  %448 = load i32, ptr %447, align 8, !tbaa !24
  %449 = icmp eq i32 %448, 3
  br i1 %449, label %450, label %462

450:                                              ; preds = %445
  %451 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %452 = getelementptr inbounds %struct.LodePNGColorMode, ptr %451, i32 0, i32 2
  %453 = load ptr, ptr %452, align 8, !tbaa !47
  %454 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %455 = getelementptr inbounds %struct.LodePNGColorMode, ptr %454, i32 0, i32 3
  %456 = load i64, ptr %455, align 8, !tbaa !26
  %457 = call noundef i32 @_ZL22getPaletteTranslucencyPKhm(ptr noundef %453, i64 noundef %456)
  %458 = icmp ne i32 %457, 0
  br i1 %458, label %459, label %462

459:                                              ; preds = %450
  %460 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %461 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %460)
  br label %462

462:                                              ; preds = %459, %450, %445
  %463 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %464 = getelementptr inbounds %struct.LodePNGColorMode, ptr %463, i32 0, i32 0
  %465 = load i32, ptr %464, align 8, !tbaa !24
  %466 = icmp eq i32 %465, 0
  br i1 %466, label %472, label %467

467:                                              ; preds = %462
  %468 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %469 = getelementptr inbounds %struct.LodePNGColorMode, ptr %468, i32 0, i32 0
  %470 = load i32, ptr %469, align 8, !tbaa !24
  %471 = icmp eq i32 %470, 2
  br i1 %471, label %472, label %480

472:                                              ; preds = %467, %462
  %473 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %474 = getelementptr inbounds %struct.LodePNGColorMode, ptr %473, i32 0, i32 4
  %475 = load i32, ptr %474, align 8, !tbaa !48
  %476 = icmp ne i32 %475, 0
  br i1 %476, label %477, label %480

477:                                              ; preds = %472
  %478 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %479 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %478)
  br label %480

480:                                              ; preds = %477, %472, %467
  %481 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 4
  %482 = load i32, ptr %481, align 8, !tbaa !40
  %483 = icmp ne i32 %482, 0
  br i1 %483, label %484, label %494

484:                                              ; preds = %480
  %485 = call noundef i32 @_ZL13addChunk_bKGDP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  %486 = load ptr, ptr %13, align 8, !tbaa !5
  %487 = getelementptr inbounds %struct.LodePNGState, ptr %486, i32 0, i32 5
  store i32 %485, ptr %487, align 8, !tbaa !13
  %488 = load ptr, ptr %13, align 8, !tbaa !5
  %489 = getelementptr inbounds %struct.LodePNGState, ptr %488, i32 0, i32 5
  %490 = load i32, ptr %489, align 8, !tbaa !13
  %491 = icmp ne i32 %490, 0
  br i1 %491, label %492, label %493

492:                                              ; preds = %484
  store i32 2, ptr %24, align 4
  br label %770

493:                                              ; preds = %484
  br label %494

494:                                              ; preds = %493, %480
  %495 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 18
  %496 = load i32, ptr %495, align 4, !tbaa !49
  %497 = icmp ne i32 %496, 0
  br i1 %497, label %498, label %500

498:                                              ; preds = %494
  %499 = call noundef i32 @_ZL13addChunk_pHYsP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %500

500:                                              ; preds = %498, %494
  %501 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %502 = getelementptr inbounds [3 x ptr], ptr %501, i64 0, i64 1
  %503 = load ptr, ptr %502, align 8, !tbaa !5
  %504 = icmp ne ptr %503, null
  br i1 %504, label %505, label %521

505:                                              ; preds = %500
  %506 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %507 = getelementptr inbounds [3 x ptr], ptr %506, i64 0, i64 1
  %508 = load ptr, ptr %507, align 8, !tbaa !5
  %509 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 40
  %510 = getelementptr inbounds [3 x i64], ptr %509, i64 0, i64 1
  %511 = load i64, ptr %510, align 8, !tbaa !11
  %512 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %16, ptr noundef %508, i64 noundef %511)
  %513 = load ptr, ptr %13, align 8, !tbaa !5
  %514 = getelementptr inbounds %struct.LodePNGState, ptr %513, i32 0, i32 5
  store i32 %512, ptr %514, align 8, !tbaa !13
  %515 = load ptr, ptr %13, align 8, !tbaa !5
  %516 = getelementptr inbounds %struct.LodePNGState, ptr %515, i32 0, i32 5
  %517 = load i32, ptr %516, align 8, !tbaa !13
  %518 = icmp ne i32 %517, 0
  br i1 %518, label %519, label %520

519:                                              ; preds = %505
  store i32 2, ptr %24, align 4
  br label %770

520:                                              ; preds = %505
  br label %521

521:                                              ; preds = %520, %500
  %522 = load ptr, ptr %14, align 8, !tbaa !5
  %523 = load i64, ptr %15, align 8, !tbaa !11
  %524 = load ptr, ptr %13, align 8, !tbaa !5
  %525 = getelementptr inbounds %struct.LodePNGState, ptr %524, i32 0, i32 2
  %526 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %525, i32 0, i32 0
  %527 = call noundef i32 @_ZL13addChunk_IDATP8ucvectorPKhmP23LodePNGCompressSettings(ptr noundef %16, ptr noundef %522, i64 noundef %523, ptr noundef %526)
  %528 = load ptr, ptr %13, align 8, !tbaa !5
  %529 = getelementptr inbounds %struct.LodePNGState, ptr %528, i32 0, i32 5
  store i32 %527, ptr %529, align 8, !tbaa !13
  %530 = load ptr, ptr %13, align 8, !tbaa !5
  %531 = getelementptr inbounds %struct.LodePNGState, ptr %530, i32 0, i32 5
  %532 = load i32, ptr %531, align 8, !tbaa !13
  %533 = icmp ne i32 %532, 0
  br i1 %533, label %534, label %535

534:                                              ; preds = %521
  store i32 2, ptr %24, align 4
  br label %770

535:                                              ; preds = %521
  %536 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 16
  %537 = load i32, ptr %536, align 8, !tbaa !50
  %538 = icmp ne i32 %537, 0
  br i1 %538, label %539, label %542

539:                                              ; preds = %535
  %540 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 17
  %541 = call noundef i32 @_ZL13addChunk_tIMEP8ucvectorPK11LodePNGTime(ptr noundef %16, ptr noundef %540)
  br label %542

542:                                              ; preds = %539, %535
  store i64 0, ptr %30, align 8, !tbaa !11
  br label %543

543:                                              ; preds = %604, %542
  %544 = load i64, ptr %30, align 8, !tbaa !11
  %545 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 8
  %546 = load i64, ptr %545, align 8, !tbaa !51
  %547 = icmp ne i64 %544, %546
  br i1 %547, label %548, label %607

548:                                              ; preds = %543
  %549 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %550 = load ptr, ptr %549, align 8, !tbaa !52
  %551 = load i64, ptr %30, align 8, !tbaa !11
  %552 = getelementptr inbounds ptr, ptr %550, i64 %551
  %553 = load ptr, ptr %552, align 8, !tbaa !5
  %554 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %553)
  %555 = icmp ugt i64 %554, 79
  br i1 %555, label %556, label %559

556:                                              ; preds = %548
  %557 = load ptr, ptr %13, align 8, !tbaa !5
  %558 = getelementptr inbounds %struct.LodePNGState, ptr %557, i32 0, i32 5
  store i32 66, ptr %558, align 8, !tbaa !13
  store i32 2, ptr %24, align 4
  br label %770

559:                                              ; preds = %548
  %560 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %561 = load ptr, ptr %560, align 8, !tbaa !52
  %562 = load i64, ptr %30, align 8, !tbaa !11
  %563 = getelementptr inbounds ptr, ptr %561, i64 %562
  %564 = load ptr, ptr %563, align 8, !tbaa !5
  %565 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %564)
  %566 = icmp ult i64 %565, 1
  br i1 %566, label %567, label %570

567:                                              ; preds = %559
  %568 = load ptr, ptr %13, align 8, !tbaa !5
  %569 = getelementptr inbounds %struct.LodePNGState, ptr %568, i32 0, i32 5
  store i32 67, ptr %569, align 8, !tbaa !13
  store i32 2, ptr %24, align 4
  br label %770

570:                                              ; preds = %559
  %571 = load ptr, ptr %13, align 8, !tbaa !5
  %572 = getelementptr inbounds %struct.LodePNGState, ptr %571, i32 0, i32 2
  %573 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %572, i32 0, i32 7
  %574 = load i32, ptr %573, align 8, !tbaa !53
  %575 = icmp ne i32 %574, 0
  br i1 %575, label %576, label %591

576:                                              ; preds = %570
  %577 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %578 = load ptr, ptr %577, align 8, !tbaa !52
  %579 = load i64, ptr %30, align 8, !tbaa !11
  %580 = getelementptr inbounds ptr, ptr %578, i64 %579
  %581 = load ptr, ptr %580, align 8, !tbaa !5
  %582 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 10
  %583 = load ptr, ptr %582, align 8, !tbaa !54
  %584 = load i64, ptr %30, align 8, !tbaa !11
  %585 = getelementptr inbounds ptr, ptr %583, i64 %584
  %586 = load ptr, ptr %585, align 8, !tbaa !5
  %587 = load ptr, ptr %13, align 8, !tbaa !5
  %588 = getelementptr inbounds %struct.LodePNGState, ptr %587, i32 0, i32 2
  %589 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %588, i32 0, i32 0
  %590 = call noundef i32 @_ZL13addChunk_zTXtP8ucvectorPKcS2_P23LodePNGCompressSettings(ptr noundef %16, ptr noundef %581, ptr noundef %586, ptr noundef %589)
  br label %603

591:                                              ; preds = %570
  %592 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %593 = load ptr, ptr %592, align 8, !tbaa !52
  %594 = load i64, ptr %30, align 8, !tbaa !11
  %595 = getelementptr inbounds ptr, ptr %593, i64 %594
  %596 = load ptr, ptr %595, align 8, !tbaa !5
  %597 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 10
  %598 = load ptr, ptr %597, align 8, !tbaa !54
  %599 = load i64, ptr %30, align 8, !tbaa !11
  %600 = getelementptr inbounds ptr, ptr %598, i64 %599
  %601 = load ptr, ptr %600, align 8, !tbaa !5
  %602 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef %16, ptr noundef %596, ptr noundef %601)
  br label %603

603:                                              ; preds = %591, %576
  br label %604

604:                                              ; preds = %603
  %605 = load i64, ptr %30, align 8, !tbaa !11
  %606 = add i64 %605, 1
  store i64 %606, ptr %30, align 8, !tbaa !11
  br label %543, !llvm.loop !55

607:                                              ; preds = %543
  %608 = load ptr, ptr %13, align 8, !tbaa !5
  %609 = getelementptr inbounds %struct.LodePNGState, ptr %608, i32 0, i32 2
  %610 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %609, i32 0, i32 6
  %611 = load i32, ptr %610, align 4, !tbaa !57
  %612 = icmp ne i32 %611, 0
  br i1 %612, label %613, label %687

613:                                              ; preds = %607
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #3
  store i32 0, ptr %31, align 4, !tbaa !9
  store i64 0, ptr %30, align 8, !tbaa !11
  br label %614

614:                                              ; preds = %677, %613
  %615 = load i64, ptr %30, align 8, !tbaa !11
  %616 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 8
  %617 = load i64, ptr %616, align 8, !tbaa !51
  %618 = icmp ne i64 %615, %617
  br i1 %618, label %619, label %680

619:                                              ; preds = %614
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #3
  %620 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %621 = load ptr, ptr %620, align 8, !tbaa !52
  %622 = load i64, ptr %30, align 8, !tbaa !11
  %623 = getelementptr inbounds ptr, ptr %621, i64 %622
  %624 = load ptr, ptr %623, align 8, !tbaa !5
  store ptr %624, ptr %32, align 8, !tbaa !5
  %625 = load ptr, ptr %32, align 8, !tbaa !5
  %626 = getelementptr inbounds i8, ptr %625, i64 0
  %627 = load i8, ptr %626, align 1, !tbaa !58
  %628 = sext i8 %627 to i32
  %629 = icmp eq i32 %628, 76
  br i1 %629, label %630, label %673

630:                                              ; preds = %619
  %631 = load ptr, ptr %32, align 8, !tbaa !5
  %632 = getelementptr inbounds i8, ptr %631, i64 1
  %633 = load i8, ptr %632, align 1, !tbaa !58
  %634 = sext i8 %633 to i32
  %635 = icmp eq i32 %634, 111
  br i1 %635, label %636, label %673

636:                                              ; preds = %630
  %637 = load ptr, ptr %32, align 8, !tbaa !5
  %638 = getelementptr inbounds i8, ptr %637, i64 2
  %639 = load i8, ptr %638, align 1, !tbaa !58
  %640 = sext i8 %639 to i32
  %641 = icmp eq i32 %640, 100
  br i1 %641, label %642, label %673

642:                                              ; preds = %636
  %643 = load ptr, ptr %32, align 8, !tbaa !5
  %644 = getelementptr inbounds i8, ptr %643, i64 3
  %645 = load i8, ptr %644, align 1, !tbaa !58
  %646 = sext i8 %645 to i32
  %647 = icmp eq i32 %646, 101
  br i1 %647, label %648, label %673

648:                                              ; preds = %642
  %649 = load ptr, ptr %32, align 8, !tbaa !5
  %650 = getelementptr inbounds i8, ptr %649, i64 4
  %651 = load i8, ptr %650, align 1, !tbaa !58
  %652 = sext i8 %651 to i32
  %653 = icmp eq i32 %652, 80
  br i1 %653, label %654, label %673

654:                                              ; preds = %648
  %655 = load ptr, ptr %32, align 8, !tbaa !5
  %656 = getelementptr inbounds i8, ptr %655, i64 5
  %657 = load i8, ptr %656, align 1, !tbaa !58
  %658 = sext i8 %657 to i32
  %659 = icmp eq i32 %658, 78
  br i1 %659, label %660, label %673

660:                                              ; preds = %654
  %661 = load ptr, ptr %32, align 8, !tbaa !5
  %662 = getelementptr inbounds i8, ptr %661, i64 6
  %663 = load i8, ptr %662, align 1, !tbaa !58
  %664 = sext i8 %663 to i32
  %665 = icmp eq i32 %664, 71
  br i1 %665, label %666, label %673

666:                                              ; preds = %660
  %667 = load ptr, ptr %32, align 8, !tbaa !5
  %668 = getelementptr inbounds i8, ptr %667, i64 7
  %669 = load i8, ptr %668, align 1, !tbaa !58
  %670 = sext i8 %669 to i32
  %671 = icmp eq i32 %670, 0
  br i1 %671, label %672, label %673

672:                                              ; preds = %666
  store i32 1, ptr %31, align 4, !tbaa !9
  store i32 6, ptr %24, align 4
  br label %674

673:                                              ; preds = %666, %660, %654, %648, %642, %636, %630, %619
  store i32 0, ptr %24, align 4
  br label %674

674:                                              ; preds = %673, %672
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #3
  %675 = load i32, ptr %24, align 4
  switch i32 %675, label %786 [
    i32 0, label %676
    i32 6, label %680
  ]

676:                                              ; preds = %674
  br label %677

677:                                              ; preds = %676
  %678 = load i64, ptr %30, align 8, !tbaa !11
  %679 = add i64 %678, 1
  store i64 %679, ptr %30, align 8, !tbaa !11
  br label %614, !llvm.loop !59

680:                                              ; preds = %674, %614
  %681 = load i32, ptr %31, align 4, !tbaa !9
  %682 = icmp eq i32 %681, 0
  br i1 %682, label %683, label %686

683:                                              ; preds = %680
  %684 = load ptr, ptr @LODEPNG_VERSION_STRING, align 8, !tbaa !5
  %685 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef %16, ptr noundef @.str.15, ptr noundef %684)
  br label %686

686:                                              ; preds = %683, %680
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #3
  br label %687

687:                                              ; preds = %686, %607
  store i64 0, ptr %30, align 8, !tbaa !11
  br label %688

688:                                              ; preds = %744, %687
  %689 = load i64, ptr %30, align 8, !tbaa !11
  %690 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 11
  %691 = load i64, ptr %690, align 8, !tbaa !60
  %692 = icmp ne i64 %689, %691
  br i1 %692, label %693, label %747

693:                                              ; preds = %688
  %694 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 12
  %695 = load ptr, ptr %694, align 8, !tbaa !61
  %696 = load i64, ptr %30, align 8, !tbaa !11
  %697 = getelementptr inbounds ptr, ptr %695, i64 %696
  %698 = load ptr, ptr %697, align 8, !tbaa !5
  %699 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %698)
  %700 = icmp ugt i64 %699, 79
  br i1 %700, label %701, label %704

701:                                              ; preds = %693
  %702 = load ptr, ptr %13, align 8, !tbaa !5
  %703 = getelementptr inbounds %struct.LodePNGState, ptr %702, i32 0, i32 5
  store i32 66, ptr %703, align 8, !tbaa !13
  store i32 2, ptr %24, align 4
  br label %770

704:                                              ; preds = %693
  %705 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 12
  %706 = load ptr, ptr %705, align 8, !tbaa !61
  %707 = load i64, ptr %30, align 8, !tbaa !11
  %708 = getelementptr inbounds ptr, ptr %706, i64 %707
  %709 = load ptr, ptr %708, align 8, !tbaa !5
  %710 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %709)
  %711 = icmp ult i64 %710, 1
  br i1 %711, label %712, label %715

712:                                              ; preds = %704
  %713 = load ptr, ptr %13, align 8, !tbaa !5
  %714 = getelementptr inbounds %struct.LodePNGState, ptr %713, i32 0, i32 5
  store i32 67, ptr %714, align 8, !tbaa !13
  store i32 2, ptr %24, align 4
  br label %770

715:                                              ; preds = %704
  %716 = load ptr, ptr %13, align 8, !tbaa !5
  %717 = getelementptr inbounds %struct.LodePNGState, ptr %716, i32 0, i32 2
  %718 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %717, i32 0, i32 7
  %719 = load i32, ptr %718, align 8, !tbaa !53
  %720 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 12
  %721 = load ptr, ptr %720, align 8, !tbaa !61
  %722 = load i64, ptr %30, align 8, !tbaa !11
  %723 = getelementptr inbounds ptr, ptr %721, i64 %722
  %724 = load ptr, ptr %723, align 8, !tbaa !5
  %725 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 13
  %726 = load ptr, ptr %725, align 8, !tbaa !62
  %727 = load i64, ptr %30, align 8, !tbaa !11
  %728 = getelementptr inbounds ptr, ptr %726, i64 %727
  %729 = load ptr, ptr %728, align 8, !tbaa !5
  %730 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 14
  %731 = load ptr, ptr %730, align 8, !tbaa !63
  %732 = load i64, ptr %30, align 8, !tbaa !11
  %733 = getelementptr inbounds ptr, ptr %731, i64 %732
  %734 = load ptr, ptr %733, align 8, !tbaa !5
  %735 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 15
  %736 = load ptr, ptr %735, align 8, !tbaa !64
  %737 = load i64, ptr %30, align 8, !tbaa !11
  %738 = getelementptr inbounds ptr, ptr %736, i64 %737
  %739 = load ptr, ptr %738, align 8, !tbaa !5
  %740 = load ptr, ptr %13, align 8, !tbaa !5
  %741 = getelementptr inbounds %struct.LodePNGState, ptr %740, i32 0, i32 2
  %742 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %741, i32 0, i32 0
  %743 = call noundef i32 @_ZL13addChunk_iTXtP8ucvectorjPKcS2_S2_S2_P23LodePNGCompressSettings(ptr noundef %16, i32 noundef %719, ptr noundef %724, ptr noundef %729, ptr noundef %734, ptr noundef %739, ptr noundef %742)
  br label %744

744:                                              ; preds = %715
  %745 = load i64, ptr %30, align 8, !tbaa !11
  %746 = add i64 %745, 1
  store i64 %746, ptr %30, align 8, !tbaa !11
  br label %688, !llvm.loop !65

747:                                              ; preds = %688
  %748 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %749 = getelementptr inbounds [3 x ptr], ptr %748, i64 0, i64 2
  %750 = load ptr, ptr %749, align 8, !tbaa !5
  %751 = icmp ne ptr %750, null
  br i1 %751, label %752, label %768

752:                                              ; preds = %747
  %753 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %754 = getelementptr inbounds [3 x ptr], ptr %753, i64 0, i64 2
  %755 = load ptr, ptr %754, align 8, !tbaa !5
  %756 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 40
  %757 = getelementptr inbounds [3 x i64], ptr %756, i64 0, i64 2
  %758 = load i64, ptr %757, align 8, !tbaa !11
  %759 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %16, ptr noundef %755, i64 noundef %758)
  %760 = load ptr, ptr %13, align 8, !tbaa !5
  %761 = getelementptr inbounds %struct.LodePNGState, ptr %760, i32 0, i32 5
  store i32 %759, ptr %761, align 8, !tbaa !13
  %762 = load ptr, ptr %13, align 8, !tbaa !5
  %763 = getelementptr inbounds %struct.LodePNGState, ptr %762, i32 0, i32 5
  %764 = load i32, ptr %763, align 8, !tbaa !13
  %765 = icmp ne i32 %764, 0
  br i1 %765, label %766, label %767

766:                                              ; preds = %752
  store i32 2, ptr %24, align 4
  br label %770

767:                                              ; preds = %752
  br label %768

768:                                              ; preds = %767, %747
  %769 = call noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef %16)
  store i32 0, ptr %24, align 4
  br label %770

770:                                              ; preds = %768, %766, %712, %701, %567, %556, %534, %519, %492, %389
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #3
  %771 = load i32, ptr %24, align 4
  switch i32 %771, label %784 [
    i32 0, label %772
    i32 2, label %773
  ]

772:                                              ; preds = %770
  br label %773

773:                                              ; preds = %772, %770, %349, %282, %224, %116, %99, %80, %72, %62
  call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef %17)
  %774 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL12lodepng_freePv(ptr noundef %774)
  %775 = getelementptr inbounds %struct.ucvector, ptr %16, i32 0, i32 0
  %776 = load ptr, ptr %775, align 8, !tbaa !66
  %777 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %776, ptr %777, align 8, !tbaa !5
  %778 = getelementptr inbounds %struct.ucvector, ptr %16, i32 0, i32 1
  %779 = load i64, ptr %778, align 8, !tbaa !68
  %780 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %779, ptr %780, align 8, !tbaa !11
  %781 = load ptr, ptr %13, align 8, !tbaa !5
  %782 = getelementptr inbounds %struct.LodePNGState, ptr %781, i32 0, i32 5
  %783 = load i32, ptr %782, align 8, !tbaa !13
  store i32 %783, ptr %7, align 4
  store i32 1, ptr %24, align 4
  br label %784

784:                                              ; preds = %773, %770, %349, %282, %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 312, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  %785 = load i32, ptr %7, align 4
  ret i32 %785

786:                                              ; preds = %674
  unreachable
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL13addChunk_IENDP8ucvector(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 = { 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 504}
!14 = !{!"_ZTS12LodePNGState", !15, i64 8, !17, i64 64, !20, i64 152, !22, i64 192, !10, i64 504}
!15 = !{!"_ZTS22LodePNGDecoderSettings", !16, i64 0, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!16 = !{!"_ZTS25LodePNGDecompressSettings", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24}
!17 = !{!"_ZTS22LodePNGEncoderSettings", !18, i64 0, !10, i64 48, !10, i64 52, !19, i64 56, !6, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!18 = !{!"_ZTS23LodePNGCompressSettings", !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 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!20 = !{!"_ZTS16LodePNGColorMode", !21, i64 0, !10, i64 4, !6, i64 8, !12, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!21 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!22 = !{!"_ZTS11LodePNGInfo", !10, i64 0, !10, i64 4, !10, i64 8, !20, 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, !23, 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}
!23 = !{!"_ZTS11LodePNGTime", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}
!24 = !{!22, !21, i64 16}
!25 = !{!14, !10, i64 136}
!26 = !{!22, !12, i64 32}
!27 = !{!14, !10, i64 64}
!28 = !{!22, !10, i64 8}
!29 = !{!22, !10, i64 20}
!30 = !{!14, !21, i64 152}
!31 = !{!14, !10, i64 156}
!32 = !{!14, !10, i64 112}
!33 = !{!22, !10, i64 232}
!34 = !{!22, !6, i64 248}
!35 = !{!22, !10, i64 256}
!36 = !{!37, !10, i64 1064}
!37 = !{!"_ZTS17LodePNGColorStats", !10, i64 0, !10, i64 4, !38, i64 8, !38, i64 10, !38, i64 12, !10, i64 16, !10, i64 20, !7, i64 24, !10, i64 1048, !12, i64 1056, !10, i64 1064, !10, i64 1068}
!38 = !{!"short", !7, i64 0}
!39 = !{!37, !10, i64 1068}
!40 = !{!22, !10, i64 56}
!41 = !{!22, !10, i64 60}
!42 = !{!22, !10, i64 64}
!43 = !{!22, !10, i64 68}
!44 = !{!22, !10, i64 224}
!45 = !{!22, !10, i64 180}
!46 = !{!22, !10, i64 188}
!47 = !{!22, !6, i64 24}
!48 = !{!22, !10, i64 40}
!49 = !{!22, !10, i64 164}
!50 = !{!22, !10, i64 136}
!51 = !{!22, !12, i64 72}
!52 = !{!22, !6, i64 80}
!53 = !{!14, !10, i64 144}
!54 = !{!22, !6, i64 88}
!55 = distinct !{!55, !56}
!56 = !{!"llvm.loop.mustprogress"}
!57 = !{!14, !10, i64 140}
!58 = !{!7, !7, i64 0}
!59 = distinct !{!59, !56}
!60 = !{!22, !12, i64 96}
!61 = !{!22, !6, i64 104}
!62 = !{!22, !6, i64 112}
!63 = !{!22, !6, i64 120}
!64 = !{!22, !6, i64 128}
!65 = distinct !{!65, !56}
!66 = !{!67, !6, i64 0}
!67 = !{!"_ZTS8ucvector", !6, i64 0, !12, i64 8, !12, i64 16}
!68 = !{!67, !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.LodePNGColorMode = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.ucvector = type { ptr, i64, i64 }
%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 }
%struct.LodePNGColorStats = type { i32, i32, i16, i16, i16, i32, i32, [1024 x i8], i32, i64, i32, i32 }

@LODEPNG_VERSION_STRING = external dso_local local_unnamed_addr global ptr, align 8
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind noalias writable sret(%struct.LodePNGColorMode) align 8, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z14lodepng_encodePPhPmPKhjjP12LodePNGState(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 #2 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca %struct.ucvector, align 8
  %10 = alloca %struct.LodePNGInfo, align 8
  %11 = alloca %struct.LodePNGColorStats, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %struct.LodePNGColorMode, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #3
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #3
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #3
  call void @llvm.lifetime.start.p0(i64 312, ptr nonnull %10) #3
  %16 = getelementptr inbounds i8, ptr %5, i64 192
  call void @_ZL13ucvector_initP8ucvector(ptr noundef nonnull %9)
  call void @_Z17lodepng_info_initP11LodePNGInfo(ptr noundef nonnull %10)
  store ptr null, ptr %0, align 8, !tbaa !5
  store i64 0, ptr %1, align 8, !tbaa !9
  %17 = getelementptr inbounds i8, ptr %5, i64 504
  store i32 0, ptr %17, align 8, !tbaa !11
  %18 = getelementptr inbounds i8, ptr %5, i64 208
  %19 = load i32, ptr %18, align 8, !tbaa !23
  %20 = icmp eq i32 %19, 3
  br i1 %20, label %24, label %21

21:                                               ; preds = %6
  %22 = getelementptr inbounds i8, ptr %5, i64 136
  %23 = load i32, ptr %22, align 8, !tbaa !24
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %29, label %24

24:                                               ; preds = %21, %6
  %25 = getelementptr inbounds i8, ptr %5, i64 224
  %26 = load i64, ptr %25, align 8, !tbaa !25
  %27 = add i64 %26, -257
  %or.cond = icmp ult i64 %27, -256
  br i1 %or.cond, label %28, label %29

28:                                               ; preds = %24
  store i32 68, ptr %17, align 8, !tbaa !11
  br label %.thread222

29:                                               ; preds = %24, %21
  %30 = getelementptr inbounds i8, ptr %5, i64 64
  %31 = load i32, ptr %30, align 8, !tbaa !26
  %32 = icmp ugt i32 %31, 2
  br i1 %32, label %33, label %34

33:                                               ; preds = %29
  store i32 61, ptr %17, align 8, !tbaa !11
  br label %.thread222

34:                                               ; preds = %29
  %35 = getelementptr inbounds i8, ptr %5, i64 200
  %36 = load i32, ptr %35, align 8, !tbaa !27
  %37 = icmp ugt i32 %36, 1
  br i1 %37, label %38, label %39

38:                                               ; preds = %34
  store i32 71, ptr %17, align 8, !tbaa !11
  br label %.thread222

39:                                               ; preds = %34
  %40 = getelementptr inbounds i8, ptr %5, i64 212
  %41 = load i32, ptr %40, align 4, !tbaa !28
  %42 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %19, i32 noundef %41)
  store i32 %42, ptr %17, align 8, !tbaa !11
  %.not170 = icmp eq i32 %42, 0
  br i1 %.not170, label %43, label %.thread222

43:                                               ; preds = %39
  %44 = getelementptr inbounds i8, ptr %5, i64 152
  %45 = load i32, ptr %44, align 8, !tbaa !29
  %46 = getelementptr inbounds i8, ptr %5, i64 156
  %47 = load i32, ptr %46, align 4, !tbaa !30
  %48 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %45, i32 noundef %47)
  store i32 %48, ptr %17, align 8, !tbaa !11
  %.not171 = icmp eq i32 %48, 0
  br i1 %.not171, label %49, label %.thread222

49:                                               ; preds = %43
  %50 = call noundef i32 @_Z17lodepng_info_copyP11LodePNGInfoPKS_(ptr noundef nonnull %10, ptr noundef nonnull %16)
  %51 = getelementptr inbounds i8, ptr %5, i64 112
  %52 = load i32, ptr %51, align 8, !tbaa !31
  %.not172 = icmp eq i32 %52, 0
  br i1 %.not172, label %102, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 1072, ptr nonnull %11) #3
  call void @_Z24lodepng_color_stats_initP17LodePNGColorStats(ptr noundef nonnull %11)
  %54 = getelementptr inbounds i8, ptr %5, i64 424
  %55 = load i32, ptr %54, align 8, !tbaa !32
  %.not173 = icmp eq i32 %55, 0
  br i1 %.not173, label %.thread, label %56

56:                                               ; preds = %53
  %57 = getelementptr inbounds i8, ptr %5, i64 440
  %58 = load ptr, ptr %57, align 8, !tbaa !33
  %59 = getelementptr inbounds i8, ptr %5, i64 448
  %60 = load i32, ptr %59, align 8, !tbaa !34
  %61 = call noundef i32 @_ZL16isGrayICCProfilePKhj(ptr noundef %58, i32 noundef %60)
  %.not174 = icmp eq i32 %61, 0
  br i1 %.not174, label %64, label %62

62:                                               ; preds = %56
  %63 = getelementptr inbounds i8, ptr %11, i64 1064
  store i32 0, ptr %63, align 8, !tbaa !35
  br label %64

64:                                               ; preds = %62, %56
  %.pr = load i32, ptr %54, align 8, !tbaa !32
  %.not175 = icmp eq i32 %.pr, 0
  br i1 %.not175, label %.thread, label %65

65:                                               ; preds = %64
  %66 = load ptr, ptr %57, align 8, !tbaa !33
  %67 = load i32, ptr %59, align 8, !tbaa !34
  %68 = call noundef i32 @_ZL15isRGBICCProfilePKhj(ptr noundef %66, i32 noundef %67)
  %.not176 = icmp eq i32 %68, 0
  br i1 %.not176, label %.thread, label %69

69:                                               ; preds = %65
  %70 = getelementptr inbounds i8, ptr %11, i64 1068
  store i32 0, ptr %70, align 4, !tbaa !38
  br label %.thread

.thread:                                          ; preds = %53, %69, %65, %64
  call void @_Z27lodepng_compute_color_statsP17LodePNGColorStatsPKhjjPK16LodePNGColorMode(ptr noundef nonnull %11, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %44)
  %71 = getelementptr inbounds i8, ptr %5, i64 248
  %72 = load i32, ptr %71, align 8, !tbaa !39
  %.not177 = icmp eq i32 %72, 0
  br i1 %.not177, label %84, label %73

73:                                               ; preds = %.thread
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #3
  store i32 0, ptr %12, align 4, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #3
  store i32 0, ptr %13, align 4, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %14) #3
  store i32 0, ptr %14, align 4, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %15) #3
  call void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind nonnull writable sret(%struct.LodePNGColorMode) align 8 %15, i32 noundef 2, i32 noundef 16)
  %74 = getelementptr inbounds i8, ptr %5, i64 252
  %75 = load i32, ptr %74, align 4, !tbaa !41
  %76 = getelementptr inbounds i8, ptr %5, i64 256
  %77 = load i32, ptr %76, align 8, !tbaa !42
  %78 = getelementptr inbounds i8, ptr %5, i64 260
  %79 = load i32, ptr %78, align 4, !tbaa !43
  %80 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef nonnull %12, ptr noundef nonnull %13, ptr noundef nonnull %14, i32 noundef %75, i32 noundef %77, i32 noundef %79, ptr noundef nonnull %15, ptr noundef nonnull %18)
  %81 = load i32, ptr %12, align 4, !tbaa !40
  %82 = load i32, ptr %13, align 4, !tbaa !40
  %83 = load i32, ptr %14, align 4, !tbaa !40
  call void @_ZL23lodepng_color_stats_addP17LodePNGColorStatsjjjj(ptr noundef nonnull %11, i32 noundef %81, i32 noundef %82, i32 noundef %83, i32 noundef 65535)
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #3
  br label %84

84:                                               ; preds = %73, %.thread
  %85 = getelementptr inbounds i8, ptr %10, i64 16
  %86 = call noundef i32 @_Z17auto_choose_colorP16LodePNGColorModePKS_PK17LodePNGColorStats(ptr noundef nonnull %85, ptr noundef nonnull %44, ptr noundef nonnull %11)
  store i32 %86, ptr %17, align 8, !tbaa !11
  %.not178 = icmp eq i32 %86, 0
  br i1 %.not178, label %87, label %101

87:                                               ; preds = %84
  %88 = load i32, ptr %71, align 8, !tbaa !39
  %.not179 = icmp eq i32 %88, 0
  br i1 %.not179, label %.thread218, label %89

89:                                               ; preds = %87
  %90 = getelementptr inbounds i8, ptr %10, i64 60
  %91 = getelementptr inbounds i8, ptr %10, i64 64
  %92 = getelementptr inbounds i8, ptr %10, i64 68
  %93 = getelementptr inbounds i8, ptr %5, i64 252
  %94 = load i32, ptr %93, align 4, !tbaa !41
  %95 = getelementptr inbounds i8, ptr %5, i64 256
  %96 = load i32, ptr %95, align 8, !tbaa !42
  %97 = getelementptr inbounds i8, ptr %5, i64 260
  %98 = load i32, ptr %97, align 4, !tbaa !43
  %99 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef nonnull %90, ptr noundef nonnull %91, ptr noundef nonnull %92, i32 noundef %94, i32 noundef %96, i32 noundef %98, ptr noundef nonnull %85, ptr noundef nonnull %18)
  %.not180 = icmp eq i32 %99, 0
  br i1 %.not180, label %.thread218, label %100

100:                                              ; preds = %89
  store i32 104, ptr %17, align 8, !tbaa !11
  br label %101

.thread218:                                       ; preds = %89, %87
  call void @llvm.lifetime.end.p0(i64 1072, ptr nonnull %11) #3
  br label %102

101:                                              ; preds = %84, %100
  call void @llvm.lifetime.end.p0(i64 1072, ptr nonnull %11) #3
  br label %.thread222

102:                                              ; preds = %.thread218, %49
  %103 = getelementptr inbounds i8, ptr %5, i64 424
  %104 = load i32, ptr %103, align 8, !tbaa !32
  %.not181 = icmp eq i32 %104, 0
  br i1 %.not181, label %125, label %105

105:                                              ; preds = %102
  %106 = getelementptr inbounds i8, ptr %5, i64 440
  %107 = load ptr, ptr %106, align 8, !tbaa !33
  %108 = getelementptr inbounds i8, ptr %5, i64 448
  %109 = load i32, ptr %108, align 8, !tbaa !34
  %110 = call noundef i32 @_ZL16isGrayICCProfilePKhj(ptr noundef %107, i32 noundef %109)
  %111 = load ptr, ptr %106, align 8, !tbaa !33
  %112 = load i32, ptr %108, align 8, !tbaa !34
  %113 = call noundef i32 @_ZL15isRGBICCProfilePKhj(ptr noundef %111, i32 noundef %112)
  %114 = or i32 %113, %110
  %or.cond.not = icmp eq i32 %114, 0
  br i1 %or.cond.not, label %115, label %116

115:                                              ; preds = %105
  store i32 100, ptr %17, align 8, !tbaa !11
  br label %.thread222

116:                                              ; preds = %105
  %117 = getelementptr inbounds i8, ptr %10, i64 16
  %118 = load i32, ptr %117, align 8
  %119 = and i32 %118, -5
  %120 = icmp eq i32 %119, 0
  %121 = zext i1 %120 to i32
  %.not182 = icmp eq i32 %110, %121
  br i1 %.not182, label %125, label %122

122:                                              ; preds = %116
  %123 = load i32, ptr %51, align 8, !tbaa !31
  %.not183 = icmp eq i32 %123, 0
  %124 = select i1 %.not183, i32 101, i32 102
  store i32 %124, ptr %17, align 8, !tbaa !11
  br label %.thread222

125:                                              ; preds = %116, %102
  %126 = getelementptr inbounds i8, ptr %10, i64 16
  %127 = call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef nonnull %44, ptr noundef nonnull %126)
  %.not184 = icmp eq i32 %127, 0
  br i1 %.not184, label %128, label %146

128:                                              ; preds = %125
  %129 = zext i32 %3 to i64
  %130 = zext i32 %4 to i64
  %131 = mul nuw i64 %130, %129
  %132 = call noundef i32 @_Z15lodepng_get_bppPK16LodePNGColorMode(ptr noundef nonnull %126)
  %133 = zext i32 %132 to i64
  %134 = mul i64 %131, %133
  %135 = add i64 %134, 7
  %136 = lshr i64 %135, 3
  %137 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %136)
  %138 = icmp eq ptr %137, null
  %139 = icmp ugt i64 %135, 7
  %or.cond3 = and i1 %138, %139
  br i1 %or.cond3, label %.thread227, label %140

.thread227:                                       ; preds = %128
  store i32 83, ptr %17, align 8, !tbaa !11
  br label %.thread230

140:                                              ; preds = %128
  %.pr226 = load i32, ptr %17, align 8, !tbaa !11
  %.not185 = icmp eq i32 %.pr226, 0
  br i1 %.not185, label %141, label %.thread230

141:                                              ; preds = %140
  %142 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %137, ptr noundef %2, ptr noundef nonnull %126, ptr noundef nonnull %44, i32 noundef %3, i32 noundef %4)
  store i32 %142, ptr %17, align 8, !tbaa !11
  %.not186 = icmp eq i32 %142, 0
  br i1 %.not186, label %143, label %.thread230

143:                                              ; preds = %141
  %144 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %137, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %10, ptr noundef nonnull %30)
  br label %.thread230

.thread230:                                       ; preds = %140, %.thread227, %143, %141
  call void @_ZL12lodepng_freePv(ptr noundef %137)
  %145 = load i32, ptr %17, align 8, !tbaa !11
  %.not187 = icmp eq i32 %145, 0
  br i1 %.not187, label %148, label %.thread222

146:                                              ; preds = %125
  %147 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %10, ptr noundef nonnull %30)
  br label %148

148:                                              ; preds = %.thread230, %146
  call void @_ZL14writeSignatureP8ucvector(ptr noundef nonnull %9)
  %149 = load i32, ptr %126, align 8, !tbaa !23
  %150 = getelementptr inbounds i8, ptr %10, i64 20
  %151 = load i32, ptr %150, align 4, !tbaa !28
  %152 = getelementptr inbounds i8, ptr %10, i64 8
  %153 = load i32, ptr %152, align 8, !tbaa !27
  %154 = call noundef i32 @_ZL13addChunk_IHDRP8ucvectorjj16LodePNGColorTypejj(ptr noundef nonnull %9, i32 noundef %3, i32 noundef %4, i32 noundef %149, i32 noundef %151, i32 noundef %153)
  %155 = getelementptr inbounds i8, ptr %10, i64 264
  %156 = load ptr, ptr %155, align 8, !tbaa !5
  %.not188 = icmp eq ptr %156, null
  br i1 %.not188, label %161, label %157

157:                                              ; preds = %148
  %158 = getelementptr inbounds i8, ptr %10, i64 288
  %159 = load i64, ptr %158, align 8, !tbaa !9
  %160 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %9, ptr noundef nonnull %156, i64 noundef %159)
  store i32 %160, ptr %17, align 8, !tbaa !11
  %.not189 = icmp eq i32 %160, 0
  br i1 %.not189, label %161, label %.thread222

161:                                              ; preds = %157, %148
  %162 = getelementptr inbounds i8, ptr %10, i64 232
  %163 = load i32, ptr %162, align 8, !tbaa !32
  %.not190 = icmp eq i32 %163, 0
  br i1 %.not190, label %166, label %164

164:                                              ; preds = %161
  %165 = call noundef i32 @_ZL13addChunk_iCCPP8ucvectorPK11LodePNGInfoP23LodePNGCompressSettings(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %30)
  br label %166

166:                                              ; preds = %164, %161
  %167 = getelementptr inbounds i8, ptr %10, i64 224
  %168 = load i32, ptr %167, align 8, !tbaa !44
  %.not191 = icmp eq i32 %168, 0
  br i1 %.not191, label %171, label %169

169:                                              ; preds = %166
  %170 = call noundef i32 @_ZL13addChunk_sRGBP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %171

171:                                              ; preds = %169, %166
  %172 = getelementptr inbounds i8, ptr %10, i64 180
  %173 = load i32, ptr %172, align 4, !tbaa !45
  %.not192 = icmp eq i32 %173, 0
  br i1 %.not192, label %176, label %174

174:                                              ; preds = %171
  %175 = call noundef i32 @_ZL13addChunk_gAMAP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %176

176:                                              ; preds = %174, %171
  %177 = getelementptr inbounds i8, ptr %10, i64 188
  %178 = load i32, ptr %177, align 4, !tbaa !46
  %.not193 = icmp eq i32 %178, 0
  br i1 %.not193, label %181, label %179

179:                                              ; preds = %176
  %180 = call noundef i32 @_ZL13addChunk_cHRMP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %181

181:                                              ; preds = %179, %176
  %182 = load i32, ptr %126, align 8
  %183 = icmp eq i32 %182, 3
  br i1 %183, label %184, label %186

184:                                              ; preds = %181
  %185 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %126)
  %.pr233.pre255.pre = load i32, ptr %126, align 8
  br label %186

186:                                              ; preds = %184, %181
  %.pr233.pre255 = phi i32 [ %.pr233.pre255.pre, %184 ], [ %182, %181 ]
  %187 = getelementptr inbounds i8, ptr %5, i64 136
  %188 = load i32, ptr %187, align 8, !tbaa !24
  %.not194 = icmp ne i32 %188, 0
  %189 = and i32 %.pr233.pre255, -5
  %or.cond7 = icmp eq i32 %189, 2
  %or.cond263 = select i1 %.not194, i1 %or.cond7, i1 false
  br i1 %or.cond263, label %190, label %thread-pre-split232

190:                                              ; preds = %186
  %191 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %126)
  %.pr233.pre = load i32, ptr %126, align 8, !tbaa !23
  br label %thread-pre-split232

thread-pre-split232:                              ; preds = %190, %186
  %192 = phi i32 [ %.pr233.pre255, %186 ], [ %.pr233.pre, %190 ]
  %193 = icmp eq i32 %192, 3
  br i1 %193, label %194, label %202

194:                                              ; preds = %thread-pre-split232
  %195 = getelementptr inbounds i8, ptr %10, i64 24
  %196 = load ptr, ptr %195, align 8, !tbaa !47
  %197 = getelementptr inbounds i8, ptr %10, i64 32
  %198 = load i64, ptr %197, align 8, !tbaa !25
  %199 = call noundef i32 @_ZL22getPaletteTranslucencyPKhm(ptr noundef %196, i64 noundef %198)
  %.not195 = icmp eq i32 %199, 0
  br i1 %.not195, label %202, label %200

200:                                              ; preds = %194
  %201 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %126)
  br label %202

202:                                              ; preds = %200, %194, %thread-pre-split232
  %203 = load i32, ptr %126, align 8
  %204 = and i32 %203, -3
  %or.cond11 = icmp eq i32 %204, 0
  %205 = getelementptr inbounds i8, ptr %10, i64 40
  %206 = load i32, ptr %205, align 8
  %207 = icmp ne i32 %206, 0
  %or.cond15 = select i1 %or.cond11, i1 %207, i1 false
  br i1 %or.cond15, label %208, label %210

208:                                              ; preds = %202
  %209 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %126)
  br label %210

210:                                              ; preds = %202, %208
  %211 = getelementptr inbounds i8, ptr %10, i64 56
  %212 = load i32, ptr %211, align 8, !tbaa !39
  %.not196 = icmp eq i32 %212, 0
  br i1 %.not196, label %215, label %213

213:                                              ; preds = %210
  %214 = call noundef i32 @_ZL13addChunk_bKGDP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  store i32 %214, ptr %17, align 8, !tbaa !11
  %.not197 = icmp eq i32 %214, 0
  br i1 %.not197, label %215, label %.thread222

215:                                              ; preds = %213, %210
  %216 = getelementptr inbounds i8, ptr %10, i64 164
  %217 = load i32, ptr %216, align 4, !tbaa !48
  %.not198 = icmp eq i32 %217, 0
  br i1 %.not198, label %220, label %218

218:                                              ; preds = %215
  %219 = call noundef i32 @_ZL13addChunk_pHYsP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %220

220:                                              ; preds = %218, %215
  %221 = getelementptr inbounds i8, ptr %10, i64 272
  %222 = load ptr, ptr %221, align 8, !tbaa !5
  %.not199 = icmp eq ptr %222, null
  br i1 %.not199, label %227, label %223

223:                                              ; preds = %220
  %224 = getelementptr inbounds i8, ptr %10, i64 296
  %225 = load i64, ptr %224, align 8, !tbaa !9
  %226 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %9, ptr noundef nonnull %222, i64 noundef %225)
  store i32 %226, ptr %17, align 8, !tbaa !11
  %.not200 = icmp eq i32 %226, 0
  br i1 %.not200, label %227, label %.thread222

227:                                              ; preds = %223, %220
  %228 = load ptr, ptr %7, align 8, !tbaa !5
  %229 = load i64, ptr %8, align 8, !tbaa !9
  %230 = call noundef i32 @_ZL13addChunk_IDATP8ucvectorPKhmP23LodePNGCompressSettings(ptr noundef nonnull %9, ptr noundef %228, i64 noundef %229, ptr noundef nonnull %30)
  store i32 %230, ptr %17, align 8, !tbaa !11
  %.not201 = icmp eq i32 %230, 0
  br i1 %.not201, label %231, label %.thread222

231:                                              ; preds = %227
  %232 = getelementptr inbounds i8, ptr %10, i64 136
  %233 = load i32, ptr %232, align 8, !tbaa !49
  %.not202 = icmp eq i32 %233, 0
  br i1 %.not202, label %237, label %234

234:                                              ; preds = %231
  %235 = getelementptr inbounds i8, ptr %10, i64 140
  %236 = call noundef i32 @_ZL13addChunk_tIMEP8ucvectorPK11LodePNGTime(ptr noundef nonnull %9, ptr noundef nonnull %235)
  br label %237

237:                                              ; preds = %234, %231
  %238 = getelementptr inbounds i8, ptr %10, i64 72
  %239 = load i64, ptr %238, align 8, !tbaa !50
  %.not203243 = icmp eq i64 %239, 0
  br i1 %.not203243, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %237
  %240 = getelementptr inbounds i8, ptr %10, i64 80
  %241 = getelementptr inbounds i8, ptr %5, i64 144
  %242 = getelementptr inbounds i8, ptr %10, i64 88
  br label %243

243:                                              ; preds = %.lr.ph, %269
  %.0160244 = phi i64 [ 0, %.lr.ph ], [ %270, %269 ]
  %244 = load ptr, ptr %240, align 8, !tbaa !51
  %245 = getelementptr inbounds ptr, ptr %244, i64 %.0160244
  %246 = load ptr, ptr %245, align 8, !tbaa !5
  %247 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %246)
  %248 = icmp ugt i64 %247, 79
  br i1 %248, label %249, label %250

249:                                              ; preds = %243
  store i32 66, ptr %17, align 8, !tbaa !11
  br label %.thread222

250:                                              ; preds = %243
  %251 = load ptr, ptr %240, align 8, !tbaa !51
  %252 = getelementptr inbounds ptr, ptr %251, i64 %.0160244
  %253 = load ptr, ptr %252, align 8, !tbaa !5
  %254 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %253)
  %255 = icmp eq i64 %254, 0
  br i1 %255, label %256, label %257

256:                                              ; preds = %250
  store i32 67, ptr %17, align 8, !tbaa !11
  br label %.thread222

257:                                              ; preds = %250
  %258 = load i32, ptr %241, align 8, !tbaa !52
  %.not209 = icmp eq i32 %258, 0
  %259 = load ptr, ptr %240, align 8, !tbaa !51
  %260 = getelementptr inbounds ptr, ptr %259, i64 %.0160244
  %261 = load ptr, ptr %260, align 8, !tbaa !5
  %262 = load ptr, ptr %242, align 8, !tbaa !53
  %263 = getelementptr inbounds ptr, ptr %262, i64 %.0160244
  %264 = load ptr, ptr %263, align 8, !tbaa !5
  br i1 %.not209, label %267, label %265

265:                                              ; preds = %257
  %266 = call noundef i32 @_ZL13addChunk_zTXtP8ucvectorPKcS2_P23LodePNGCompressSettings(ptr noundef nonnull %9, ptr noundef %261, ptr noundef %264, ptr noundef nonnull %30)
  br label %269

267:                                              ; preds = %257
  %268 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef nonnull %9, ptr noundef %261, ptr noundef %264)
  br label %269

269:                                              ; preds = %265, %267
  %270 = add i64 %.0160244, 1
  %271 = load i64, ptr %238, align 8, !tbaa !50
  %.not203 = icmp eq i64 %270, %271
  br i1 %.not203, label %._crit_edge, label %243, !llvm.loop !54

._crit_edge:                                      ; preds = %269
  %272 = getelementptr inbounds i8, ptr %5, i64 140
  %273 = load i32, ptr %272, align 4, !tbaa !56
  %.not204 = icmp eq i32 %273, 0
  br i1 %.not204, label %.loopexit, label %.preheader

._crit_edge.thread:                               ; preds = %237
  %274 = getelementptr inbounds i8, ptr %5, i64 140
  %275 = load i32, ptr %274, align 4, !tbaa !56
  %.not204259 = icmp eq i32 %275, 0
  br i1 %.not204259, label %.loopexit, label %._crit_edge248

.preheader:                                       ; preds = %._crit_edge
  %.not205245 = icmp eq i64 %270, 0
  br i1 %.not205245, label %._crit_edge248, label %.lr.ph247

.lr.ph247:                                        ; preds = %.preheader
  %276 = getelementptr inbounds i8, ptr %10, i64 80
  %277 = load ptr, ptr %276, align 8, !tbaa !51
  br label %278

278:                                              ; preds = %.lr.ph247, %311
  %.1161246 = phi i64 [ 0, %.lr.ph247 ], [ %312, %311 ]
  %279 = getelementptr inbounds ptr, ptr %277, i64 %.1161246
  %280 = load ptr, ptr %279, align 8, !tbaa !5
  %281 = load i8, ptr %280, align 1, !tbaa !57
  %282 = icmp eq i8 %281, 76
  br i1 %282, label %283, label %311

283:                                              ; preds = %278
  %284 = getelementptr inbounds i8, ptr %280, i64 1
  %285 = load i8, ptr %284, align 1, !tbaa !57
  %286 = icmp eq i8 %285, 111
  br i1 %286, label %287, label %311

287:                                              ; preds = %283
  %288 = getelementptr inbounds i8, ptr %280, i64 2
  %289 = load i8, ptr %288, align 1, !tbaa !57
  %290 = icmp eq i8 %289, 100
  br i1 %290, label %291, label %311

291:                                              ; preds = %287
  %292 = getelementptr inbounds i8, ptr %280, i64 3
  %293 = load i8, ptr %292, align 1, !tbaa !57
  %294 = icmp eq i8 %293, 101
  br i1 %294, label %295, label %311

295:                                              ; preds = %291
  %296 = getelementptr inbounds i8, ptr %280, i64 4
  %297 = load i8, ptr %296, align 1, !tbaa !57
  %298 = icmp eq i8 %297, 80
  br i1 %298, label %299, label %311

299:                                              ; preds = %295
  %300 = getelementptr inbounds i8, ptr %280, i64 5
  %301 = load i8, ptr %300, align 1, !tbaa !57
  %302 = icmp eq i8 %301, 78
  br i1 %302, label %303, label %311

303:                                              ; preds = %299
  %304 = getelementptr inbounds i8, ptr %280, i64 6
  %305 = load i8, ptr %304, align 1, !tbaa !57
  %306 = icmp eq i8 %305, 71
  br i1 %306, label %307, label %311

307:                                              ; preds = %303
  %308 = getelementptr inbounds i8, ptr %280, i64 7
  %309 = load i8, ptr %308, align 1, !tbaa !57
  %310 = icmp eq i8 %309, 0
  br i1 %310, label %.loopexit, label %311

311:                                              ; preds = %278, %283, %287, %291, %295, %299, %303, %307
  %312 = add nuw i64 %.1161246, 1
  %.not205 = icmp eq i64 %.1161246, %.0160244
  br i1 %.not205, label %._crit_edge248, label %278, !llvm.loop !58

._crit_edge248:                                   ; preds = %311, %._crit_edge.thread, %.preheader
  %313 = load ptr, ptr @LODEPNG_VERSION_STRING, align 8, !tbaa !5
  %314 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef nonnull %9, ptr noundef nonnull @.str.15, ptr noundef %313)
  br label %.loopexit

.loopexit:                                        ; preds = %307, %._crit_edge.thread, %._crit_edge248, %._crit_edge
  %315 = getelementptr inbounds i8, ptr %10, i64 96
  %316 = load i64, ptr %315, align 8, !tbaa !59
  %.not206249 = icmp eq i64 %316, 0
  br i1 %.not206249, label %._crit_edge253, label %.lr.ph252

.lr.ph252:                                        ; preds = %.loopexit
  %317 = getelementptr inbounds i8, ptr %10, i64 104
  %318 = getelementptr inbounds i8, ptr %5, i64 144
  %319 = getelementptr inbounds i8, ptr %10, i64 112
  %320 = getelementptr inbounds i8, ptr %10, i64 120
  %321 = getelementptr inbounds i8, ptr %10, i64 128
  br label %322

322:                                              ; preds = %.lr.ph252, %336
  %.2162250 = phi i64 [ 0, %.lr.ph252 ], [ %351, %336 ]
  %323 = load ptr, ptr %317, align 8, !tbaa !60
  %324 = getelementptr inbounds ptr, ptr %323, i64 %.2162250
  %325 = load ptr, ptr %324, align 8, !tbaa !5
  %326 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %325)
  %327 = icmp ugt i64 %326, 79
  br i1 %327, label %328, label %329

328:                                              ; preds = %322
  store i32 66, ptr %17, align 8, !tbaa !11
  br label %.thread222

329:                                              ; preds = %322
  %330 = load ptr, ptr %317, align 8, !tbaa !60
  %331 = getelementptr inbounds ptr, ptr %330, i64 %.2162250
  %332 = load ptr, ptr %331, align 8, !tbaa !5
  %333 = call noundef i64 @_ZL14lodepng_strlenPKc(ptr noundef %332)
  %334 = icmp eq i64 %333, 0
  br i1 %334, label %335, label %336

335:                                              ; preds = %329
  store i32 67, ptr %17, align 8, !tbaa !11
  br label %.thread222

336:                                              ; preds = %329
  %337 = load i32, ptr %318, align 8, !tbaa !52
  %338 = load ptr, ptr %317, align 8, !tbaa !60
  %339 = getelementptr inbounds ptr, ptr %338, i64 %.2162250
  %340 = load ptr, ptr %339, align 8, !tbaa !5
  %341 = load ptr, ptr %319, align 8, !tbaa !61
  %342 = getelementptr inbounds ptr, ptr %341, i64 %.2162250
  %343 = load ptr, ptr %342, align 8, !tbaa !5
  %344 = load ptr, ptr %320, align 8, !tbaa !62
  %345 = getelementptr inbounds ptr, ptr %344, i64 %.2162250
  %346 = load ptr, ptr %345, align 8, !tbaa !5
  %347 = load ptr, ptr %321, align 8, !tbaa !63
  %348 = getelementptr inbounds ptr, ptr %347, i64 %.2162250
  %349 = load ptr, ptr %348, align 8, !tbaa !5
  %350 = call noundef i32 @_ZL13addChunk_iTXtP8ucvectorjPKcS2_S2_S2_P23LodePNGCompressSettings(ptr noundef nonnull %9, i32 noundef %337, ptr noundef %340, ptr noundef %343, ptr noundef %346, ptr noundef %349, ptr noundef nonnull %30)
  %351 = add i64 %.2162250, 1
  %352 = load i64, ptr %315, align 8, !tbaa !59
  %.not206 = icmp eq i64 %351, %352
  br i1 %.not206, label %._crit_edge253, label %322, !llvm.loop !64

._crit_edge253:                                   ; preds = %336, %.loopexit
  %353 = getelementptr inbounds i8, ptr %10, i64 280
  %354 = load ptr, ptr %353, align 8, !tbaa !5
  %.not207 = icmp eq ptr %354, null
  br i1 %.not207, label %359, label %355

355:                                              ; preds = %._crit_edge253
  %356 = getelementptr inbounds i8, ptr %10, i64 304
  %357 = load i64, ptr %356, align 8, !tbaa !9
  %358 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %9, ptr noundef nonnull %354, i64 noundef %357)
  store i32 %358, ptr %17, align 8, !tbaa !11
  %.not208 = icmp eq i32 %358, 0
  br i1 %.not208, label %359, label %.thread222

359:                                              ; preds = %355, %._crit_edge253
  %360 = call noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef nonnull %9)
  br label %.thread222

.thread222:                                       ; preds = %115, %122, %101, %.thread230, %249, %256, %328, %335, %359, %157, %213, %223, %227, %355, %43, %39, %38, %33, %28
  call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef nonnull %10)
  %361 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL12lodepng_freePv(ptr noundef %361)
  %362 = load ptr, ptr %9, align 8, !tbaa !65
  store ptr %362, ptr %0, align 8, !tbaa !5
  %363 = getelementptr inbounds i8, ptr %9, i64 8
  %364 = load i64, ptr %363, align 8, !tbaa !67
  store i64 %364, ptr %1, align 8, !tbaa !9
  %365 = load i32, ptr %17, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %10) #3
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #3
  ret i32 %365
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL13addChunk_IENDP8ucvector(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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !15, i64 504}
!12 = !{!"_ZTS12LodePNGState", !13, i64 8, !16, i64 64, !19, i64 152, !21, i64 192, !15, i64 504}
!13 = !{!"_ZTS22LodePNGDecoderSettings", !14, i64 0, !15, i64 32, !15, i64 36, !15, i64 40, !15, i64 44, !15, i64 48, !15, i64 52}
!14 = !{!"_ZTS25LodePNGDecompressSettings", !15, i64 0, !15, i64 4, !6, i64 8, !6, i64 16, !6, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS22LodePNGEncoderSettings", !17, i64 0, !15, i64 48, !15, i64 52, !18, i64 56, !6, i64 64, !15, i64 72, !15, i64 76, !15, i64 80}
!17 = !{!"_ZTS23LodePNGCompressSettings", !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 = !{!"_ZTS21LodePNGFilterStrategy", !7, i64 0}
!19 = !{!"_ZTS16LodePNGColorMode", !20, i64 0, !15, i64 4, !6, i64 8, !10, i64 16, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36}
!20 = !{!"_ZTS16LodePNGColorType", !7, i64 0}
!21 = !{!"_ZTS11LodePNGInfo", !15, i64 0, !15, i64 4, !15, i64 8, !19, i64 16, !15, i64 56, !15, i64 60, !15, i64 64, !15, i64 68, !10, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !15, i64 136, !22, i64 140, !15, i64 164, !15, i64 168, !15, i64 172, !15, i64 176, !15, i64 180, !15, i64 184, !15, i64 188, !15, i64 192, !15, i64 196, !15, i64 200, !15, i64 204, !15, i64 208, !15, i64 212, !15, i64 216, !15, i64 220, !15, i64 224, !15, i64 228, !15, i64 232, !6, i64 240, !6, i64 248, !15, i64 256, !7, i64 264, !7, i64 288}
!22 = !{!"_ZTS11LodePNGTime", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20}
!23 = !{!21, !20, i64 16}
!24 = !{!12, !15, i64 136}
!25 = !{!21, !10, i64 32}
!26 = !{!12, !15, i64 64}
!27 = !{!21, !15, i64 8}
!28 = !{!21, !15, i64 20}
!29 = !{!12, !20, i64 152}
!30 = !{!12, !15, i64 156}
!31 = !{!12, !15, i64 112}
!32 = !{!21, !15, i64 232}
!33 = !{!21, !6, i64 248}
!34 = !{!21, !15, i64 256}
!35 = !{!36, !15, i64 1064}
!36 = !{!"_ZTS17LodePNGColorStats", !15, i64 0, !15, i64 4, !37, i64 8, !37, i64 10, !37, i64 12, !15, i64 16, !15, i64 20, !7, i64 24, !15, i64 1048, !10, i64 1056, !15, i64 1064, !15, i64 1068}
!37 = !{!"short", !7, i64 0}
!38 = !{!36, !15, i64 1068}
!39 = !{!21, !15, i64 56}
!40 = !{!15, !15, i64 0}
!41 = !{!21, !15, i64 60}
!42 = !{!21, !15, i64 64}
!43 = !{!21, !15, i64 68}
!44 = !{!21, !15, i64 224}
!45 = !{!21, !15, i64 180}
!46 = !{!21, !15, i64 188}
!47 = !{!21, !6, i64 24}
!48 = !{!21, !15, i64 164}
!49 = !{!21, !15, i64 136}
!50 = !{!21, !10, i64 72}
!51 = !{!21, !6, i64 80}
!52 = !{!12, !15, i64 144}
!53 = !{!21, !6, i64 88}
!54 = distinct !{!54, !55}
!55 = !{!"llvm.loop.mustprogress"}
!56 = !{!12, !15, i64 140}
!57 = !{!7, !7, i64 0}
!58 = distinct !{!58, !55}
!59 = !{!21, !10, i64 96}
!60 = !{!21, !6, i64 104}
!61 = !{!21, !6, i64 112}
!62 = !{!21, !6, i64 120}
!63 = !{!21, !6, i64 128}
!64 = distinct !{!64, !55}
!65 = !{!66, !6, i64 0}
!66 = !{!"_ZTS8ucvector", !6, i64 0, !10, i64 8, !10, i64 16}
!67 = !{!66, !10, i64 8}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass