; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder/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.LodePNGColorProfile = type { i32, i32, i16, i16, i16, i32, i32, [1024 x i8], i32, i64 }
%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, 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: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

; 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) #3

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

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

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

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

; 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 @_Z26lodepng_color_profile_initP19LodePNGColorProfile(ptr noundef) #1

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

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

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

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

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

49:                                               ; preds = %43, %6
  %50 = load ptr, ptr %13, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.LodePNGState, ptr %50, i32 0, i32 4
  %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 %63, label %56

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

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

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

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

76:                                               ; preds = %66
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.LodePNGState, ptr %77, i32 0, i32 4
  %79 = getelementptr inbounds %struct.LodePNGInfo, ptr %78, i32 0, i32 2
  %80 = load i32, ptr %79, align 8, !tbaa !28
  %81 = icmp ugt i32 %80, 1
  br i1 %81, label %82, label %85

82:                                               ; preds = %76
  %83 = load ptr, ptr %13, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.LodePNGState, ptr %83, i32 0, i32 5
  store i32 71, ptr %84, align 8, !tbaa !13
  br label %763

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

103:                                              ; preds = %85
  br label %763

104:                                              ; preds = %85
  %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 0
  %108 = load i32, ptr %107, align 8, !tbaa !30
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.LodePNGState, ptr %109, i32 0, i32 3
  %111 = getelementptr inbounds %struct.LodePNGColorMode, ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !31
  %113 = call noundef i32 @_ZL18checkColorValidity16LodePNGColorTypej(i32 noundef %108, i32 noundef %112)
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.LodePNGState, ptr %114, i32 0, i32 5
  store i32 %113, ptr %115, align 8, !tbaa !13
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.LodePNGState, ptr %116, i32 0, i32 5
  %118 = load i32, ptr %117, align 8, !tbaa !13
  %119 = icmp ne i32 %118, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %104
  br label %763

121:                                              ; preds = %104
  %122 = load ptr, ptr %13, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.LodePNGState, ptr %122, i32 0, i32 4
  %124 = call noundef i32 @_Z17lodepng_info_copyP11LodePNGInfoPKS_(ptr noundef %17, ptr noundef %123)
  %125 = load ptr, ptr %13, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.LodePNGState, ptr %125, i32 0, i32 2
  %127 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 8, !tbaa !32
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %222

130:                                              ; preds = %121
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.LodePNGState, ptr %131, i32 0, i32 4
  %133 = getelementptr inbounds %struct.LodePNGInfo, ptr %132, i32 0, i32 4
  %134 = load i32, ptr %133, align 8, !tbaa !33
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %205

136:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.LodePNGState, ptr %137, i32 0, i32 4
  %139 = getelementptr inbounds %struct.LodePNGInfo, ptr %138, i32 0, i32 5
  %140 = load i32, ptr %139, align 4, !tbaa !34
  store i32 %140, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.LodePNGState, ptr %141, i32 0, i32 4
  %143 = getelementptr inbounds %struct.LodePNGInfo, ptr %142, i32 0, i32 6
  %144 = load i32, ptr %143, align 8, !tbaa !35
  store i32 %144, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %145 = load ptr, ptr %13, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.LodePNGState, ptr %145, i32 0, i32 4
  %147 = getelementptr inbounds %struct.LodePNGInfo, ptr %146, i32 0, i32 7
  %148 = load i32, ptr %147, align 4, !tbaa !36
  store i32 %148, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  store i32 0, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  store i32 0, ptr %22, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  store i32 0, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1064, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr %25) #4
  call void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind writable sret(%struct.LodePNGColorMode) align 8 %25, i32 noundef 2, i32 noundef 16)
  %149 = load i32, ptr %18, align 4, !tbaa !9
  %150 = load i32, ptr %19, align 4, !tbaa !9
  %151 = load i32, ptr %20, align 4, !tbaa !9
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.LodePNGState, ptr %152, i32 0, i32 4
  %154 = getelementptr inbounds %struct.LodePNGInfo, ptr %153, i32 0, i32 3
  %155 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef %21, ptr noundef %22, ptr noundef %23, i32 noundef %149, i32 noundef %150, i32 noundef %151, ptr noundef %25, ptr noundef %154)
  call void @_Z26lodepng_color_profile_initP19LodePNGColorProfile(ptr noundef %24)
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = load i32, ptr %12, align 4, !tbaa !9
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.LodePNGState, ptr %159, i32 0, i32 3
  %161 = call noundef i32 @_Z25lodepng_get_color_profileP19LodePNGColorProfilePKhjjPK16LodePNGColorMode(ptr noundef %24, ptr noundef %156, i32 noundef %157, i32 noundef %158, ptr noundef %160)
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.LodePNGState, ptr %162, i32 0, i32 5
  store i32 %161, ptr %163, align 8, !tbaa !13
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.LodePNGState, ptr %164, i32 0, i32 5
  %166 = load i32, ptr %165, align 8, !tbaa !13
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %169

168:                                              ; preds = %136
  store i32 2, ptr %26, align 4
  br label %202

169:                                              ; preds = %136
  %170 = load i32, ptr %21, align 4, !tbaa !9
  %171 = load i32, ptr %22, align 4, !tbaa !9
  %172 = load i32, ptr %23, align 4, !tbaa !9
  %173 = call noundef i32 @_ZL25lodepng_color_profile_addP19LodePNGColorProfilejjjj(ptr noundef %24, i32 noundef %170, i32 noundef %171, i32 noundef %172, i32 noundef 65535)
  %174 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %175 = load ptr, ptr %13, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.LodePNGState, ptr %175, i32 0, i32 3
  %177 = call noundef i32 @_ZL30auto_choose_color_from_profileP16LodePNGColorModePKS_PK19LodePNGColorProfile(ptr noundef %174, ptr noundef %176, ptr noundef %24)
  %178 = load ptr, ptr %13, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.LodePNGState, ptr %178, i32 0, i32 5
  store i32 %177, ptr %179, align 8, !tbaa !13
  %180 = load ptr, ptr %13, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.LodePNGState, ptr %180, i32 0, i32 5
  %182 = load i32, ptr %181, align 8, !tbaa !13
  %183 = icmp ne i32 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %169
  store i32 2, ptr %26, align 4
  br label %202

185:                                              ; preds = %169
  %186 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 5
  %187 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 6
  %188 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 7
  %189 = load i32, ptr %18, align 4, !tbaa !9
  %190 = load i32, ptr %19, align 4, !tbaa !9
  %191 = load i32, ptr %20, align 4, !tbaa !9
  %192 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %193 = load ptr, ptr %13, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.LodePNGState, ptr %193, i32 0, i32 4
  %195 = getelementptr inbounds %struct.LodePNGInfo, ptr %194, i32 0, i32 3
  %196 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef %186, ptr noundef %187, ptr noundef %188, i32 noundef %189, i32 noundef %190, i32 noundef %191, ptr noundef %192, ptr noundef %195)
  %197 = icmp ne i32 %196, 0
  br i1 %197, label %198, label %201

198:                                              ; preds = %185
  %199 = load ptr, ptr %13, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.LodePNGState, ptr %199, i32 0, i32 5
  store i32 104, ptr %200, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %202

201:                                              ; preds = %185
  store i32 0, ptr %26, align 4
  br label %202

202:                                              ; preds = %201, %198, %184, %168
  call void @llvm.lifetime.end.p0(i64 40, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 1064, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  %203 = load i32, ptr %26, align 4
  switch i32 %203, label %774 [
    i32 0, label %204
    i32 2, label %763
  ]

204:                                              ; preds = %202
  br label %221

205:                                              ; preds = %130
  %206 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %207 = load ptr, ptr %10, align 8, !tbaa !5
  %208 = load i32, ptr %11, align 4, !tbaa !9
  %209 = load i32, ptr %12, align 4, !tbaa !9
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.LodePNGState, ptr %210, i32 0, i32 3
  %212 = call noundef i32 @_Z25lodepng_auto_choose_colorP16LodePNGColorModePKhjjPKS_(ptr noundef %206, ptr noundef %207, i32 noundef %208, i32 noundef %209, ptr noundef %211)
  %213 = load ptr, ptr %13, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.LodePNGState, ptr %213, i32 0, i32 5
  store i32 %212, ptr %214, align 8, !tbaa !13
  %215 = load ptr, ptr %13, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.LodePNGState, ptr %215, i32 0, i32 5
  %217 = load i32, ptr %216, align 8, !tbaa !13
  %218 = icmp ne i32 %217, 0
  br i1 %218, label %219, label %220

219:                                              ; preds = %205
  br label %763

220:                                              ; preds = %205
  br label %221

221:                                              ; preds = %220, %204
  br label %222

222:                                              ; preds = %221, %121
  %223 = load ptr, ptr %13, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.LodePNGState, ptr %223, i32 0, i32 4
  %225 = getelementptr inbounds %struct.LodePNGInfo, ptr %224, i32 0, i32 35
  %226 = load i32, ptr %225, align 8, !tbaa !37
  %227 = icmp ne i32 %226, 0
  br i1 %227, label %228, label %323

228:                                              ; preds = %222
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #4
  %229 = load ptr, ptr %13, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.LodePNGState, ptr %229, i32 0, i32 4
  %231 = getelementptr inbounds %struct.LodePNGInfo, ptr %230, i32 0, i32 37
  %232 = load ptr, ptr %231, align 8, !tbaa !38
  %233 = load ptr, ptr %13, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.LodePNGState, ptr %233, i32 0, i32 4
  %235 = getelementptr inbounds %struct.LodePNGInfo, ptr %234, i32 0, i32 38
  %236 = load i32, ptr %235, align 8, !tbaa !39
  %237 = call noundef i32 @_ZL16isGrayICCProfilePKhj(ptr noundef %232, i32 noundef %236)
  store i32 %237, ptr %27, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #4
  %238 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %239 = getelementptr inbounds %struct.LodePNGColorMode, ptr %238, i32 0, i32 0
  %240 = load i32, ptr %239, align 8, !tbaa !40
  %241 = icmp eq i32 %240, 0
  br i1 %241, label %247, label %242

242:                                              ; preds = %228
  %243 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %244 = getelementptr inbounds %struct.LodePNGColorMode, ptr %243, i32 0, i32 0
  %245 = load i32, ptr %244, align 8, !tbaa !40
  %246 = icmp eq i32 %245, 4
  br label %247

247:                                              ; preds = %242, %228
  %248 = phi i1 [ true, %228 ], [ %246, %242 ]
  %249 = zext i1 %248 to i32
  store i32 %249, ptr %28, align 4, !tbaa !9
  %250 = load i32, ptr %27, align 4, !tbaa !9
  %251 = icmp ne i32 %250, 0
  br i1 %251, label %266, label %252

252:                                              ; preds = %247
  %253 = load ptr, ptr %13, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.LodePNGState, ptr %253, i32 0, i32 4
  %255 = getelementptr inbounds %struct.LodePNGInfo, ptr %254, i32 0, i32 37
  %256 = load ptr, ptr %255, align 8, !tbaa !38
  %257 = load ptr, ptr %13, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.LodePNGState, ptr %257, i32 0, i32 4
  %259 = getelementptr inbounds %struct.LodePNGInfo, ptr %258, i32 0, i32 38
  %260 = load i32, ptr %259, align 8, !tbaa !39
  %261 = call noundef i32 @_ZL15isRGBICCProfilePKhj(ptr noundef %256, i32 noundef %260)
  %262 = icmp ne i32 %261, 0
  br i1 %262, label %266, label %263

263:                                              ; preds = %252
  %264 = load ptr, ptr %13, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.LodePNGState, ptr %264, i32 0, i32 5
  store i32 100, ptr %265, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %320

266:                                              ; preds = %252, %247
  %267 = load ptr, ptr %13, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.LodePNGState, ptr %267, i32 0, i32 2
  %269 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %268, i32 0, i32 1
  %270 = load i32, ptr %269, align 8, !tbaa !32
  %271 = icmp ne i32 %270, 0
  br i1 %271, label %279, label %272

272:                                              ; preds = %266
  %273 = load i32, ptr %27, align 4, !tbaa !9
  %274 = load i32, ptr %28, align 4, !tbaa !9
  %275 = icmp ne i32 %273, %274
  br i1 %275, label %276, label %279

276:                                              ; preds = %272
  %277 = load ptr, ptr %13, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.LodePNGState, ptr %277, i32 0, i32 5
  store i32 101, ptr %278, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %320

279:                                              ; preds = %272, %266
  %280 = load i32, ptr %27, align 4, !tbaa !9
  %281 = icmp ne i32 %280, 0
  br i1 %281, label %282, label %288

282:                                              ; preds = %279
  %283 = load i32, ptr %28, align 4, !tbaa !9
  %284 = icmp ne i32 %283, 0
  br i1 %284, label %288, label %285

285:                                              ; preds = %282
  %286 = load ptr, ptr %13, align 8, !tbaa !5
  %287 = getelementptr inbounds %struct.LodePNGState, ptr %286, i32 0, i32 5
  store i32 102, ptr %287, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %320

288:                                              ; preds = %282, %279
  %289 = load i32, ptr %27, align 4, !tbaa !9
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %319, label %291

291:                                              ; preds = %288
  %292 = load i32, ptr %28, align 4, !tbaa !9
  %293 = icmp ne i32 %292, 0
  br i1 %293, label %294, label %319

294:                                              ; preds = %291
  %295 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %296 = getelementptr inbounds %struct.LodePNGColorMode, ptr %295, i32 0, i32 0
  %297 = load i32, ptr %296, align 8, !tbaa !40
  %298 = icmp eq i32 %297, 0
  br i1 %298, label %299, label %302

299:                                              ; preds = %294
  %300 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %301 = getelementptr inbounds %struct.LodePNGColorMode, ptr %300, i32 0, i32 0
  store i32 2, ptr %301, align 8, !tbaa !40
  br label %302

302:                                              ; preds = %299, %294
  %303 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %304 = getelementptr inbounds %struct.LodePNGColorMode, ptr %303, i32 0, i32 0
  %305 = load i32, ptr %304, align 8, !tbaa !40
  %306 = icmp eq i32 %305, 4
  br i1 %306, label %307, label %310

307:                                              ; preds = %302
  %308 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %309 = getelementptr inbounds %struct.LodePNGColorMode, ptr %308, i32 0, i32 0
  store i32 6, ptr %309, align 8, !tbaa !40
  br label %310

310:                                              ; preds = %307, %302
  %311 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %312 = getelementptr inbounds %struct.LodePNGColorMode, ptr %311, i32 0, i32 1
  %313 = load i32, ptr %312, align 4, !tbaa !41
  %314 = icmp ult i32 %313, 8
  br i1 %314, label %315, label %318

315:                                              ; preds = %310
  %316 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %317 = getelementptr inbounds %struct.LodePNGColorMode, ptr %316, i32 0, i32 1
  store i32 8, ptr %317, align 4, !tbaa !41
  br label %318

318:                                              ; preds = %315, %310
  br label %319

319:                                              ; preds = %318, %291, %288
  store i32 0, ptr %26, align 4
  br label %320

320:                                              ; preds = %319, %285, %276, %263
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #4
  %321 = load i32, ptr %26, align 4
  switch i32 %321, label %774 [
    i32 0, label %322
    i32 2, label %763
  ]

322:                                              ; preds = %320
  br label %323

323:                                              ; preds = %322, %222
  %324 = load ptr, ptr %13, align 8, !tbaa !5
  %325 = getelementptr inbounds %struct.LodePNGState, ptr %324, i32 0, i32 3
  %326 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %327 = call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef %325, ptr noundef %326)
  %328 = icmp ne i32 %327, 0
  br i1 %328, label %390, label %329

329:                                              ; preds = %323
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #4
  %330 = load i32, ptr %11, align 4, !tbaa !9
  %331 = zext i32 %330 to i64
  %332 = load i32, ptr %12, align 4, !tbaa !9
  %333 = zext i32 %332 to i64
  %334 = mul i64 %331, %333
  %335 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %336 = call noundef i32 @_Z15lodepng_get_bppPK16LodePNGColorMode(ptr noundef %335)
  %337 = zext i32 %336 to i64
  %338 = mul i64 %334, %337
  %339 = add i64 %338, 7
  %340 = udiv i64 %339, 8
  store i64 %340, ptr %30, align 8, !tbaa !11
  %341 = load i64, ptr %30, align 8, !tbaa !11
  %342 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %341)
  store ptr %342, ptr %29, align 8, !tbaa !5
  %343 = load ptr, ptr %29, align 8, !tbaa !5
  %344 = icmp ne ptr %343, null
  br i1 %344, label %351, label %345

345:                                              ; preds = %329
  %346 = load i64, ptr %30, align 8, !tbaa !11
  %347 = icmp ne i64 %346, 0
  br i1 %347, label %348, label %351

348:                                              ; preds = %345
  %349 = load ptr, ptr %13, align 8, !tbaa !5
  %350 = getelementptr inbounds %struct.LodePNGState, ptr %349, i32 0, i32 5
  store i32 83, ptr %350, align 8, !tbaa !13
  br label %351

351:                                              ; preds = %348, %345, %329
  %352 = load ptr, ptr %13, align 8, !tbaa !5
  %353 = getelementptr inbounds %struct.LodePNGState, ptr %352, i32 0, i32 5
  %354 = load i32, ptr %353, align 8, !tbaa !13
  %355 = icmp ne i32 %354, 0
  br i1 %355, label %367, label %356

356:                                              ; preds = %351
  %357 = load ptr, ptr %29, align 8, !tbaa !5
  %358 = load ptr, ptr %10, align 8, !tbaa !5
  %359 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %360 = load ptr, ptr %13, align 8, !tbaa !5
  %361 = getelementptr inbounds %struct.LodePNGState, ptr %360, i32 0, i32 3
  %362 = load i32, ptr %11, align 4, !tbaa !9
  %363 = load i32, ptr %12, align 4, !tbaa !9
  %364 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %357, ptr noundef %358, ptr noundef %359, ptr noundef %361, i32 noundef %362, i32 noundef %363)
  %365 = load ptr, ptr %13, align 8, !tbaa !5
  %366 = getelementptr inbounds %struct.LodePNGState, ptr %365, i32 0, i32 5
  store i32 %364, ptr %366, align 8, !tbaa !13
  br label %367

367:                                              ; preds = %356, %351
  %368 = load ptr, ptr %13, align 8, !tbaa !5
  %369 = getelementptr inbounds %struct.LodePNGState, ptr %368, i32 0, i32 5
  %370 = load i32, ptr %369, align 8, !tbaa !13
  %371 = icmp ne i32 %370, 0
  br i1 %371, label %379, label %372

372:                                              ; preds = %367
  %373 = load ptr, ptr %29, align 8, !tbaa !5
  %374 = load i32, ptr %11, align 4, !tbaa !9
  %375 = load i32, ptr %12, align 4, !tbaa !9
  %376 = load ptr, ptr %13, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.LodePNGState, ptr %376, i32 0, i32 2
  %378 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef %14, ptr noundef %15, ptr noundef %373, i32 noundef %374, i32 noundef %375, ptr noundef %17, ptr noundef %377)
  br label %379

379:                                              ; preds = %372, %367
  %380 = load ptr, ptr %29, align 8, !tbaa !5
  call void @_ZL12lodepng_freePv(ptr noundef %380)
  %381 = load ptr, ptr %13, align 8, !tbaa !5
  %382 = getelementptr inbounds %struct.LodePNGState, ptr %381, i32 0, i32 5
  %383 = load i32, ptr %382, align 8, !tbaa !13
  %384 = icmp ne i32 %383, 0
  br i1 %384, label %385, label %386

385:                                              ; preds = %379
  store i32 2, ptr %26, align 4
  br label %387

386:                                              ; preds = %379
  store i32 0, ptr %26, align 4
  br label %387

387:                                              ; preds = %386, %385
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  %388 = load i32, ptr %26, align 4
  switch i32 %388, label %774 [
    i32 0, label %389
    i32 2, label %763
  ]

389:                                              ; preds = %387
  br label %397

390:                                              ; preds = %323
  %391 = load ptr, ptr %10, align 8, !tbaa !5
  %392 = load i32, ptr %11, align 4, !tbaa !9
  %393 = load i32, ptr %12, align 4, !tbaa !9
  %394 = load ptr, ptr %13, align 8, !tbaa !5
  %395 = getelementptr inbounds %struct.LodePNGState, ptr %394, i32 0, i32 2
  %396 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef %14, ptr noundef %15, ptr noundef %391, i32 noundef %392, i32 noundef %393, ptr noundef %17, ptr noundef %395)
  br label %397

397:                                              ; preds = %390, %389
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  call void @_ZL14writeSignatureP8ucvector(ptr noundef %16)
  %398 = load i32, ptr %11, align 4, !tbaa !9
  %399 = load i32, ptr %12, align 4, !tbaa !9
  %400 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %401 = getelementptr inbounds %struct.LodePNGColorMode, ptr %400, i32 0, i32 0
  %402 = load i32, ptr %401, align 8, !tbaa !40
  %403 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %404 = getelementptr inbounds %struct.LodePNGColorMode, ptr %403, i32 0, i32 1
  %405 = load i32, ptr %404, align 4, !tbaa !41
  %406 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 2
  %407 = load i32, ptr %406, align 8, !tbaa !42
  %408 = call noundef i32 @_ZL13addChunk_IHDRP8ucvectorjj16LodePNGColorTypejj(ptr noundef %16, i32 noundef %398, i32 noundef %399, i32 noundef %402, i32 noundef %405, i32 noundef %407)
  %409 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %410 = getelementptr inbounds [3 x ptr], ptr %409, i64 0, i64 0
  %411 = load ptr, ptr %410, align 8, !tbaa !5
  %412 = icmp ne ptr %411, null
  br i1 %412, label %413, label %429

413:                                              ; preds = %397
  %414 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %415 = getelementptr inbounds [3 x ptr], ptr %414, i64 0, i64 0
  %416 = load ptr, ptr %415, align 8, !tbaa !5
  %417 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 40
  %418 = getelementptr inbounds [3 x i64], ptr %417, i64 0, i64 0
  %419 = load i64, ptr %418, align 8, !tbaa !11
  %420 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %16, ptr noundef %416, i64 noundef %419)
  %421 = load ptr, ptr %13, align 8, !tbaa !5
  %422 = getelementptr inbounds %struct.LodePNGState, ptr %421, i32 0, i32 5
  store i32 %420, ptr %422, align 8, !tbaa !13
  %423 = load ptr, ptr %13, align 8, !tbaa !5
  %424 = getelementptr inbounds %struct.LodePNGState, ptr %423, i32 0, i32 5
  %425 = load i32, ptr %424, align 8, !tbaa !13
  %426 = icmp ne i32 %425, 0
  br i1 %426, label %427, label %428

427:                                              ; preds = %413
  store i32 2, ptr %26, align 4
  br label %760

428:                                              ; preds = %413
  br label %429

429:                                              ; preds = %428, %397
  %430 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 35
  %431 = load i32, ptr %430, align 8, !tbaa !43
  %432 = icmp ne i32 %431, 0
  br i1 %432, label %433, label %438

433:                                              ; preds = %429
  %434 = load ptr, ptr %13, align 8, !tbaa !5
  %435 = getelementptr inbounds %struct.LodePNGState, ptr %434, i32 0, i32 2
  %436 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %435, i32 0, i32 0
  %437 = call noundef i32 @_ZL13addChunk_iCCPP8ucvectorPK11LodePNGInfoP23LodePNGCompressSettings(ptr noundef %16, ptr noundef %17, ptr noundef %436)
  br label %438

438:                                              ; preds = %433, %429
  %439 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 33
  %440 = load i32, ptr %439, align 8, !tbaa !44
  %441 = icmp ne i32 %440, 0
  br i1 %441, label %442, label %444

442:                                              ; preds = %438
  %443 = call noundef i32 @_ZL13addChunk_sRGBP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %444

444:                                              ; preds = %442, %438
  %445 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 22
  %446 = load i32, ptr %445, align 4, !tbaa !45
  %447 = icmp ne i32 %446, 0
  br i1 %447, label %448, label %450

448:                                              ; preds = %444
  %449 = call noundef i32 @_ZL13addChunk_gAMAP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %450

450:                                              ; preds = %448, %444
  %451 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 24
  %452 = load i32, ptr %451, align 4, !tbaa !46
  %453 = icmp ne i32 %452, 0
  br i1 %453, label %454, label %456

454:                                              ; preds = %450
  %455 = call noundef i32 @_ZL13addChunk_cHRMP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %456

456:                                              ; preds = %454, %450
  %457 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %458 = getelementptr inbounds %struct.LodePNGColorMode, ptr %457, i32 0, i32 0
  %459 = load i32, ptr %458, align 8, !tbaa !40
  %460 = icmp eq i32 %459, 3
  br i1 %460, label %461, label %464

461:                                              ; preds = %456
  %462 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %463 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %462)
  br label %464

464:                                              ; preds = %461, %456
  %465 = load ptr, ptr %13, align 8, !tbaa !5
  %466 = getelementptr inbounds %struct.LodePNGState, ptr %465, i32 0, i32 2
  %467 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %466, i32 0, i32 5
  %468 = load i32, ptr %467, align 8, !tbaa !25
  %469 = icmp ne i32 %468, 0
  br i1 %469, label %470, label %483

470:                                              ; preds = %464
  %471 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %472 = getelementptr inbounds %struct.LodePNGColorMode, ptr %471, i32 0, i32 0
  %473 = load i32, ptr %472, align 8, !tbaa !40
  %474 = icmp eq i32 %473, 2
  br i1 %474, label %480, label %475

475:                                              ; preds = %470
  %476 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %477 = getelementptr inbounds %struct.LodePNGColorMode, ptr %476, i32 0, i32 0
  %478 = load i32, ptr %477, align 8, !tbaa !40
  %479 = icmp eq i32 %478, 6
  br i1 %479, label %480, label %483

480:                                              ; preds = %475, %470
  %481 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %482 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %481)
  br label %483

483:                                              ; preds = %480, %475, %464
  %484 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %485 = getelementptr inbounds %struct.LodePNGColorMode, ptr %484, i32 0, i32 0
  %486 = load i32, ptr %485, align 8, !tbaa !40
  %487 = icmp eq i32 %486, 3
  br i1 %487, label %488, label %500

488:                                              ; preds = %483
  %489 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %490 = getelementptr inbounds %struct.LodePNGColorMode, ptr %489, i32 0, i32 2
  %491 = load ptr, ptr %490, align 8, !tbaa !47
  %492 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %493 = getelementptr inbounds %struct.LodePNGColorMode, ptr %492, i32 0, i32 3
  %494 = load i64, ptr %493, align 8, !tbaa !48
  %495 = call noundef i32 @_ZL22getPaletteTranslucencyPKhm(ptr noundef %491, i64 noundef %494)
  %496 = icmp ne i32 %495, 0
  br i1 %496, label %497, label %500

497:                                              ; preds = %488
  %498 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %499 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %498)
  br label %500

500:                                              ; preds = %497, %488, %483
  %501 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %502 = getelementptr inbounds %struct.LodePNGColorMode, ptr %501, i32 0, i32 0
  %503 = load i32, ptr %502, align 8, !tbaa !40
  %504 = icmp eq i32 %503, 0
  br i1 %504, label %510, label %505

505:                                              ; preds = %500
  %506 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %507 = getelementptr inbounds %struct.LodePNGColorMode, ptr %506, i32 0, i32 0
  %508 = load i32, ptr %507, align 8, !tbaa !40
  %509 = icmp eq i32 %508, 2
  br i1 %509, label %510, label %518

510:                                              ; preds = %505, %500
  %511 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %512 = getelementptr inbounds %struct.LodePNGColorMode, ptr %511, i32 0, i32 4
  %513 = load i32, ptr %512, align 8, !tbaa !49
  %514 = icmp ne i32 %513, 0
  br i1 %514, label %515, label %518

515:                                              ; preds = %510
  %516 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 3
  %517 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef %16, ptr noundef %516)
  br label %518

518:                                              ; preds = %515, %510, %505
  %519 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 4
  %520 = load i32, ptr %519, align 8, !tbaa !50
  %521 = icmp ne i32 %520, 0
  br i1 %521, label %522, label %532

522:                                              ; preds = %518
  %523 = call noundef i32 @_ZL13addChunk_bKGDP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  %524 = load ptr, ptr %13, align 8, !tbaa !5
  %525 = getelementptr inbounds %struct.LodePNGState, ptr %524, i32 0, i32 5
  store i32 %523, ptr %525, align 8, !tbaa !13
  %526 = load ptr, ptr %13, align 8, !tbaa !5
  %527 = getelementptr inbounds %struct.LodePNGState, ptr %526, i32 0, i32 5
  %528 = load i32, ptr %527, align 8, !tbaa !13
  %529 = icmp ne i32 %528, 0
  br i1 %529, label %530, label %531

530:                                              ; preds = %522
  store i32 2, ptr %26, align 4
  br label %760

531:                                              ; preds = %522
  br label %532

532:                                              ; preds = %531, %518
  %533 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 18
  %534 = load i32, ptr %533, align 4, !tbaa !51
  %535 = icmp ne i32 %534, 0
  br i1 %535, label %536, label %538

536:                                              ; preds = %532
  %537 = call noundef i32 @_ZL13addChunk_pHYsP8ucvectorPK11LodePNGInfo(ptr noundef %16, ptr noundef %17)
  br label %538

538:                                              ; preds = %536, %532
  %539 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %540 = getelementptr inbounds [3 x ptr], ptr %539, i64 0, i64 1
  %541 = load ptr, ptr %540, align 8, !tbaa !5
  %542 = icmp ne ptr %541, null
  br i1 %542, label %543, label %559

543:                                              ; preds = %538
  %544 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %545 = getelementptr inbounds [3 x ptr], ptr %544, i64 0, i64 1
  %546 = load ptr, ptr %545, align 8, !tbaa !5
  %547 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 40
  %548 = getelementptr inbounds [3 x i64], ptr %547, i64 0, i64 1
  %549 = load i64, ptr %548, align 8, !tbaa !11
  %550 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %16, ptr noundef %546, i64 noundef %549)
  %551 = load ptr, ptr %13, align 8, !tbaa !5
  %552 = getelementptr inbounds %struct.LodePNGState, ptr %551, i32 0, i32 5
  store i32 %550, ptr %552, align 8, !tbaa !13
  %553 = load ptr, ptr %13, align 8, !tbaa !5
  %554 = getelementptr inbounds %struct.LodePNGState, ptr %553, i32 0, i32 5
  %555 = load i32, ptr %554, align 8, !tbaa !13
  %556 = icmp ne i32 %555, 0
  br i1 %556, label %557, label %558

557:                                              ; preds = %543
  store i32 2, ptr %26, align 4
  br label %760

558:                                              ; preds = %543
  br label %559

559:                                              ; preds = %558, %538
  %560 = load ptr, ptr %14, align 8, !tbaa !5
  %561 = load i64, ptr %15, align 8, !tbaa !11
  %562 = load ptr, ptr %13, align 8, !tbaa !5
  %563 = getelementptr inbounds %struct.LodePNGState, ptr %562, i32 0, i32 2
  %564 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %563, i32 0, i32 0
  %565 = call noundef i32 @_ZL13addChunk_IDATP8ucvectorPKhmP23LodePNGCompressSettings(ptr noundef %16, ptr noundef %560, i64 noundef %561, ptr noundef %564)
  %566 = load ptr, ptr %13, align 8, !tbaa !5
  %567 = getelementptr inbounds %struct.LodePNGState, ptr %566, i32 0, i32 5
  store i32 %565, ptr %567, align 8, !tbaa !13
  %568 = load ptr, ptr %13, align 8, !tbaa !5
  %569 = getelementptr inbounds %struct.LodePNGState, ptr %568, i32 0, i32 5
  %570 = load i32, ptr %569, align 8, !tbaa !13
  %571 = icmp ne i32 %570, 0
  br i1 %571, label %572, label %573

572:                                              ; preds = %559
  store i32 2, ptr %26, align 4
  br label %760

573:                                              ; preds = %559
  %574 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 16
  %575 = load i32, ptr %574, align 8, !tbaa !52
  %576 = icmp ne i32 %575, 0
  br i1 %576, label %577, label %580

577:                                              ; preds = %573
  %578 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 17
  %579 = call noundef i32 @_ZL13addChunk_tIMEP8ucvectorPK11LodePNGTime(ptr noundef %16, ptr noundef %578)
  br label %580

580:                                              ; preds = %577, %573
  store i64 0, ptr %31, align 8, !tbaa !11
  br label %581

581:                                              ; preds = %642, %580
  %582 = load i64, ptr %31, align 8, !tbaa !11
  %583 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 8
  %584 = load i64, ptr %583, align 8, !tbaa !53
  %585 = icmp ne i64 %582, %584
  br i1 %585, label %586, label %645

586:                                              ; preds = %581
  %587 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %588 = load ptr, ptr %587, align 8, !tbaa !54
  %589 = load i64, ptr %31, align 8, !tbaa !11
  %590 = getelementptr inbounds ptr, ptr %588, i64 %589
  %591 = load ptr, ptr %590, align 8, !tbaa !5
  %592 = call i64 @strlen(ptr noundef %591) #5
  %593 = icmp ugt i64 %592, 79
  br i1 %593, label %594, label %597

594:                                              ; preds = %586
  %595 = load ptr, ptr %13, align 8, !tbaa !5
  %596 = getelementptr inbounds %struct.LodePNGState, ptr %595, i32 0, i32 5
  store i32 66, ptr %596, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %760

597:                                              ; preds = %586
  %598 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %599 = load ptr, ptr %598, align 8, !tbaa !54
  %600 = load i64, ptr %31, align 8, !tbaa !11
  %601 = getelementptr inbounds ptr, ptr %599, i64 %600
  %602 = load ptr, ptr %601, align 8, !tbaa !5
  %603 = call i64 @strlen(ptr noundef %602) #5
  %604 = icmp ult i64 %603, 1
  br i1 %604, label %605, label %608

605:                                              ; preds = %597
  %606 = load ptr, ptr %13, align 8, !tbaa !5
  %607 = getelementptr inbounds %struct.LodePNGState, ptr %606, i32 0, i32 5
  store i32 67, ptr %607, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %760

608:                                              ; preds = %597
  %609 = load ptr, ptr %13, align 8, !tbaa !5
  %610 = getelementptr inbounds %struct.LodePNGState, ptr %609, i32 0, i32 2
  %611 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %610, i32 0, i32 7
  %612 = load i32, ptr %611, align 8, !tbaa !55
  %613 = icmp ne i32 %612, 0
  br i1 %613, label %614, label %629

614:                                              ; preds = %608
  %615 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %616 = load ptr, ptr %615, align 8, !tbaa !54
  %617 = load i64, ptr %31, align 8, !tbaa !11
  %618 = getelementptr inbounds ptr, ptr %616, i64 %617
  %619 = load ptr, ptr %618, align 8, !tbaa !5
  %620 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 10
  %621 = load ptr, ptr %620, align 8, !tbaa !56
  %622 = load i64, ptr %31, align 8, !tbaa !11
  %623 = getelementptr inbounds ptr, ptr %621, i64 %622
  %624 = load ptr, ptr %623, align 8, !tbaa !5
  %625 = load ptr, ptr %13, align 8, !tbaa !5
  %626 = getelementptr inbounds %struct.LodePNGState, ptr %625, i32 0, i32 2
  %627 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %626, i32 0, i32 0
  %628 = call noundef i32 @_ZL13addChunk_zTXtP8ucvectorPKcS2_P23LodePNGCompressSettings(ptr noundef %16, ptr noundef %619, ptr noundef %624, ptr noundef %627)
  br label %641

629:                                              ; preds = %608
  %630 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %631 = load ptr, ptr %630, align 8, !tbaa !54
  %632 = load i64, ptr %31, align 8, !tbaa !11
  %633 = getelementptr inbounds ptr, ptr %631, i64 %632
  %634 = load ptr, ptr %633, align 8, !tbaa !5
  %635 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 10
  %636 = load ptr, ptr %635, align 8, !tbaa !56
  %637 = load i64, ptr %31, align 8, !tbaa !11
  %638 = getelementptr inbounds ptr, ptr %636, i64 %637
  %639 = load ptr, ptr %638, align 8, !tbaa !5
  %640 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef %16, ptr noundef %634, ptr noundef %639)
  br label %641

641:                                              ; preds = %629, %614
  br label %642

642:                                              ; preds = %641
  %643 = load i64, ptr %31, align 8, !tbaa !11
  %644 = add i64 %643, 1
  store i64 %644, ptr %31, align 8, !tbaa !11
  br label %581, !llvm.loop !57

645:                                              ; preds = %581
  %646 = load ptr, ptr %13, align 8, !tbaa !5
  %647 = getelementptr inbounds %struct.LodePNGState, ptr %646, i32 0, i32 2
  %648 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %647, i32 0, i32 6
  %649 = load i32, ptr %648, align 4, !tbaa !59
  %650 = icmp ne i32 %649, 0
  br i1 %650, label %651, label %677

651:                                              ; preds = %645
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  store i32 0, ptr %32, align 4, !tbaa !9
  store i64 0, ptr %31, align 8, !tbaa !11
  br label %652

652:                                              ; preds = %667, %651
  %653 = load i64, ptr %31, align 8, !tbaa !11
  %654 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 8
  %655 = load i64, ptr %654, align 8, !tbaa !53
  %656 = icmp ne i64 %653, %655
  br i1 %656, label %657, label %670

657:                                              ; preds = %652
  %658 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 9
  %659 = load ptr, ptr %658, align 8, !tbaa !54
  %660 = load i64, ptr %31, align 8, !tbaa !11
  %661 = getelementptr inbounds ptr, ptr %659, i64 %660
  %662 = load ptr, ptr %661, align 8, !tbaa !5
  %663 = call i32 @strcmp(ptr noundef %662, ptr noundef @.str.15) #5
  %664 = icmp ne i32 %663, 0
  br i1 %664, label %666, label %665

665:                                              ; preds = %657
  store i32 1, ptr %32, align 4, !tbaa !9
  br label %670

666:                                              ; preds = %657
  br label %667

667:                                              ; preds = %666
  %668 = load i64, ptr %31, align 8, !tbaa !11
  %669 = add i64 %668, 1
  store i64 %669, ptr %31, align 8, !tbaa !11
  br label %652, !llvm.loop !60

670:                                              ; preds = %665, %652
  %671 = load i32, ptr %32, align 4, !tbaa !9
  %672 = icmp eq i32 %671, 0
  br i1 %672, label %673, label %676

673:                                              ; preds = %670
  %674 = load ptr, ptr @LODEPNG_VERSION_STRING, align 8, !tbaa !5
  %675 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef %16, ptr noundef @.str.15, ptr noundef %674)
  br label %676

676:                                              ; preds = %673, %670
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  br label %677

677:                                              ; preds = %676, %645
  store i64 0, ptr %31, align 8, !tbaa !11
  br label %678

678:                                              ; preds = %734, %677
  %679 = load i64, ptr %31, align 8, !tbaa !11
  %680 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 11
  %681 = load i64, ptr %680, align 8, !tbaa !61
  %682 = icmp ne i64 %679, %681
  br i1 %682, label %683, label %737

683:                                              ; preds = %678
  %684 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 12
  %685 = load ptr, ptr %684, align 8, !tbaa !62
  %686 = load i64, ptr %31, align 8, !tbaa !11
  %687 = getelementptr inbounds ptr, ptr %685, i64 %686
  %688 = load ptr, ptr %687, align 8, !tbaa !5
  %689 = call i64 @strlen(ptr noundef %688) #5
  %690 = icmp ugt i64 %689, 79
  br i1 %690, label %691, label %694

691:                                              ; preds = %683
  %692 = load ptr, ptr %13, align 8, !tbaa !5
  %693 = getelementptr inbounds %struct.LodePNGState, ptr %692, i32 0, i32 5
  store i32 66, ptr %693, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %760

694:                                              ; preds = %683
  %695 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 12
  %696 = load ptr, ptr %695, align 8, !tbaa !62
  %697 = load i64, ptr %31, align 8, !tbaa !11
  %698 = getelementptr inbounds ptr, ptr %696, i64 %697
  %699 = load ptr, ptr %698, align 8, !tbaa !5
  %700 = call i64 @strlen(ptr noundef %699) #5
  %701 = icmp ult i64 %700, 1
  br i1 %701, label %702, label %705

702:                                              ; preds = %694
  %703 = load ptr, ptr %13, align 8, !tbaa !5
  %704 = getelementptr inbounds %struct.LodePNGState, ptr %703, i32 0, i32 5
  store i32 67, ptr %704, align 8, !tbaa !13
  store i32 2, ptr %26, align 4
  br label %760

705:                                              ; preds = %694
  %706 = load ptr, ptr %13, align 8, !tbaa !5
  %707 = getelementptr inbounds %struct.LodePNGState, ptr %706, i32 0, i32 2
  %708 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %707, i32 0, i32 7
  %709 = load i32, ptr %708, align 8, !tbaa !55
  %710 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 12
  %711 = load ptr, ptr %710, align 8, !tbaa !62
  %712 = load i64, ptr %31, align 8, !tbaa !11
  %713 = getelementptr inbounds ptr, ptr %711, i64 %712
  %714 = load ptr, ptr %713, align 8, !tbaa !5
  %715 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 13
  %716 = load ptr, ptr %715, align 8, !tbaa !63
  %717 = load i64, ptr %31, align 8, !tbaa !11
  %718 = getelementptr inbounds ptr, ptr %716, i64 %717
  %719 = load ptr, ptr %718, align 8, !tbaa !5
  %720 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 14
  %721 = load ptr, ptr %720, align 8, !tbaa !64
  %722 = load i64, ptr %31, 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 15
  %726 = load ptr, ptr %725, align 8, !tbaa !65
  %727 = load i64, ptr %31, align 8, !tbaa !11
  %728 = getelementptr inbounds ptr, ptr %726, i64 %727
  %729 = load ptr, ptr %728, align 8, !tbaa !5
  %730 = load ptr, ptr %13, align 8, !tbaa !5
  %731 = getelementptr inbounds %struct.LodePNGState, ptr %730, i32 0, i32 2
  %732 = getelementptr inbounds %struct.LodePNGEncoderSettings, ptr %731, i32 0, i32 0
  %733 = call noundef i32 @_ZL13addChunk_iTXtP8ucvectorjPKcS2_S2_S2_P23LodePNGCompressSettings(ptr noundef %16, i32 noundef %709, ptr noundef %714, ptr noundef %719, ptr noundef %724, ptr noundef %729, ptr noundef %732)
  br label %734

734:                                              ; preds = %705
  %735 = load i64, ptr %31, align 8, !tbaa !11
  %736 = add i64 %735, 1
  store i64 %736, ptr %31, align 8, !tbaa !11
  br label %678, !llvm.loop !66

737:                                              ; preds = %678
  %738 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %739 = getelementptr inbounds [3 x ptr], ptr %738, i64 0, i64 2
  %740 = load ptr, ptr %739, align 8, !tbaa !5
  %741 = icmp ne ptr %740, null
  br i1 %741, label %742, label %758

742:                                              ; preds = %737
  %743 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 39
  %744 = getelementptr inbounds [3 x ptr], ptr %743, i64 0, i64 2
  %745 = load ptr, ptr %744, align 8, !tbaa !5
  %746 = getelementptr inbounds %struct.LodePNGInfo, ptr %17, i32 0, i32 40
  %747 = getelementptr inbounds [3 x i64], ptr %746, i64 0, i64 2
  %748 = load i64, ptr %747, align 8, !tbaa !11
  %749 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %16, ptr noundef %745, i64 noundef %748)
  %750 = load ptr, ptr %13, align 8, !tbaa !5
  %751 = getelementptr inbounds %struct.LodePNGState, ptr %750, i32 0, i32 5
  store i32 %749, ptr %751, align 8, !tbaa !13
  %752 = load ptr, ptr %13, align 8, !tbaa !5
  %753 = getelementptr inbounds %struct.LodePNGState, ptr %752, i32 0, i32 5
  %754 = load i32, ptr %753, align 8, !tbaa !13
  %755 = icmp ne i32 %754, 0
  br i1 %755, label %756, label %757

756:                                              ; preds = %742
  store i32 2, ptr %26, align 4
  br label %760

757:                                              ; preds = %742
  br label %758

758:                                              ; preds = %757, %737
  %759 = call noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef %16)
  store i32 0, ptr %26, align 4
  br label %760

760:                                              ; preds = %758, %756, %702, %691, %605, %594, %572, %557, %530, %427
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  %761 = load i32, ptr %26, align 4
  switch i32 %761, label %774 [
    i32 0, label %762
    i32 2, label %763
  ]

762:                                              ; preds = %760
  br label %763

763:                                              ; preds = %762, %760, %387, %320, %219, %202, %120, %103, %82, %73, %63
  call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef %17)
  %764 = load ptr, ptr %14, align 8, !tbaa !5
  call void @_ZL12lodepng_freePv(ptr noundef %764)
  %765 = getelementptr inbounds %struct.ucvector, ptr %16, i32 0, i32 0
  %766 = load ptr, ptr %765, align 8, !tbaa !67
  %767 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %766, ptr %767, align 8, !tbaa !5
  %768 = getelementptr inbounds %struct.ucvector, ptr %16, i32 0, i32 1
  %769 = load i64, ptr %768, align 8, !tbaa !69
  %770 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %769, ptr %770, align 8, !tbaa !11
  %771 = load ptr, ptr %13, align 8, !tbaa !5
  %772 = getelementptr inbounds %struct.LodePNGState, ptr %771, i32 0, i32 5
  %773 = load i32, ptr %772, align 8, !tbaa !13
  store i32 %773, ptr %7, align 4
  store i32 1, ptr %26, align 4
  br label %774

774:                                              ; preds = %763, %760, %387, %320, %202
  call void @llvm.lifetime.end.p0(i64 312, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  %775 = load i32, ptr %7, align 4
  ret i32 %775
}

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

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

; 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 noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) #3

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

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

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

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

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

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

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

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

; 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) #3

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

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

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

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(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) #3

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef) #3

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 = { nounwind willreturn memory(read) "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 = { 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 #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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, !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 = !{!14, !21, i64 208}
!25 = !{!14, !10, i64 136}
!26 = !{!14, !12, i64 224}
!27 = !{!14, !10, i64 64}
!28 = !{!14, !10, i64 200}
!29 = !{!14, !10, i64 212}
!30 = !{!14, !21, i64 152}
!31 = !{!14, !10, i64 156}
!32 = !{!14, !10, i64 112}
!33 = !{!14, !10, i64 248}
!34 = !{!14, !10, i64 252}
!35 = !{!14, !10, i64 256}
!36 = !{!14, !10, i64 260}
!37 = !{!14, !10, i64 424}
!38 = !{!14, !6, i64 440}
!39 = !{!14, !10, i64 448}
!40 = !{!22, !21, i64 16}
!41 = !{!22, !10, i64 20}
!42 = !{!22, !10, i64 8}
!43 = !{!22, !10, i64 232}
!44 = !{!22, !10, i64 224}
!45 = !{!22, !10, i64 180}
!46 = !{!22, !10, i64 188}
!47 = !{!22, !6, i64 24}
!48 = !{!22, !12, i64 32}
!49 = !{!22, !10, i64 40}
!50 = !{!22, !10, i64 56}
!51 = !{!22, !10, i64 164}
!52 = !{!22, !10, i64 136}
!53 = !{!22, !12, i64 72}
!54 = !{!22, !6, i64 80}
!55 = !{!14, !10, i64 144}
!56 = !{!22, !6, i64 88}
!57 = distinct !{!57, !58}
!58 = !{!"llvm.loop.mustprogress"}
!59 = !{!14, !10, i64 140}
!60 = distinct !{!60, !58}
!61 = !{!22, !12, i64 96}
!62 = !{!22, !6, i64 104}
!63 = !{!22, !6, i64 112}
!64 = !{!22, !6, i64 120}
!65 = !{!22, !6, i64 128}
!66 = distinct !{!66, !58}
!67 = !{!68, !6, i64 0}
!68 = !{!"_ZTS8ucvector", !6, i64 0, !12, i64 8, !12, i64 16}
!69 = !{!68, !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.LodePNGColorProfile = type { i32, i32, i16, i16, i16, i32, i32, [1024 x i8], i32, i64 }

@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 nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

; 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 #3

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

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

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

; 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 #3

; 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 @_Z26lodepng_color_profile_initP19LodePNGColorProfile(ptr noundef) local_unnamed_addr #1

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

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

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

; 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 #3 {
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca %struct.ucvector, align 8
  %10 = alloca %struct.LodePNGInfo, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %struct.LodePNGColorProfile, align 8
  %15 = alloca %struct.LodePNGColorMode, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #4
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #4
  store i64 0, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 312, ptr nonnull %10) #4
  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
  %16 = getelementptr inbounds i8, ptr %5, i64 504
  store i32 0, ptr %16, align 8, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %5, i64 192
  %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.cond210 = icmp ult i64 %27, -256
  br i1 %or.cond210, label %28, label %29

28:                                               ; preds = %24
  store i32 68, ptr %16, align 8, !tbaa !11
  br label %307

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 %16, align 8, !tbaa !11
  br label %307

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 %16, align 8, !tbaa !11
  br label %307

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 %16, align 8, !tbaa !11
  %.not170 = icmp eq i32 %42, 0
  br i1 %.not170, label %43, label %307

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 %16, align 8, !tbaa !11
  %.not171 = icmp eq i32 %48, 0
  br i1 %.not171, label %49, label %307

49:                                               ; preds = %43
  %50 = call noundef i32 @_Z17lodepng_info_copyP11LodePNGInfoPKS_(ptr noundef nonnull %10, ptr noundef nonnull %17)
  %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 %82, label %53

53:                                               ; preds = %49
  %54 = getelementptr inbounds i8, ptr %5, i64 248
  %55 = load i32, ptr %54, align 8, !tbaa !32
  %.not173 = icmp eq i32 %55, 0
  br i1 %.not173, label %79, label %56

56:                                               ; preds = %53
  %57 = getelementptr inbounds i8, ptr %5, i64 252
  %58 = load i32, ptr %57, align 4, !tbaa !33
  %59 = getelementptr inbounds i8, ptr %5, i64 256
  %60 = load i32, ptr %59, align 8, !tbaa !34
  %61 = getelementptr inbounds i8, ptr %5, i64 260
  %62 = load i32, ptr %61, align 4, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #4
  store i32 0, ptr %11, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  store i32 0, ptr %12, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  store i32 0, ptr %13, align 4, !tbaa !36
  call void @llvm.lifetime.start.p0(i64 1064, ptr nonnull %14) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %15) #4
  call void @_Z23lodepng_color_mode_make16LodePNGColorTypej(ptr dead_on_unwind nonnull writable sret(%struct.LodePNGColorMode) align 8 %15, i32 noundef 2, i32 noundef 16)
  %63 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13, i32 noundef %58, i32 noundef %60, i32 noundef %62, ptr noundef nonnull %15, ptr noundef nonnull %18)
  call void @_Z26lodepng_color_profile_initP19LodePNGColorProfile(ptr noundef nonnull %14)
  %64 = call noundef i32 @_Z25lodepng_get_color_profileP19LodePNGColorProfilePKhjjPK16LodePNGColorMode(ptr noundef nonnull %14, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %44)
  store i32 %64, ptr %16, align 8, !tbaa !11
  %.not175 = icmp eq i32 %64, 0
  br i1 %.not175, label %65, label %.thread

65:                                               ; preds = %56
  %66 = load i32, ptr %11, align 4, !tbaa !36
  %67 = load i32, ptr %12, align 4, !tbaa !36
  %68 = load i32, ptr %13, align 4, !tbaa !36
  %69 = call noundef i32 @_ZL25lodepng_color_profile_addP19LodePNGColorProfilejjjj(ptr noundef nonnull %14, i32 noundef %66, i32 noundef %67, i32 noundef %68, i32 noundef 65535)
  %70 = getelementptr inbounds i8, ptr %10, i64 16
  %71 = call noundef i32 @_ZL30auto_choose_color_from_profileP16LodePNGColorModePKS_PK19LodePNGColorProfile(ptr noundef nonnull %70, ptr noundef nonnull %44, ptr noundef nonnull %14)
  store i32 %71, ptr %16, align 8, !tbaa !11
  %.not176 = icmp eq i32 %71, 0
  br i1 %.not176, label %72, label %.thread

72:                                               ; preds = %65
  %73 = getelementptr inbounds i8, ptr %10, i64 60
  %74 = getelementptr inbounds i8, ptr %10, i64 64
  %75 = getelementptr inbounds i8, ptr %10, i64 68
  %76 = call noundef i32 @_Z19lodepng_convert_rgbPjS_S_jjjPK16LodePNGColorModeS2_(ptr noundef nonnull %73, ptr noundef nonnull %74, ptr noundef nonnull %75, i32 noundef %58, i32 noundef %60, i32 noundef %62, ptr noundef nonnull %70, ptr noundef nonnull %18)
  %.not177 = icmp eq i32 %76, 0
  br i1 %.not177, label %78, label %77

77:                                               ; preds = %72
  store i32 104, ptr %16, align 8, !tbaa !11
  br label %.thread

.thread:                                          ; preds = %77, %56, %65
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 1064, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  br label %307

78:                                               ; preds = %72
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %15) #4
  call void @llvm.lifetime.end.p0(i64 1064, ptr nonnull %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #4
  br label %82

79:                                               ; preds = %53
  %80 = getelementptr inbounds i8, ptr %10, i64 16
  %81 = call noundef i32 @_Z25lodepng_auto_choose_colorP16LodePNGColorModePKhjjPKS_(ptr noundef nonnull %80, ptr noundef %2, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %44)
  store i32 %81, ptr %16, align 8, !tbaa !11
  %.not174 = icmp eq i32 %81, 0
  br i1 %.not174, label %82, label %307

82:                                               ; preds = %78, %79, %49
  %83 = getelementptr inbounds i8, ptr %5, i64 424
  %84 = load i32, ptr %83, align 8, !tbaa !37
  %.not178 = icmp eq i32 %84, 0
  br i1 %.not178, label %.thread221, label %85

85:                                               ; preds = %82
  %86 = getelementptr inbounds i8, ptr %5, i64 440
  %87 = load ptr, ptr %86, align 8, !tbaa !38
  %88 = getelementptr inbounds i8, ptr %5, i64 448
  %89 = load i32, ptr %88, align 8, !tbaa !39
  %90 = call noundef i32 @_ZL16isGrayICCProfilePKhj(ptr noundef %87, i32 noundef %89)
  %91 = getelementptr inbounds i8, ptr %10, i64 16
  %92 = load i32, ptr %91, align 8
  %93 = and i32 %92, -5
  %94 = icmp eq i32 %93, 0
  %95 = zext i1 %94 to i32
  %.not179 = icmp eq i32 %90, 0
  br i1 %.not179, label %96, label %101

96:                                               ; preds = %85
  %97 = load ptr, ptr %86, align 8, !tbaa !38
  %98 = load i32, ptr %88, align 8, !tbaa !39
  %99 = call noundef i32 @_ZL15isRGBICCProfilePKhj(ptr noundef %97, i32 noundef %98)
  %.not180 = icmp eq i32 %99, 0
  br i1 %.not180, label %100, label %101

100:                                              ; preds = %96
  store i32 100, ptr %16, align 8, !tbaa !11
  br label %307

101:                                              ; preds = %96, %85
  %102 = load i32, ptr %51, align 8, !tbaa !31
  %.not181 = icmp ne i32 %102, 0
  %.not182 = icmp eq i32 %90, %95
  %or.cond212 = select i1 %.not181, i1 true, i1 %.not182
  br i1 %or.cond212, label %104, label %103

103:                                              ; preds = %101
  store i32 101, ptr %16, align 8, !tbaa !11
  br label %307

104:                                              ; preds = %101
  %or.cond = select i1 %.not179, i1 true, i1 %94
  br i1 %or.cond, label %106, label %105

105:                                              ; preds = %104
  store i32 102, ptr %16, align 8, !tbaa !11
  br label %307

106:                                              ; preds = %104
  %or.cond3 = select i1 %.not179, i1 %94, i1 false
  br i1 %or.cond3, label %107, label %.thread221

107:                                              ; preds = %106
  %108 = load i32, ptr %91, align 8, !tbaa !40
  switch i32 %108, label %110 [
    i32 0, label %.sink.split
    i32 4, label %109
  ]

109:                                              ; preds = %107
  br label %.sink.split

.sink.split:                                      ; preds = %107, %109
  %.sink = phi i32 [ 6, %109 ], [ 2, %107 ]
  store i32 %.sink, ptr %91, align 8, !tbaa !40
  br label %110

110:                                              ; preds = %.sink.split, %107
  %111 = getelementptr inbounds i8, ptr %10, i64 20
  %112 = load i32, ptr %111, align 4, !tbaa !41
  %113 = icmp ult i32 %112, 8
  br i1 %113, label %114, label %.thread221

114:                                              ; preds = %110
  store i32 8, ptr %111, align 4, !tbaa !41
  br label %.thread221

.thread221:                                       ; preds = %106, %114, %110, %82
  %115 = getelementptr inbounds i8, ptr %10, i64 16
  %116 = call noundef i32 @_ZL24lodepng_color_mode_equalPK16LodePNGColorModeS1_(ptr noundef nonnull %44, ptr noundef nonnull %115)
  %.not183 = icmp eq i32 %116, 0
  br i1 %.not183, label %117, label %135

117:                                              ; preds = %.thread221
  %118 = zext i32 %3 to i64
  %119 = zext i32 %4 to i64
  %120 = mul nuw i64 %119, %118
  %121 = call noundef i32 @_Z15lodepng_get_bppPK16LodePNGColorMode(ptr noundef nonnull %115)
  %122 = zext i32 %121 to i64
  %123 = mul i64 %120, %122
  %124 = add i64 %123, 7
  %125 = lshr i64 %124, 3
  %126 = call noundef ptr @_ZL14lodepng_mallocm(i64 noundef %125)
  %127 = icmp eq ptr %126, null
  %128 = icmp ugt i64 %124, 7
  %or.cond5 = and i1 %127, %128
  br i1 %or.cond5, label %.thread224, label %129

.thread224:                                       ; preds = %117
  store i32 83, ptr %16, align 8, !tbaa !11
  br label %.thread227

129:                                              ; preds = %117
  %.pr = load i32, ptr %16, align 8, !tbaa !11
  %.not184 = icmp eq i32 %.pr, 0
  br i1 %.not184, label %130, label %.thread227

130:                                              ; preds = %129
  %131 = call noundef i32 @_Z15lodepng_convertPhPKhPK16LodePNGColorModeS4_jj(ptr noundef %126, ptr noundef %2, ptr noundef nonnull %115, ptr noundef nonnull %44, i32 noundef %3, i32 noundef %4)
  store i32 %131, ptr %16, align 8, !tbaa !11
  %.not185 = icmp eq i32 %131, 0
  br i1 %.not185, label %132, label %.thread227

132:                                              ; preds = %130
  %133 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef %126, i32 noundef %3, i32 noundef %4, ptr noundef nonnull %10, ptr noundef nonnull %30)
  br label %.thread227

.thread227:                                       ; preds = %129, %.thread224, %132, %130
  call void @_ZL12lodepng_freePv(ptr noundef %126)
  %134 = load i32, ptr %16, align 8, !tbaa !11
  %.not186 = icmp eq i32 %134, 0
  br i1 %.not186, label %137, label %307

135:                                              ; preds = %.thread221
  %136 = 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 %137

137:                                              ; preds = %.thread227, %135
  call void @_ZL14writeSignatureP8ucvector(ptr noundef nonnull %9)
  %138 = load i32, ptr %115, align 8, !tbaa !40
  %139 = getelementptr inbounds i8, ptr %10, i64 20
  %140 = load i32, ptr %139, align 4, !tbaa !41
  %141 = getelementptr inbounds i8, ptr %10, i64 8
  %142 = load i32, ptr %141, align 8, !tbaa !42
  %143 = call noundef i32 @_ZL13addChunk_IHDRP8ucvectorjj16LodePNGColorTypejj(ptr noundef nonnull %9, i32 noundef %3, i32 noundef %4, i32 noundef %138, i32 noundef %140, i32 noundef %142)
  %144 = getelementptr inbounds i8, ptr %10, i64 264
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  %.not187 = icmp eq ptr %145, null
  br i1 %.not187, label %150, label %146

146:                                              ; preds = %137
  %147 = getelementptr inbounds i8, ptr %10, i64 288
  %148 = load i64, ptr %147, align 8, !tbaa !9
  %149 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %9, ptr noundef nonnull %145, i64 noundef %148)
  store i32 %149, ptr %16, align 8, !tbaa !11
  %.not188 = icmp eq i32 %149, 0
  br i1 %.not188, label %150, label %307

150:                                              ; preds = %146, %137
  %151 = getelementptr inbounds i8, ptr %10, i64 232
  %152 = load i32, ptr %151, align 8, !tbaa !43
  %.not189 = icmp eq i32 %152, 0
  br i1 %.not189, label %155, label %153

153:                                              ; preds = %150
  %154 = call noundef i32 @_ZL13addChunk_iCCPP8ucvectorPK11LodePNGInfoP23LodePNGCompressSettings(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %30)
  br label %155

155:                                              ; preds = %153, %150
  %156 = getelementptr inbounds i8, ptr %10, i64 224
  %157 = load i32, ptr %156, align 8, !tbaa !44
  %.not190 = icmp eq i32 %157, 0
  br i1 %.not190, label %160, label %158

158:                                              ; preds = %155
  %159 = call noundef i32 @_ZL13addChunk_sRGBP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %160

160:                                              ; preds = %158, %155
  %161 = getelementptr inbounds i8, ptr %10, i64 180
  %162 = load i32, ptr %161, align 4, !tbaa !45
  %.not191 = icmp eq i32 %162, 0
  br i1 %.not191, label %165, label %163

163:                                              ; preds = %160
  %164 = call noundef i32 @_ZL13addChunk_gAMAP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %165

165:                                              ; preds = %163, %160
  %166 = getelementptr inbounds i8, ptr %10, i64 188
  %167 = load i32, ptr %166, align 4, !tbaa !46
  %.not192 = icmp eq i32 %167, 0
  br i1 %.not192, label %170, label %168

168:                                              ; preds = %165
  %169 = call noundef i32 @_ZL13addChunk_cHRMP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %170

170:                                              ; preds = %168, %165
  %171 = load i32, ptr %115, align 8
  %172 = icmp eq i32 %171, 3
  br i1 %172, label %173, label %175

173:                                              ; preds = %170
  %174 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %115)
  %.pr230.pre244.pre = load i32, ptr %115, align 8
  br label %175

175:                                              ; preds = %173, %170
  %.pr230.pre244 = phi i32 [ %.pr230.pre244.pre, %173 ], [ %171, %170 ]
  %176 = getelementptr inbounds i8, ptr %5, i64 136
  %177 = load i32, ptr %176, align 8, !tbaa !24
  %.not193 = icmp ne i32 %177, 0
  %178 = and i32 %.pr230.pre244, -5
  %or.cond9 = icmp eq i32 %178, 2
  %or.cond252 = select i1 %.not193, i1 %or.cond9, i1 false
  br i1 %or.cond252, label %179, label %thread-pre-split229

179:                                              ; preds = %175
  %180 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %115)
  %.pr230.pre = load i32, ptr %115, align 8, !tbaa !40
  br label %thread-pre-split229

thread-pre-split229:                              ; preds = %179, %175
  %181 = phi i32 [ %.pr230.pre244, %175 ], [ %.pr230.pre, %179 ]
  %182 = icmp eq i32 %181, 3
  br i1 %182, label %183, label %191

183:                                              ; preds = %thread-pre-split229
  %184 = getelementptr inbounds i8, ptr %10, i64 24
  %185 = load ptr, ptr %184, align 8, !tbaa !47
  %186 = getelementptr inbounds i8, ptr %10, i64 32
  %187 = load i64, ptr %186, align 8, !tbaa !48
  %188 = call noundef i32 @_ZL22getPaletteTranslucencyPKhm(ptr noundef %185, i64 noundef %187)
  %.not194 = icmp eq i32 %188, 0
  br i1 %.not194, label %191, label %189

189:                                              ; preds = %183
  %190 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %115)
  br label %191

191:                                              ; preds = %189, %183, %thread-pre-split229
  %192 = load i32, ptr %115, align 8
  %193 = and i32 %192, -3
  %or.cond13 = icmp eq i32 %193, 0
  %194 = getelementptr inbounds i8, ptr %10, i64 40
  %195 = load i32, ptr %194, align 8
  %196 = icmp ne i32 %195, 0
  %or.cond17 = select i1 %or.cond13, i1 %196, i1 false
  br i1 %or.cond17, label %197, label %199

197:                                              ; preds = %191
  %198 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK16LodePNGColorMode(ptr noundef nonnull %9, ptr noundef nonnull %115)
  br label %199

199:                                              ; preds = %191, %197
  %200 = getelementptr inbounds i8, ptr %10, i64 56
  %201 = load i32, ptr %200, align 8, !tbaa !49
  %.not195 = icmp eq i32 %201, 0
  br i1 %.not195, label %204, label %202

202:                                              ; preds = %199
  %203 = call noundef i32 @_ZL13addChunk_bKGDP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  store i32 %203, ptr %16, align 8, !tbaa !11
  %.not196 = icmp eq i32 %203, 0
  br i1 %.not196, label %204, label %307

204:                                              ; preds = %202, %199
  %205 = getelementptr inbounds i8, ptr %10, i64 164
  %206 = load i32, ptr %205, align 4, !tbaa !50
  %.not197 = icmp eq i32 %206, 0
  br i1 %.not197, label %209, label %207

207:                                              ; preds = %204
  %208 = call noundef i32 @_ZL13addChunk_pHYsP8ucvectorPK11LodePNGInfo(ptr noundef nonnull %9, ptr noundef nonnull %10)
  br label %209

209:                                              ; preds = %207, %204
  %210 = getelementptr inbounds i8, ptr %10, i64 272
  %211 = load ptr, ptr %210, align 8, !tbaa !5
  %.not198 = icmp eq ptr %211, null
  br i1 %.not198, label %216, label %212

212:                                              ; preds = %209
  %213 = getelementptr inbounds i8, ptr %10, i64 296
  %214 = load i64, ptr %213, align 8, !tbaa !9
  %215 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %9, ptr noundef nonnull %211, i64 noundef %214)
  store i32 %215, ptr %16, align 8, !tbaa !11
  %.not199 = icmp eq i32 %215, 0
  br i1 %.not199, label %216, label %307

216:                                              ; preds = %212, %209
  %217 = load ptr, ptr %7, align 8, !tbaa !5
  %218 = load i64, ptr %8, align 8, !tbaa !9
  %219 = call noundef i32 @_ZL13addChunk_IDATP8ucvectorPKhmP23LodePNGCompressSettings(ptr noundef nonnull %9, ptr noundef %217, i64 noundef %218, ptr noundef nonnull %30)
  store i32 %219, ptr %16, align 8, !tbaa !11
  %.not200 = icmp eq i32 %219, 0
  br i1 %.not200, label %220, label %307

220:                                              ; preds = %216
  %221 = getelementptr inbounds i8, ptr %10, i64 136
  %222 = load i32, ptr %221, align 8, !tbaa !51
  %.not201 = icmp eq i32 %222, 0
  br i1 %.not201, label %226, label %223

223:                                              ; preds = %220
  %224 = getelementptr inbounds i8, ptr %10, i64 140
  %225 = call noundef i32 @_ZL13addChunk_tIMEP8ucvectorPK11LodePNGTime(ptr noundef nonnull %9, ptr noundef nonnull %224)
  br label %226

226:                                              ; preds = %223, %220
  %227 = getelementptr inbounds i8, ptr %10, i64 72
  %228 = load i64, ptr %227, align 8, !tbaa !52
  %.not202233 = icmp eq i64 %228, 0
  br i1 %.not202233, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %226
  %229 = getelementptr inbounds i8, ptr %10, i64 80
  %230 = getelementptr inbounds i8, ptr %5, i64 144
  %231 = getelementptr inbounds i8, ptr %10, i64 88
  br label %232

232:                                              ; preds = %.lr.ph, %251
  %.0159234 = phi i64 [ 0, %.lr.ph ], [ %252, %251 ]
  %233 = load ptr, ptr %229, align 8, !tbaa !53
  %234 = getelementptr inbounds ptr, ptr %233, i64 %.0159234
  %235 = load ptr, ptr %234, align 8, !tbaa !5
  %236 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %235) #5
  %237 = icmp ugt i64 %236, 79
  br i1 %237, label %238, label %239

238:                                              ; preds = %232
  store i32 66, ptr %16, align 8, !tbaa !11
  br label %307

239:                                              ; preds = %232
  %240 = icmp eq i64 %236, 0
  br i1 %240, label %241, label %242

241:                                              ; preds = %239
  store i32 67, ptr %16, align 8, !tbaa !11
  br label %307

242:                                              ; preds = %239
  %243 = load i32, ptr %230, align 8, !tbaa !54
  %.not209 = icmp eq i32 %243, 0
  %244 = load ptr, ptr %231, align 8, !tbaa !55
  %245 = getelementptr inbounds ptr, ptr %244, i64 %.0159234
  %246 = load ptr, ptr %245, align 8, !tbaa !5
  br i1 %.not209, label %249, label %247

247:                                              ; preds = %242
  %248 = call noundef i32 @_ZL13addChunk_zTXtP8ucvectorPKcS2_P23LodePNGCompressSettings(ptr noundef nonnull %9, ptr noundef %235, ptr noundef %246, ptr noundef nonnull %30)
  br label %251

249:                                              ; preds = %242
  %250 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef nonnull %9, ptr noundef %235, ptr noundef %246)
  br label %251

251:                                              ; preds = %247, %249
  %252 = add i64 %.0159234, 1
  %253 = load i64, ptr %227, align 8, !tbaa !52
  %.not202 = icmp eq i64 %252, %253
  br i1 %.not202, label %._crit_edge, label %232, !llvm.loop !56

._crit_edge:                                      ; preds = %251
  %254 = getelementptr inbounds i8, ptr %5, i64 140
  %255 = load i32, ptr %254, align 4, !tbaa !58
  %.not203 = icmp eq i32 %255, 0
  br i1 %.not203, label %.loopexit, label %.preheader

._crit_edge.thread:                               ; preds = %226
  %256 = getelementptr inbounds i8, ptr %5, i64 140
  %257 = load i32, ptr %256, align 4, !tbaa !58
  %.not203248 = icmp eq i32 %257, 0
  br i1 %.not203248, label %.loopexit, label %.critedge

.preheader:                                       ; preds = %._crit_edge
  %.not204235 = icmp eq i64 %252, 0
  br i1 %.not204235, label %.critedge, label %.lr.ph237

.lr.ph237:                                        ; preds = %.preheader
  %258 = getelementptr inbounds i8, ptr %10, i64 80
  %259 = load ptr, ptr %258, align 8, !tbaa !53
  br label %262

260:                                              ; preds = %262
  %261 = add nuw i64 %.1236, 1
  %.not204 = icmp eq i64 %.1236, %.0159234
  br i1 %.not204, label %.critedge, label %262, !llvm.loop !59

262:                                              ; preds = %.lr.ph237, %260
  %.1236 = phi i64 [ 0, %.lr.ph237 ], [ %261, %260 ]
  %263 = getelementptr inbounds ptr, ptr %259, i64 %.1236
  %264 = load ptr, ptr %263, align 8, !tbaa !5
  %265 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %264, ptr noundef nonnull dereferenceable(1) @.str.15) #5
  %.not205 = icmp eq i32 %265, 0
  br i1 %.not205, label %.loopexit, label %260

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

.loopexit:                                        ; preds = %262, %._crit_edge.thread, %.critedge, %._crit_edge
  %268 = getelementptr inbounds i8, ptr %10, i64 96
  %269 = load i64, ptr %268, align 8, !tbaa !60
  %.not206238 = icmp eq i64 %269, 0
  br i1 %.not206238, label %._crit_edge242, label %.lr.ph241

.lr.ph241:                                        ; preds = %.loopexit
  %270 = getelementptr inbounds i8, ptr %10, i64 104
  %271 = getelementptr inbounds i8, ptr %5, i64 144
  %272 = getelementptr inbounds i8, ptr %10, i64 112
  %273 = getelementptr inbounds i8, ptr %10, i64 120
  %274 = getelementptr inbounds i8, ptr %10, i64 128
  br label %275

275:                                              ; preds = %.lr.ph241, %285
  %.2239 = phi i64 [ 0, %.lr.ph241 ], [ %297, %285 ]
  %276 = load ptr, ptr %270, align 8, !tbaa !61
  %277 = getelementptr inbounds ptr, ptr %276, i64 %.2239
  %278 = load ptr, ptr %277, align 8, !tbaa !5
  %279 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %278) #5
  %280 = icmp ugt i64 %279, 79
  br i1 %280, label %281, label %282

281:                                              ; preds = %275
  store i32 66, ptr %16, align 8, !tbaa !11
  br label %307

282:                                              ; preds = %275
  %283 = icmp eq i64 %279, 0
  br i1 %283, label %284, label %285

284:                                              ; preds = %282
  store i32 67, ptr %16, align 8, !tbaa !11
  br label %307

285:                                              ; preds = %282
  %286 = load i32, ptr %271, align 8, !tbaa !54
  %287 = load ptr, ptr %272, align 8, !tbaa !62
  %288 = getelementptr inbounds ptr, ptr %287, i64 %.2239
  %289 = load ptr, ptr %288, align 8, !tbaa !5
  %290 = load ptr, ptr %273, align 8, !tbaa !63
  %291 = getelementptr inbounds ptr, ptr %290, i64 %.2239
  %292 = load ptr, ptr %291, align 8, !tbaa !5
  %293 = load ptr, ptr %274, align 8, !tbaa !64
  %294 = getelementptr inbounds ptr, ptr %293, i64 %.2239
  %295 = load ptr, ptr %294, align 8, !tbaa !5
  %296 = call noundef i32 @_ZL13addChunk_iTXtP8ucvectorjPKcS2_S2_S2_P23LodePNGCompressSettings(ptr noundef nonnull %9, i32 noundef %286, ptr noundef %278, ptr noundef %289, ptr noundef %292, ptr noundef %295, ptr noundef nonnull %30)
  %297 = add i64 %.2239, 1
  %298 = load i64, ptr %268, align 8, !tbaa !60
  %.not206 = icmp eq i64 %297, %298
  br i1 %.not206, label %._crit_edge242, label %275, !llvm.loop !65

._crit_edge242:                                   ; preds = %285, %.loopexit
  %299 = getelementptr inbounds i8, ptr %10, i64 280
  %300 = load ptr, ptr %299, align 8, !tbaa !5
  %.not207 = icmp eq ptr %300, null
  br i1 %.not207, label %305, label %301

301:                                              ; preds = %._crit_edge242
  %302 = getelementptr inbounds i8, ptr %10, i64 304
  %303 = load i64, ptr %302, align 8, !tbaa !9
  %304 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %9, ptr noundef nonnull %300, i64 noundef %303)
  store i32 %304, ptr %16, align 8, !tbaa !11
  %.not208 = icmp eq i32 %304, 0
  br i1 %.not208, label %305, label %307

305:                                              ; preds = %301, %._crit_edge242
  %306 = call noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef nonnull %9)
  br label %307

307:                                              ; preds = %100, %103, %105, %.thread, %.thread227, %238, %241, %281, %284, %305, %146, %202, %212, %216, %301, %79, %43, %39, %38, %33, %28
  call void @_Z20lodepng_info_cleanupP11LodePNGInfo(ptr noundef nonnull %10)
  %308 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZL12lodepng_freePv(ptr noundef %308)
  %309 = load ptr, ptr %9, align 8, !tbaa !66
  store ptr %309, ptr %0, align 8, !tbaa !5
  %310 = getelementptr inbounds i8, ptr %9, i64 8
  %311 = load i64, ptr %310, align 8, !tbaa !68
  store i64 %311, ptr %1, align 8, !tbaa !9
  %312 = load i32, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 312, ptr nonnull %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #4
  ret i32 %312
}

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

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

; 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 noundef i32 @_ZL19preProcessScanlinesPPhPmPKhjjPK11LodePNGInfoPK22LodePNGEncoderSettings(ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

; 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 #3

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

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

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

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

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

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

; 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 #3

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

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

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

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

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture 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 #3

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef) local_unnamed_addr #3

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 nofree nounwind willreturn memory(argmem: read) "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 = { 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 #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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, !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 = !{!12, !20, i64 208}
!24 = !{!12, !15, i64 136}
!25 = !{!12, !10, i64 224}
!26 = !{!12, !15, i64 64}
!27 = !{!12, !15, i64 200}
!28 = !{!12, !15, i64 212}
!29 = !{!12, !20, i64 152}
!30 = !{!12, !15, i64 156}
!31 = !{!12, !15, i64 112}
!32 = !{!12, !15, i64 248}
!33 = !{!12, !15, i64 252}
!34 = !{!12, !15, i64 256}
!35 = !{!12, !15, i64 260}
!36 = !{!15, !15, i64 0}
!37 = !{!12, !15, i64 424}
!38 = !{!12, !6, i64 440}
!39 = !{!12, !15, i64 448}
!40 = !{!21, !20, i64 16}
!41 = !{!21, !15, i64 20}
!42 = !{!21, !15, i64 8}
!43 = !{!21, !15, i64 232}
!44 = !{!21, !15, i64 224}
!45 = !{!21, !15, i64 180}
!46 = !{!21, !15, i64 188}
!47 = !{!21, !6, i64 24}
!48 = !{!21, !10, i64 32}
!49 = !{!21, !15, i64 56}
!50 = !{!21, !15, i64 164}
!51 = !{!21, !15, i64 136}
!52 = !{!21, !10, i64 72}
!53 = !{!21, !6, i64 80}
!54 = !{!12, !15, i64 144}
!55 = !{!21, !6, i64 88}
!56 = distinct !{!56, !57}
!57 = !{!"llvm.loop.mustprogress"}
!58 = !{!12, !15, i64 140}
!59 = distinct !{!59, !57}
!60 = !{!21, !10, i64 96}
!61 = !{!21, !6, i64 104}
!62 = !{!21, !6, i64 112}
!63 = !{!21, !6, i64 120}
!64 = !{!21, !6, i64 128}
!65 = distinct !{!65, !57}
!66 = !{!67, !6, i64 0}
!67 = !{!"_ZTS8ucvector", !6, i64 0, !10, i64 8, !10, i64 16}
!68 = !{!67, !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