; LLVM IR from simbody/simbody :: Simbody/Visualizer/simbody-visualizer (lodepng)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.LodePNG_InfoPng = type { i32, i32, i32, i32, i32, %struct.LodePNG_InfoColor, i32, i32, i32, i32, %struct.LodePNG_Text, %struct.LodePNG_IText, i8, %struct.LodePNG_Time, i32, i32, i32, i8, %struct.LodePNG_UnknownChunks }
%struct.LodePNG_InfoColor = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.LodePNG_Text = type { i64, ptr, ptr }
%struct.LodePNG_IText = type { i64, ptr, ptr, ptr, ptr }
%struct.LodePNG_Time = type { i32, i8, i8, i8, i8, i8 }
%struct.LodePNG_UnknownChunks = type { [3 x ptr], [3 x i64] }
%struct.ucvector = type { ptr, i64, i64 }
%struct.LodePNG_Encoder = type { %struct.LodePNG_EncodeSettings, %struct.LodePNG_InfoPng, %struct.LodePNG_InfoRaw, i32 }
%struct.LodePNG_EncodeSettings = type { %struct.LodeZlib_CompressSettings, i32, i32, i32, i32 }
%struct.LodeZlib_CompressSettings = type { i32, i32, i32 }
%struct.LodePNG_InfoRaw = type { %struct.LodePNG_InfoColor }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 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: 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 @_ZL13ucvector_initP8ucvector(ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z24LodePNG_InfoColor_getBppPK17LodePNG_InfoColor(ptr noundef) #4

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22LodePNG_Encoder_encodeP15LodePNG_EncoderPPhPmPKhjj(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) #4 {
  %7 = alloca ptr, align 8
  %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 %struct.LodePNG_InfoPng, align 8
  %14 = alloca %struct.ucvector, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 224, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 0, ptr %16, align 8, !tbaa !11
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr null, ptr %22, align 8, !tbaa !5
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 0, ptr %23, align 8, !tbaa !11
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %24, i32 0, i32 3
  store i32 0, ptr %25, align 8, !tbaa !13
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %26, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %27, i64 224, i1 false), !tbaa.struct !24
  %28 = load i32, ptr %11, align 4, !tbaa !9
  %29 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 0
  store i32 %28, ptr %29, align 8, !tbaa !26
  %30 = load i32, ptr %12, align 4, !tbaa !9
  %31 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 1
  store i32 %30, ptr %31, align 4, !tbaa !27
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %32, i32 0, i32 0
  %34 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %33, i32 0, i32 1
  %35 = load i32, ptr %34, align 4, !tbaa !28
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %64

37:                                               ; preds = %6
  %38 = load ptr, ptr %10, align 8, !tbaa !5
  %39 = load i32, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %12, align 4, !tbaa !9
  %41 = load ptr, ptr %7, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %41, i32 0, i32 2
  %43 = getelementptr inbounds %struct.LodePNG_InfoRaw, ptr %42, i32 0, i32 0
  %44 = call noundef i32 @_ZL13isFullyOpaquePKhjjPK17LodePNG_InfoColor(ptr noundef %38, i32 noundef %39, i32 noundef %40, ptr noundef %43)
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %64

46:                                               ; preds = %37
  %47 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %48 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %47, i32 0, i32 0
  %49 = load i32, ptr %48, align 8, !tbaa !29
  %50 = icmp eq i32 %49, 6
  br i1 %50, label %51, label %54

51:                                               ; preds = %46
  %52 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %53 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %52, i32 0, i32 0
  store i32 2, ptr %53, align 8, !tbaa !29
  br label %63

54:                                               ; preds = %46
  %55 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %56 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %55, i32 0, i32 0
  %57 = load i32, ptr %56, align 8, !tbaa !29
  %58 = icmp eq i32 %57, 4
  br i1 %58, label %59, label %62

59:                                               ; preds = %54
  %60 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %61 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %60, i32 0, i32 0
  store i32 0, ptr %61, align 8, !tbaa !29
  br label %62

62:                                               ; preds = %59, %54
  br label %63

63:                                               ; preds = %62, %51
  br label %64

64:                                               ; preds = %63, %37, %6
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %66, i32 0, i32 0
  %68 = getelementptr inbounds %struct.LodeZlib_CompressSettings, ptr %67, i32 0, i32 2
  %69 = load i32, ptr %68, align 8, !tbaa !30
  %70 = icmp ugt i32 %69, 32768
  br i1 %70, label %71, label %74

71:                                               ; preds = %64
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %72, i32 0, i32 3
  store i32 60, ptr %73, align 8, !tbaa !13
  store i32 1, ptr %17, align 4
  br label %593

74:                                               ; preds = %64
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %75, i32 0, i32 0
  %77 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.LodeZlib_CompressSettings, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 8, !tbaa !31
  %80 = icmp ugt i32 %79, 2
  br i1 %80, label %81, label %84

81:                                               ; preds = %74
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %82, i32 0, i32 3
  store i32 61, ptr %83, align 8, !tbaa !13
  store i32 1, ptr %17, align 4
  br label %593

84:                                               ; preds = %74
  %85 = load ptr, ptr %7, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %85, i32 0, i32 1
  %87 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %86, i32 0, i32 4
  %88 = load i32, ptr %87, align 8, !tbaa !32
  %89 = icmp ugt i32 %88, 1
  br i1 %89, label %90, label %93

90:                                               ; preds = %84
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %91, i32 0, i32 3
  store i32 71, ptr %92, align 8, !tbaa !13
  store i32 1, ptr %17, align 4
  br label %593

93:                                               ; preds = %84
  %94 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %95 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %94, i32 0, i32 0
  %96 = load i32, ptr %95, align 8, !tbaa !29
  %97 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %98 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %97, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !33
  %100 = call noundef i32 @_ZL18checkColorValidityjj(i32 noundef %96, i32 noundef %99)
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %101, i32 0, i32 3
  store i32 %100, ptr %102, align 8, !tbaa !13
  %103 = icmp ne i32 %100, 0
  br i1 %103, label %104, label %105

104:                                              ; preds = %93
  store i32 1, ptr %17, align 4
  br label %593

105:                                              ; preds = %93
  %106 = load ptr, ptr %7, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %106, i32 0, i32 2
  %108 = getelementptr inbounds %struct.LodePNG_InfoRaw, ptr %107, i32 0, i32 0
  %109 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %108, i32 0, i32 0
  %110 = load i32, ptr %109, align 8, !tbaa !34
  %111 = load ptr, ptr %7, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %111, i32 0, i32 2
  %113 = getelementptr inbounds %struct.LodePNG_InfoRaw, ptr %112, i32 0, i32 0
  %114 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !35
  %116 = call noundef i32 @_ZL18checkColorValidityjj(i32 noundef %110, i32 noundef %115)
  %117 = load ptr, ptr %7, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %117, i32 0, i32 3
  store i32 %116, ptr %118, align 8, !tbaa !13
  %119 = icmp ne i32 %116, 0
  br i1 %119, label %120, label %121

120:                                              ; preds = %105
  store i32 1, ptr %17, align 4
  br label %593

121:                                              ; preds = %105
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %122, i32 0, i32 2
  %124 = getelementptr inbounds %struct.LodePNG_InfoRaw, ptr %123, i32 0, i32 0
  %125 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %126 = call noundef i32 @_Z23LodePNG_InfoColor_equalPK17LodePNG_InfoColorS1_(ptr noundef %124, ptr noundef %125)
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %196, label %128

128:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %129 = load i32, ptr %11, align 4, !tbaa !9
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = mul i32 %129, %130
  %132 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %133 = call noundef i32 @_Z24LodePNG_InfoColor_getBppPK17LodePNG_InfoColor(ptr noundef %132)
  %134 = mul i32 %131, %133
  %135 = add i32 %134, 7
  %136 = udiv i32 %135, 8
  %137 = zext i32 %136 to i64
  store i64 %137, ptr %19, align 8, !tbaa !11
  %138 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %139 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %138, i32 0, i32 0
  %140 = load i32, ptr %139, align 8, !tbaa !29
  %141 = icmp ne i32 %140, 6
  br i1 %141, label %142, label %147

142:                                              ; preds = %128
  %143 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %144 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %143, i32 0, i32 0
  %145 = load i32, ptr %144, align 8, !tbaa !29
  %146 = icmp ne i32 %145, 2
  br i1 %146, label %152, label %147

147:                                              ; preds = %142, %128
  %148 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %149 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %148, i32 0, i32 1
  %150 = load i32, ptr %149, align 4, !tbaa !33
  %151 = icmp ne i32 %150, 8
  br i1 %151, label %152, label %155

152:                                              ; preds = %147, %142
  %153 = load ptr, ptr %7, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %153, i32 0, i32 3
  store i32 59, ptr %154, align 8, !tbaa !13
  store i32 1, ptr %17, align 4
  br label %193

155:                                              ; preds = %147
  %156 = load i64, ptr %19, align 8, !tbaa !11
  %157 = call noalias ptr @malloc(i64 noundef %156) #8
  store ptr %157, ptr %18, align 8, !tbaa !5
  %158 = load ptr, ptr %18, align 8, !tbaa !5
  %159 = icmp ne ptr %158, null
  br i1 %159, label %166, label %160

160:                                              ; preds = %155
  %161 = load i64, ptr %19, align 8, !tbaa !11
  %162 = icmp ne i64 %161, 0
  br i1 %162, label %163, label %166

163:                                              ; preds = %160
  %164 = load ptr, ptr %7, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %164, i32 0, i32 3
  store i32 9955, ptr %165, align 8, !tbaa !13
  br label %166

166:                                              ; preds = %163, %160, %155
  %167 = load ptr, ptr %7, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %167, i32 0, i32 3
  %169 = load i32, ptr %168, align 8, !tbaa !13
  %170 = icmp ne i32 %169, 0
  br i1 %170, label %183, label %171

171:                                              ; preds = %166
  %172 = load ptr, ptr %18, align 8, !tbaa !5
  %173 = load ptr, ptr %10, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %175 = load ptr, ptr %7, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %175, i32 0, i32 2
  %177 = getelementptr inbounds %struct.LodePNG_InfoRaw, ptr %176, i32 0, i32 0
  %178 = load i32, ptr %11, align 4, !tbaa !9
  %179 = load i32, ptr %12, align 4, !tbaa !9
  %180 = call noundef i32 @_Z15LodePNG_convertPhPKhP17LodePNG_InfoColorS3_jj(ptr noundef %172, ptr noundef %173, ptr noundef %174, ptr noundef %177, i32 noundef %178, i32 noundef %179)
  %181 = load ptr, ptr %7, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %181, i32 0, i32 3
  store i32 %180, ptr %182, align 8, !tbaa !13
  br label %183

183:                                              ; preds = %171, %166
  %184 = load ptr, ptr %7, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %184, i32 0, i32 3
  %186 = load i32, ptr %185, align 8, !tbaa !13
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %191, label %188

188:                                              ; preds = %183
  %189 = load ptr, ptr %18, align 8, !tbaa !5
  %190 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhPK15LodePNG_InfoPng(ptr noundef %15, ptr noundef %16, ptr noundef %189, ptr noundef %13)
  br label %191

191:                                              ; preds = %188, %183
  %192 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %192) #7
  store i32 0, ptr %17, align 4
  br label %193

193:                                              ; preds = %191, %152
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  %194 = load i32, ptr %17, align 4
  switch i32 %194, label %593 [
    i32 0, label %195
  ]

195:                                              ; preds = %193
  br label %199

196:                                              ; preds = %121
  %197 = load ptr, ptr %10, align 8, !tbaa !5
  %198 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhPK15LodePNG_InfoPng(ptr noundef %15, ptr noundef %16, ptr noundef %197, ptr noundef %13)
  br label %199

199:                                              ; preds = %196, %195
  call void @_ZL13ucvector_initP8ucvector(ptr noundef %14)
  br label %200

200:                                              ; preds = %199
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %201, i32 0, i32 3
  %203 = load i32, ptr %202, align 8, !tbaa !13
  %204 = icmp ne i32 %203, 0
  %205 = xor i1 %204, true
  br i1 %205, label %206, label %585

206:                                              ; preds = %200
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @_ZL14writeSignatureP8ucvector(ptr noundef %14)
  %207 = load i32, ptr %11, align 4, !tbaa !9
  %208 = load i32, ptr %12, align 4, !tbaa !9
  %209 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %210 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %209, i32 0, i32 1
  %211 = load i32, ptr %210, align 4, !tbaa !33
  %212 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %213 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %212, i32 0, i32 0
  %214 = load i32, ptr %213, align 8, !tbaa !29
  %215 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 4
  %216 = load i32, ptr %215, align 8, !tbaa !36
  %217 = call noundef i32 @_ZL13addChunk_IHDRP8ucvectorjjjjj(ptr noundef %14, i32 noundef %207, i32 noundef %208, i32 noundef %211, i32 noundef %214, i32 noundef %216)
  %218 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %219 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %218, i32 0, i32 0
  %220 = getelementptr inbounds [3 x ptr], ptr %219, i64 0, i64 0
  %221 = load ptr, ptr %220, align 8, !tbaa !5
  %222 = icmp ne ptr %221, null
  br i1 %222, label %223, label %241

223:                                              ; preds = %206
  %224 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %225 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %224, i32 0, i32 0
  %226 = getelementptr inbounds [3 x ptr], ptr %225, i64 0, i64 0
  %227 = load ptr, ptr %226, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %229 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %228, i32 0, i32 1
  %230 = getelementptr inbounds [3 x i64], ptr %229, i64 0, i64 0
  %231 = load i64, ptr %230, align 8, !tbaa !11
  %232 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %14, ptr noundef %227, i64 noundef %231)
  %233 = load ptr, ptr %7, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %233, i32 0, i32 3
  store i32 %232, ptr %234, align 8, !tbaa !13
  %235 = load ptr, ptr %7, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %235, i32 0, i32 3
  %237 = load i32, ptr %236, align 8, !tbaa !13
  %238 = icmp ne i32 %237, 0
  br i1 %238, label %239, label %240

239:                                              ; preds = %223
  store i32 3, ptr %17, align 4
  br label %584

240:                                              ; preds = %223
  br label %241

241:                                              ; preds = %240, %206
  %242 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %243 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %242, i32 0, i32 0
  %244 = load i32, ptr %243, align 8, !tbaa !29
  %245 = icmp eq i32 %244, 3
  br i1 %245, label %246, label %262

246:                                              ; preds = %241
  %247 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %248 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %247, i32 0, i32 3
  %249 = load i64, ptr %248, align 8, !tbaa !37
  %250 = icmp eq i64 %249, 0
  br i1 %250, label %256, label %251

251:                                              ; preds = %246
  %252 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %253 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %252, i32 0, i32 3
  %254 = load i64, ptr %253, align 8, !tbaa !37
  %255 = icmp ugt i64 %254, 256
  br i1 %255, label %256, label %259

256:                                              ; preds = %251, %246
  %257 = load ptr, ptr %7, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %257, i32 0, i32 3
  store i32 68, ptr %258, align 8, !tbaa !13
  store i32 3, ptr %17, align 4
  br label %584

259:                                              ; preds = %251
  %260 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %261 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK17LodePNG_InfoColor(ptr noundef %14, ptr noundef %260)
  br label %262

262:                                              ; preds = %259, %241
  %263 = load ptr, ptr %7, align 8, !tbaa !5
  %264 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %263, i32 0, i32 0
  %265 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %264, i32 0, i32 2
  %266 = load i32, ptr %265, align 8, !tbaa !38
  %267 = icmp ne i32 %266, 0
  br i1 %267, label %268, label %294

268:                                              ; preds = %262
  %269 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %270 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %269, i32 0, i32 0
  %271 = load i32, ptr %270, align 8, !tbaa !29
  %272 = icmp eq i32 %271, 2
  br i1 %272, label %278, label %273

273:                                              ; preds = %268
  %274 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %275 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %274, i32 0, i32 0
  %276 = load i32, ptr %275, align 8, !tbaa !29
  %277 = icmp eq i32 %276, 6
  br i1 %277, label %278, label %294

278:                                              ; preds = %273, %268
  %279 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %280 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %279, i32 0, i32 3
  %281 = load i64, ptr %280, align 8, !tbaa !37
  %282 = icmp eq i64 %281, 0
  br i1 %282, label %288, label %283

283:                                              ; preds = %278
  %284 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %285 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %284, i32 0, i32 3
  %286 = load i64, ptr %285, align 8, !tbaa !37
  %287 = icmp ugt i64 %286, 256
  br i1 %287, label %288, label %291

288:                                              ; preds = %283, %278
  %289 = load ptr, ptr %7, align 8, !tbaa !5
  %290 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %289, i32 0, i32 3
  store i32 68, ptr %290, align 8, !tbaa !13
  store i32 3, ptr %17, align 4
  br label %584

291:                                              ; preds = %283
  %292 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %293 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK17LodePNG_InfoColor(ptr noundef %14, ptr noundef %292)
  br label %294

294:                                              ; preds = %291, %273, %262
  %295 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %296 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %295, i32 0, i32 0
  %297 = load i32, ptr %296, align 8, !tbaa !29
  %298 = icmp eq i32 %297, 3
  br i1 %298, label %299, label %311

299:                                              ; preds = %294
  %300 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %301 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %300, i32 0, i32 2
  %302 = load ptr, ptr %301, align 8, !tbaa !39
  %303 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %304 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %303, i32 0, i32 3
  %305 = load i64, ptr %304, align 8, !tbaa !37
  %306 = call noundef i32 @_ZL20isPaletteFullyOpaquePKhm(ptr noundef %302, i64 noundef %305)
  %307 = icmp ne i32 %306, 0
  br i1 %307, label %311, label %308

308:                                              ; preds = %299
  %309 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %310 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK17LodePNG_InfoColor(ptr noundef %14, ptr noundef %309)
  br label %311

311:                                              ; preds = %308, %299, %294
  %312 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %313 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %312, i32 0, i32 0
  %314 = load i32, ptr %313, align 8, !tbaa !29
  %315 = icmp eq i32 %314, 0
  br i1 %315, label %321, label %316

316:                                              ; preds = %311
  %317 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %318 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %317, i32 0, i32 0
  %319 = load i32, ptr %318, align 8, !tbaa !29
  %320 = icmp eq i32 %319, 2
  br i1 %320, label %321, label %329

321:                                              ; preds = %316, %311
  %322 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %323 = getelementptr inbounds %struct.LodePNG_InfoColor, ptr %322, i32 0, i32 4
  %324 = load i32, ptr %323, align 8, !tbaa !40
  %325 = icmp ne i32 %324, 0
  br i1 %325, label %326, label %329

326:                                              ; preds = %321
  %327 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 5
  %328 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK17LodePNG_InfoColor(ptr noundef %14, ptr noundef %327)
  br label %329

329:                                              ; preds = %326, %321, %316
  %330 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 6
  %331 = load i32, ptr %330, align 8, !tbaa !41
  %332 = icmp ne i32 %331, 0
  br i1 %332, label %333, label %335

333:                                              ; preds = %329
  %334 = call noundef i32 @_ZL13addChunk_bKGDP8ucvectorPK15LodePNG_InfoPng(ptr noundef %14, ptr noundef %13)
  br label %335

335:                                              ; preds = %333, %329
  %336 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 14
  %337 = load i32, ptr %336, align 8, !tbaa !42
  %338 = icmp ne i32 %337, 0
  br i1 %338, label %339, label %341

339:                                              ; preds = %335
  %340 = call noundef i32 @_ZL13addChunk_pHYsP8ucvectorPK15LodePNG_InfoPng(ptr noundef %14, ptr noundef %13)
  br label %341

341:                                              ; preds = %339, %335
  %342 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %343 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %342, i32 0, i32 0
  %344 = getelementptr inbounds [3 x ptr], ptr %343, i64 0, i64 1
  %345 = load ptr, ptr %344, align 8, !tbaa !5
  %346 = icmp ne ptr %345, null
  br i1 %346, label %347, label %365

347:                                              ; preds = %341
  %348 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %349 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %348, i32 0, i32 0
  %350 = getelementptr inbounds [3 x ptr], ptr %349, i64 0, i64 1
  %351 = load ptr, ptr %350, align 8, !tbaa !5
  %352 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %353 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %352, i32 0, i32 1
  %354 = getelementptr inbounds [3 x i64], ptr %353, i64 0, i64 1
  %355 = load i64, ptr %354, align 8, !tbaa !11
  %356 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %14, ptr noundef %351, i64 noundef %355)
  %357 = load ptr, ptr %7, align 8, !tbaa !5
  %358 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %357, i32 0, i32 3
  store i32 %356, ptr %358, align 8, !tbaa !13
  %359 = load ptr, ptr %7, align 8, !tbaa !5
  %360 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %359, i32 0, i32 3
  %361 = load i32, ptr %360, align 8, !tbaa !13
  %362 = icmp ne i32 %361, 0
  br i1 %362, label %363, label %364

363:                                              ; preds = %347
  store i32 3, ptr %17, align 4
  br label %584

364:                                              ; preds = %347
  br label %365

365:                                              ; preds = %364, %341
  %366 = load ptr, ptr %15, align 8, !tbaa !5
  %367 = load i64, ptr %16, align 8, !tbaa !11
  %368 = load ptr, ptr %7, align 8, !tbaa !5
  %369 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %368, i32 0, i32 0
  %370 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %369, i32 0, i32 0
  %371 = call noundef i32 @_ZL13addChunk_IDATP8ucvectorPKhmP25LodeZlib_CompressSettings(ptr noundef %14, ptr noundef %366, i64 noundef %367, ptr noundef %370)
  %372 = load ptr, ptr %7, align 8, !tbaa !5
  %373 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %372, i32 0, i32 3
  store i32 %371, ptr %373, align 8, !tbaa !13
  %374 = load ptr, ptr %7, align 8, !tbaa !5
  %375 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %374, i32 0, i32 3
  %376 = load i32, ptr %375, align 8, !tbaa !13
  %377 = icmp ne i32 %376, 0
  br i1 %377, label %378, label %379

378:                                              ; preds = %365
  store i32 3, ptr %17, align 4
  br label %584

379:                                              ; preds = %365
  %380 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 12
  %381 = load i8, ptr %380, align 8, !tbaa !43
  %382 = icmp ne i8 %381, 0
  br i1 %382, label %383, label %386

383:                                              ; preds = %379
  %384 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 13
  %385 = call noundef i32 @_ZL13addChunk_tIMEP8ucvectorPK12LodePNG_Time(ptr noundef %14, ptr noundef %384)
  br label %386

386:                                              ; preds = %383, %379
  store i64 0, ptr %20, align 8, !tbaa !11
  br label %387

387:                                              ; preds = %455, %386
  %388 = load i64, ptr %20, align 8, !tbaa !11
  %389 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %390 = getelementptr inbounds %struct.LodePNG_Text, ptr %389, i32 0, i32 0
  %391 = load i64, ptr %390, align 8, !tbaa !44
  %392 = icmp ult i64 %388, %391
  br i1 %392, label %393, label %458

393:                                              ; preds = %387
  %394 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %395 = getelementptr inbounds %struct.LodePNG_Text, ptr %394, i32 0, i32 1
  %396 = load ptr, ptr %395, align 8, !tbaa !45
  %397 = load i64, ptr %20, align 8, !tbaa !11
  %398 = getelementptr inbounds ptr, ptr %396, i64 %397
  %399 = load ptr, ptr %398, align 8, !tbaa !5
  %400 = call i64 @strlen(ptr noundef %399) #9
  %401 = icmp ugt i64 %400, 79
  br i1 %401, label %402, label %405

402:                                              ; preds = %393
  %403 = load ptr, ptr %7, align 8, !tbaa !5
  %404 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %403, i32 0, i32 3
  store i32 66, ptr %404, align 8, !tbaa !13
  br label %458

405:                                              ; preds = %393
  %406 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %407 = getelementptr inbounds %struct.LodePNG_Text, ptr %406, i32 0, i32 1
  %408 = load ptr, ptr %407, align 8, !tbaa !45
  %409 = load i64, ptr %20, align 8, !tbaa !11
  %410 = getelementptr inbounds ptr, ptr %408, i64 %409
  %411 = load ptr, ptr %410, align 8, !tbaa !5
  %412 = call i64 @strlen(ptr noundef %411) #9
  %413 = icmp ult i64 %412, 1
  br i1 %413, label %414, label %417

414:                                              ; preds = %405
  %415 = load ptr, ptr %7, align 8, !tbaa !5
  %416 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %415, i32 0, i32 3
  store i32 67, ptr %416, align 8, !tbaa !13
  br label %458

417:                                              ; preds = %405
  %418 = load ptr, ptr %7, align 8, !tbaa !5
  %419 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %418, i32 0, i32 0
  %420 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %419, i32 0, i32 4
  %421 = load i32, ptr %420, align 8, !tbaa !46
  %422 = icmp ne i32 %421, 0
  br i1 %422, label %423, label %440

423:                                              ; preds = %417
  %424 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %425 = getelementptr inbounds %struct.LodePNG_Text, ptr %424, i32 0, i32 1
  %426 = load ptr, ptr %425, align 8, !tbaa !45
  %427 = load i64, ptr %20, align 8, !tbaa !11
  %428 = getelementptr inbounds ptr, ptr %426, i64 %427
  %429 = load ptr, ptr %428, align 8, !tbaa !5
  %430 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %431 = getelementptr inbounds %struct.LodePNG_Text, ptr %430, i32 0, i32 2
  %432 = load ptr, ptr %431, align 8, !tbaa !47
  %433 = load i64, ptr %20, align 8, !tbaa !11
  %434 = getelementptr inbounds ptr, ptr %432, i64 %433
  %435 = load ptr, ptr %434, align 8, !tbaa !5
  %436 = load ptr, ptr %7, align 8, !tbaa !5
  %437 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %436, i32 0, i32 0
  %438 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %437, i32 0, i32 0
  %439 = call noundef i32 @_ZL13addChunk_zTXtP8ucvectorPKcS2_P25LodeZlib_CompressSettings(ptr noundef %14, ptr noundef %429, ptr noundef %435, ptr noundef %438)
  br label %454

440:                                              ; preds = %417
  %441 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %442 = getelementptr inbounds %struct.LodePNG_Text, ptr %441, i32 0, i32 1
  %443 = load ptr, ptr %442, align 8, !tbaa !45
  %444 = load i64, ptr %20, align 8, !tbaa !11
  %445 = getelementptr inbounds ptr, ptr %443, i64 %444
  %446 = load ptr, ptr %445, align 8, !tbaa !5
  %447 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %448 = getelementptr inbounds %struct.LodePNG_Text, ptr %447, i32 0, i32 2
  %449 = load ptr, ptr %448, align 8, !tbaa !47
  %450 = load i64, ptr %20, align 8, !tbaa !11
  %451 = getelementptr inbounds ptr, ptr %449, i64 %450
  %452 = load ptr, ptr %451, align 8, !tbaa !5
  %453 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef %14, ptr noundef %446, ptr noundef %452)
  br label %454

454:                                              ; preds = %440, %423
  br label %455

455:                                              ; preds = %454
  %456 = load i64, ptr %20, align 8, !tbaa !11
  %457 = add i64 %456, 1
  store i64 %457, ptr %20, align 8, !tbaa !11
  br label %387, !llvm.loop !48

458:                                              ; preds = %414, %402, %387
  %459 = load ptr, ptr %7, align 8, !tbaa !5
  %460 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %459, i32 0, i32 0
  %461 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %460, i32 0, i32 3
  %462 = load i32, ptr %461, align 4, !tbaa !50
  %463 = icmp ne i32 %462, 0
  br i1 %463, label %464, label %491

464:                                              ; preds = %458
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !9
  store i64 0, ptr %20, align 8, !tbaa !11
  br label %465

465:                                              ; preds = %482, %464
  %466 = load i64, ptr %20, align 8, !tbaa !11
  %467 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %468 = getelementptr inbounds %struct.LodePNG_Text, ptr %467, i32 0, i32 0
  %469 = load i64, ptr %468, align 8, !tbaa !44
  %470 = icmp ult i64 %466, %469
  br i1 %470, label %471, label %485

471:                                              ; preds = %465
  %472 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 10
  %473 = getelementptr inbounds %struct.LodePNG_Text, ptr %472, i32 0, i32 1
  %474 = load ptr, ptr %473, align 8, !tbaa !45
  %475 = load i64, ptr %20, align 8, !tbaa !11
  %476 = getelementptr inbounds ptr, ptr %474, i64 %475
  %477 = load ptr, ptr %476, align 8, !tbaa !5
  %478 = call i32 @strcmp(ptr noundef %477, ptr noundef @.str) #9
  %479 = icmp ne i32 %478, 0
  br i1 %479, label %481, label %480

480:                                              ; preds = %471
  store i32 1, ptr %21, align 4, !tbaa !9
  br label %485

481:                                              ; preds = %471
  br label %482

482:                                              ; preds = %481
  %483 = load i64, ptr %20, align 8, !tbaa !11
  %484 = add i64 %483, 1
  store i64 %484, ptr %20, align 8, !tbaa !11
  br label %465, !llvm.loop !51

485:                                              ; preds = %480, %465
  %486 = load i32, ptr %21, align 4, !tbaa !9
  %487 = icmp eq i32 %486, 0
  br i1 %487, label %488, label %490

488:                                              ; preds = %485
  %489 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef %14, ptr noundef @.str, ptr noundef @.str.1)
  br label %490

490:                                              ; preds = %488, %485
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %491

491:                                              ; preds = %490, %458
  store i64 0, ptr %20, align 8, !tbaa !11
  br label %492

492:                                              ; preds = %555, %491
  %493 = load i64, ptr %20, align 8, !tbaa !11
  %494 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 11
  %495 = getelementptr inbounds %struct.LodePNG_IText, ptr %494, i32 0, i32 0
  %496 = load i64, ptr %495, align 8, !tbaa !52
  %497 = icmp ult i64 %493, %496
  br i1 %497, label %498, label %558

498:                                              ; preds = %492
  %499 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 11
  %500 = getelementptr inbounds %struct.LodePNG_IText, ptr %499, i32 0, i32 1
  %501 = load ptr, ptr %500, align 8, !tbaa !53
  %502 = load i64, ptr %20, align 8, !tbaa !11
  %503 = getelementptr inbounds ptr, ptr %501, i64 %502
  %504 = load ptr, ptr %503, align 8, !tbaa !5
  %505 = call i64 @strlen(ptr noundef %504) #9
  %506 = icmp ugt i64 %505, 79
  br i1 %506, label %507, label %510

507:                                              ; preds = %498
  %508 = load ptr, ptr %7, align 8, !tbaa !5
  %509 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %508, i32 0, i32 3
  store i32 66, ptr %509, align 8, !tbaa !13
  br label %558

510:                                              ; preds = %498
  %511 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 11
  %512 = getelementptr inbounds %struct.LodePNG_IText, ptr %511, i32 0, i32 1
  %513 = load ptr, ptr %512, align 8, !tbaa !53
  %514 = load i64, ptr %20, align 8, !tbaa !11
  %515 = getelementptr inbounds ptr, ptr %513, i64 %514
  %516 = load ptr, ptr %515, align 8, !tbaa !5
  %517 = call i64 @strlen(ptr noundef %516) #9
  %518 = icmp ult i64 %517, 1
  br i1 %518, label %519, label %522

519:                                              ; preds = %510
  %520 = load ptr, ptr %7, align 8, !tbaa !5
  %521 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %520, i32 0, i32 3
  store i32 67, ptr %521, align 8, !tbaa !13
  br label %558

522:                                              ; preds = %510
  %523 = load ptr, ptr %7, align 8, !tbaa !5
  %524 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %523, i32 0, i32 0
  %525 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %524, i32 0, i32 4
  %526 = load i32, ptr %525, align 8, !tbaa !46
  %527 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 11
  %528 = getelementptr inbounds %struct.LodePNG_IText, ptr %527, i32 0, i32 1
  %529 = load ptr, ptr %528, align 8, !tbaa !53
  %530 = load i64, ptr %20, align 8, !tbaa !11
  %531 = getelementptr inbounds ptr, ptr %529, i64 %530
  %532 = load ptr, ptr %531, align 8, !tbaa !5
  %533 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 11
  %534 = getelementptr inbounds %struct.LodePNG_IText, ptr %533, i32 0, i32 2
  %535 = load ptr, ptr %534, align 8, !tbaa !54
  %536 = load i64, ptr %20, align 8, !tbaa !11
  %537 = getelementptr inbounds ptr, ptr %535, i64 %536
  %538 = load ptr, ptr %537, align 8, !tbaa !5
  %539 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 11
  %540 = getelementptr inbounds %struct.LodePNG_IText, ptr %539, i32 0, i32 3
  %541 = load ptr, ptr %540, align 8, !tbaa !55
  %542 = load i64, ptr %20, align 8, !tbaa !11
  %543 = getelementptr inbounds ptr, ptr %541, i64 %542
  %544 = load ptr, ptr %543, align 8, !tbaa !5
  %545 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 11
  %546 = getelementptr inbounds %struct.LodePNG_IText, ptr %545, i32 0, i32 4
  %547 = load ptr, ptr %546, align 8, !tbaa !56
  %548 = load i64, ptr %20, align 8, !tbaa !11
  %549 = getelementptr inbounds ptr, ptr %547, i64 %548
  %550 = load ptr, ptr %549, align 8, !tbaa !5
  %551 = load ptr, ptr %7, align 8, !tbaa !5
  %552 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %551, i32 0, i32 0
  %553 = getelementptr inbounds %struct.LodePNG_EncodeSettings, ptr %552, i32 0, i32 0
  %554 = call noundef i32 @_ZL13addChunk_iTXtP8ucvectorjPKcS2_S2_S2_P25LodeZlib_CompressSettings(ptr noundef %14, i32 noundef %526, ptr noundef %532, ptr noundef %538, ptr noundef %544, ptr noundef %550, ptr noundef %553)
  br label %555

555:                                              ; preds = %522
  %556 = load i64, ptr %20, align 8, !tbaa !11
  %557 = add i64 %556, 1
  store i64 %557, ptr %20, align 8, !tbaa !11
  br label %492, !llvm.loop !57

558:                                              ; preds = %519, %507, %492
  %559 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %560 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %559, i32 0, i32 0
  %561 = getelementptr inbounds [3 x ptr], ptr %560, i64 0, i64 2
  %562 = load ptr, ptr %561, align 8, !tbaa !5
  %563 = icmp ne ptr %562, null
  br i1 %563, label %564, label %582

564:                                              ; preds = %558
  %565 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %566 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %565, i32 0, i32 0
  %567 = getelementptr inbounds [3 x ptr], ptr %566, i64 0, i64 2
  %568 = load ptr, ptr %567, align 8, !tbaa !5
  %569 = getelementptr inbounds %struct.LodePNG_InfoPng, ptr %13, i32 0, i32 18
  %570 = getelementptr inbounds %struct.LodePNG_UnknownChunks, ptr %569, i32 0, i32 1
  %571 = getelementptr inbounds [3 x i64], ptr %570, i64 0, i64 2
  %572 = load i64, ptr %571, align 8, !tbaa !11
  %573 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef %14, ptr noundef %568, i64 noundef %572)
  %574 = load ptr, ptr %7, align 8, !tbaa !5
  %575 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %574, i32 0, i32 3
  store i32 %573, ptr %575, align 8, !tbaa !13
  %576 = load ptr, ptr %7, align 8, !tbaa !5
  %577 = getelementptr inbounds %struct.LodePNG_Encoder, ptr %576, i32 0, i32 3
  %578 = load i32, ptr %577, align 8, !tbaa !13
  %579 = icmp ne i32 %578, 0
  br i1 %579, label %580, label %581

580:                                              ; preds = %564
  store i32 3, ptr %17, align 4
  br label %584

581:                                              ; preds = %564
  br label %582

582:                                              ; preds = %581, %558
  %583 = call noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef %14)
  store i32 3, ptr %17, align 4
  br label %584

584:                                              ; preds = %582, %580, %378, %363, %288, %256, %239
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %585

585:                                              ; preds = %584, %200
  %586 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %586) #7
  %587 = getelementptr inbounds %struct.ucvector, ptr %14, i32 0, i32 0
  %588 = load ptr, ptr %587, align 8, !tbaa !58
  %589 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %588, ptr %589, align 8, !tbaa !5
  %590 = getelementptr inbounds %struct.ucvector, ptr %14, i32 0, i32 1
  %591 = load i64, ptr %590, align 8, !tbaa !60
  %592 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %591, ptr %592, align 8, !tbaa !11
  store i32 0, ptr %17, align 4
  br label %593

593:                                              ; preds = %585, %193, %120, %104, %90, %81, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 224, ptr %13) #7
  %594 = load i32, ptr %17, align 4
  switch i32 %594, label %596 [
    i32 0, label %595
    i32 1, label %595
  ]

595:                                              ; preds = %593, %593
  ret void

596:                                              ; preds = %593
  unreachable
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; 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_P25LodeZlib_CompressSettings(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

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

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 = { nounwind "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 = { 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 #5 = { nounwind allocsize(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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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 296}
!14 = !{!"_ZTS15LodePNG_Encoder", !15, i64 0, !17, i64 32, !23, i64 256, !10, i64 296}
!15 = !{!"_ZTS22LodePNG_EncodeSettings", !16, i64 0, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24}
!16 = !{!"_ZTS25LodeZlib_CompressSettings", !10, i64 0, !10, i64 4, !10, i64 8}
!17 = !{!"_ZTS15LodePNG_InfoPng", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !18, i64 24, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !19, i64 80, !20, i64 104, !7, i64 144, !21, i64 148, !10, i64 160, !10, i64 164, !10, i64 168, !7, i64 172, !22, i64 176}
!18 = !{!"_ZTS17LodePNG_InfoColor", !10, i64 0, !10, i64 4, !6, i64 8, !12, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36}
!19 = !{!"_ZTS12LodePNG_Text", !12, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!"_ZTS13LodePNG_IText", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!21 = !{!"_ZTS12LodePNG_Time", !10, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8}
!22 = !{!"_ZTS21LodePNG_UnknownChunks", !7, i64 0, !7, i64 24}
!23 = !{!"_ZTS15LodePNG_InfoRaw", !18, i64 0}
!24 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 4, !9, i64 24, i64 4, !9, i64 28, i64 4, !9, i64 32, i64 8, !5, i64 40, i64 8, !11, i64 48, i64 4, !9, i64 52, i64 4, !9, i64 56, i64 4, !9, i64 60, i64 4, !9, i64 64, i64 4, !9, i64 68, i64 4, !9, i64 72, i64 4, !9, i64 76, i64 4, !9, i64 80, i64 8, !11, i64 88, i64 8, !5, i64 96, i64 8, !5, i64 104, i64 8, !11, i64 112, i64 8, !5, i64 120, i64 8, !5, i64 128, i64 8, !5, i64 136, i64 8, !5, i64 144, i64 1, !25, i64 148, i64 4, !9, i64 152, i64 1, !25, i64 153, i64 1, !25, i64 154, i64 1, !25, i64 155, i64 1, !25, i64 156, i64 1, !25, i64 160, i64 4, !9, i64 164, i64 4, !9, i64 168, i64 4, !9, i64 172, i64 1, !25, i64 176, i64 24, !25, i64 200, i64 24, !25}
!25 = !{!7, !7, i64 0}
!26 = !{!17, !10, i64 0}
!27 = !{!17, !10, i64 4}
!28 = !{!14, !10, i64 12}
!29 = !{!17, !10, i64 24}
!30 = !{!14, !10, i64 8}
!31 = !{!14, !10, i64 0}
!32 = !{!14, !10, i64 48}
!33 = !{!17, !10, i64 28}
!34 = !{!14, !10, i64 256}
!35 = !{!14, !10, i64 260}
!36 = !{!17, !10, i64 16}
!37 = !{!17, !12, i64 40}
!38 = !{!14, !10, i64 16}
!39 = !{!17, !6, i64 32}
!40 = !{!17, !10, i64 48}
!41 = !{!17, !10, i64 64}
!42 = !{!17, !10, i64 160}
!43 = !{!17, !7, i64 144}
!44 = !{!17, !12, i64 80}
!45 = !{!17, !6, i64 88}
!46 = !{!14, !10, i64 24}
!47 = !{!17, !6, i64 96}
!48 = distinct !{!48, !49}
!49 = !{!"llvm.loop.mustprogress"}
!50 = !{!14, !10, i64 20}
!51 = distinct !{!51, !49}
!52 = !{!17, !12, i64 104}
!53 = !{!17, !6, i64 112}
!54 = !{!17, !6, i64 120}
!55 = !{!17, !6, i64 128}
!56 = !{!17, !6, i64 136}
!57 = distinct !{!57, !49}
!58 = !{!59, !6, i64 0}
!59 = !{!"_ZTS8ucvector", !6, i64 0, !12, i64 8, !12, i64 16}
!60 = !{!59, !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.LodePNG_InfoPng = type { i32, i32, i32, i32, i32, %struct.LodePNG_InfoColor, i32, i32, i32, i32, %struct.LodePNG_Text, %struct.LodePNG_IText, i8, %struct.LodePNG_Time, i32, i32, i32, i8, %struct.LodePNG_UnknownChunks }
%struct.LodePNG_InfoColor = type { i32, i32, ptr, i64, i32, i32, i32, i32 }
%struct.LodePNG_Text = type { i64, ptr, ptr }
%struct.LodePNG_IText = type { i64, ptr, ptr, ptr, ptr }
%struct.LodePNG_Time = type { i32, i8, i8, i8, i8, i8 }
%struct.LodePNG_UnknownChunks = type { [3 x ptr], [3 x i64] }
%struct.ucvector = type { ptr, i64, i64 }

@.str = external hidden unnamed_addr constant [8 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 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 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 @_ZL13ucvector_initP8ucvector(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 willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z22LodePNG_Encoder_encodeP15LodePNG_EncoderPPhPmPKhjj(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, ptr noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #4 {
  %7 = alloca %struct.LodePNG_InfoPng, align 8
  %8 = alloca %struct.ucvector, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store i64 0, ptr %10, align 8, !tbaa !9
  store ptr null, ptr %1, align 8, !tbaa !5
  store i64 0, ptr %2, align 8, !tbaa !9
  %11 = getelementptr inbounds i8, ptr %0, i64 296
  store i32 0, ptr %11, align 8, !tbaa !11
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(224) %7, ptr noundef nonnull align 8 dereferenceable(224) %12, i64 224, i1 false), !tbaa.struct !23
  store i32 %4, ptr %7, align 8, !tbaa !26
  %13 = getelementptr inbounds i8, ptr %7, i64 4
  store i32 %5, ptr %13, align 4, !tbaa !27
  %14 = getelementptr inbounds i8, ptr %0, i64 12
  %15 = load i32, ptr %14, align 4, !tbaa !28
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %23, label %16

16:                                               ; preds = %6
  %17 = getelementptr inbounds i8, ptr %0, i64 256
  %18 = tail call noundef i32 @_ZL13isFullyOpaquePKhjjPK17LodePNG_InfoColor(ptr noundef %3, i32 noundef %4, i32 noundef %5, ptr noundef nonnull %17)
  %.not123 = icmp eq i32 %18, 0
  br i1 %.not123, label %23, label %19

19:                                               ; preds = %16
  %20 = getelementptr inbounds i8, ptr %7, i64 24
  %21 = load i32, ptr %20, align 8, !tbaa !29
  switch i32 %21, label %23 [
    i32 6, label %.sink.split
    i32 4, label %22
  ]

22:                                               ; preds = %19
  br label %.sink.split

.sink.split:                                      ; preds = %19, %22
  %.sink = phi i32 [ 0, %22 ], [ 2, %19 ]
  store i32 %.sink, ptr %20, align 8, !tbaa !29
  br label %23

23:                                               ; preds = %.sink.split, %19, %16, %6
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = load i32, ptr %24, align 8, !tbaa !30
  %26 = icmp ugt i32 %25, 32768
  br i1 %26, label %27, label %28

27:                                               ; preds = %23
  store i32 60, ptr %11, align 8, !tbaa !11
  br label %244

28:                                               ; preds = %23
  %29 = load i32, ptr %0, align 8, !tbaa !31
  %30 = icmp ugt i32 %29, 2
  br i1 %30, label %31, label %32

31:                                               ; preds = %28
  store i32 61, ptr %11, align 8, !tbaa !11
  br label %244

32:                                               ; preds = %28
  %33 = getelementptr inbounds i8, ptr %0, i64 48
  %34 = load i32, ptr %33, align 8, !tbaa !32
  %35 = icmp ugt i32 %34, 1
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  store i32 71, ptr %11, align 8, !tbaa !11
  br label %244

37:                                               ; preds = %32
  %38 = getelementptr inbounds i8, ptr %7, i64 24
  %39 = load i32, ptr %38, align 8, !tbaa !29
  %40 = getelementptr inbounds i8, ptr %7, i64 28
  %41 = load i32, ptr %40, align 4, !tbaa !33
  %42 = tail call noundef i32 @_ZL18checkColorValidityjj(i32 noundef %39, i32 noundef %41)
  store i32 %42, ptr %11, align 8, !tbaa !11
  %.not124 = icmp eq i32 %42, 0
  br i1 %.not124, label %43, label %244

43:                                               ; preds = %37
  %44 = getelementptr inbounds i8, ptr %0, i64 256
  %45 = load i32, ptr %44, align 8, !tbaa !34
  %46 = getelementptr inbounds i8, ptr %0, i64 260
  %47 = load i32, ptr %46, align 4, !tbaa !35
  %48 = tail call noundef i32 @_ZL18checkColorValidityjj(i32 noundef %45, i32 noundef %47)
  store i32 %48, ptr %11, align 8, !tbaa !11
  %.not125 = icmp eq i32 %48, 0
  br i1 %.not125, label %49, label %244

49:                                               ; preds = %43
  %50 = call noundef i32 @_Z23LodePNG_InfoColor_equalPK17LodePNG_InfoColorS1_(ptr noundef nonnull %44, ptr noundef nonnull %38)
  %.not126 = icmp eq i32 %50, 0
  br i1 %.not126, label %51, label %72

51:                                               ; preds = %49
  %52 = call noundef i32 @_Z24LodePNG_InfoColor_getBppPK17LodePNG_InfoColor(ptr noundef nonnull %38)
  %53 = load i32, ptr %38, align 8
  %54 = and i32 %53, -5
  %or.cond = icmp eq i32 %54, 2
  %55 = load i32, ptr %40, align 4
  %56 = icmp eq i32 %55, 8
  %or.cond7.not = select i1 %or.cond, i1 %56, i1 false
  br i1 %or.cond7.not, label %57, label %71

57:                                               ; preds = %51
  %58 = mul i32 %5, %4
  %59 = mul i32 %58, %52
  %60 = add i32 %59, 7
  %61 = lshr i32 %60, 3
  %62 = zext nneg i32 %61 to i64
  %63 = call noalias ptr @malloc(i64 noundef %62) #8
  %64 = icmp eq ptr %63, null
  %65 = icmp ugt i32 %60, 7
  %or.cond9 = and i1 %65, %64
  br i1 %or.cond9, label %.thread, label %66

.thread:                                          ; preds = %57
  store i32 9955, ptr %11, align 8, !tbaa !11
  br label %.thread150

66:                                               ; preds = %57
  %.pr = load i32, ptr %11, align 8, !tbaa !11
  %.not127 = icmp eq i32 %.pr, 0
  br i1 %.not127, label %67, label %.thread150

67:                                               ; preds = %66
  %68 = call noundef i32 @_Z15LodePNG_convertPhPKhP17LodePNG_InfoColorS3_jj(ptr noundef %63, ptr noundef %3, ptr noundef nonnull %38, ptr noundef nonnull %44, i32 noundef %4, i32 noundef %5)
  store i32 %68, ptr %11, align 8, !tbaa !11
  %.not128 = icmp eq i32 %68, 0
  br i1 %.not128, label %69, label %.thread150

69:                                               ; preds = %67
  %70 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhPK15LodePNG_InfoPng(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %63, ptr noundef nonnull %7)
  br label %.thread150

.thread150:                                       ; preds = %67, %69, %.thread, %66
  call void @free(ptr noundef %63) #7
  br label %74

71:                                               ; preds = %51
  store i32 59, ptr %11, align 8, !tbaa !11
  br label %244

72:                                               ; preds = %49
  %73 = call noundef i32 @_ZL19preProcessScanlinesPPhPmPKhPK15LodePNG_InfoPng(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef %3, ptr noundef nonnull %7)
  br label %74

74:                                               ; preds = %.thread150, %72
  call void @_ZL13ucvector_initP8ucvector(ptr noundef nonnull %8)
  %75 = load i32, ptr %11, align 8, !tbaa !11
  %.not130 = icmp eq i32 %75, 0
  br i1 %.not130, label %76, label %239

76:                                               ; preds = %74
  call void @_ZL14writeSignatureP8ucvector(ptr noundef nonnull %8)
  %77 = load i32, ptr %40, align 4, !tbaa !33
  %78 = load i32, ptr %38, align 8, !tbaa !29
  %79 = getelementptr inbounds i8, ptr %7, i64 16
  %80 = load i32, ptr %79, align 8, !tbaa !36
  %81 = call noundef i32 @_ZL13addChunk_IHDRP8ucvectorjjjjj(ptr noundef nonnull %8, i32 noundef %4, i32 noundef %5, i32 noundef %77, i32 noundef %78, i32 noundef %80)
  %82 = getelementptr inbounds i8, ptr %7, i64 176
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  %.not131 = icmp eq ptr %83, null
  br i1 %.not131, label %88, label %84

84:                                               ; preds = %76
  %85 = getelementptr inbounds i8, ptr %7, i64 200
  %86 = load i64, ptr %85, align 8, !tbaa !9
  %87 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %8, ptr noundef nonnull %83, i64 noundef %86)
  store i32 %87, ptr %11, align 8, !tbaa !11
  %.not132 = icmp eq i32 %87, 0
  br i1 %.not132, label %88, label %239

88:                                               ; preds = %84, %76
  %89 = load i32, ptr %38, align 8
  %90 = icmp eq i32 %89, 3
  br i1 %90, label %91, label %98

91:                                               ; preds = %88
  %92 = getelementptr inbounds i8, ptr %7, i64 40
  %93 = load i64, ptr %92, align 8
  %94 = add i64 %93, -257
  %or.cond13 = icmp ult i64 %94, -256
  br i1 %or.cond13, label %95, label %96

95:                                               ; preds = %91
  store i32 68, ptr %11, align 8, !tbaa !11
  br label %239

96:                                               ; preds = %91
  %97 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK17LodePNG_InfoColor(ptr noundef nonnull %8, ptr noundef nonnull %38)
  %.pr152.pre168.pre = load i32, ptr %38, align 8
  br label %98

98:                                               ; preds = %96, %88
  %.pr152.pre168 = phi i32 [ %.pr152.pre168.pre, %96 ], [ %89, %88 ]
  %99 = getelementptr inbounds i8, ptr %0, i64 16
  %100 = load i32, ptr %99, align 8, !tbaa !37
  %.not133 = icmp ne i32 %100, 0
  %101 = and i32 %.pr152.pre168, -5
  %or.cond17 = icmp eq i32 %101, 2
  %or.cond176 = select i1 %.not133, i1 %or.cond17, i1 false
  br i1 %or.cond176, label %102, label %thread-pre-split151

102:                                              ; preds = %98
  %103 = getelementptr inbounds i8, ptr %7, i64 40
  %104 = load i64, ptr %103, align 8
  %105 = add i64 %104, -257
  %or.cond21 = icmp ult i64 %105, -256
  br i1 %or.cond21, label %106, label %107

106:                                              ; preds = %102
  store i32 68, ptr %11, align 8, !tbaa !11
  br label %239

107:                                              ; preds = %102
  %108 = call noundef i32 @_ZL13addChunk_PLTEP8ucvectorPK17LodePNG_InfoColor(ptr noundef nonnull %8, ptr noundef nonnull %38)
  %.pr152.pre = load i32, ptr %38, align 8, !tbaa !29
  br label %thread-pre-split151

thread-pre-split151:                              ; preds = %107, %98
  %109 = phi i32 [ %.pr152.pre168, %98 ], [ %.pr152.pre, %107 ]
  %110 = icmp eq i32 %109, 3
  br i1 %110, label %111, label %119

111:                                              ; preds = %thread-pre-split151
  %112 = getelementptr inbounds i8, ptr %7, i64 32
  %113 = load ptr, ptr %112, align 8, !tbaa !38
  %114 = getelementptr inbounds i8, ptr %7, i64 40
  %115 = load i64, ptr %114, align 8, !tbaa !39
  %116 = call noundef i32 @_ZL20isPaletteFullyOpaquePKhm(ptr noundef %113, i64 noundef %115)
  %.not134 = icmp eq i32 %116, 0
  br i1 %.not134, label %117, label %119

117:                                              ; preds = %111
  %118 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK17LodePNG_InfoColor(ptr noundef nonnull %8, ptr noundef nonnull %38)
  br label %119

119:                                              ; preds = %117, %111, %thread-pre-split151
  %120 = load i32, ptr %38, align 8
  %121 = and i32 %120, -3
  %or.cond25 = icmp eq i32 %121, 0
  %122 = getelementptr inbounds i8, ptr %7, i64 48
  %123 = load i32, ptr %122, align 8
  %124 = icmp ne i32 %123, 0
  %or.cond29 = select i1 %or.cond25, i1 %124, i1 false
  br i1 %or.cond29, label %125, label %127

125:                                              ; preds = %119
  %126 = call noundef i32 @_ZL13addChunk_tRNSP8ucvectorPK17LodePNG_InfoColor(ptr noundef nonnull %8, ptr noundef nonnull %38)
  br label %127

127:                                              ; preds = %119, %125
  %128 = getelementptr inbounds i8, ptr %7, i64 64
  %129 = load i32, ptr %128, align 8, !tbaa !40
  %.not135 = icmp eq i32 %129, 0
  br i1 %.not135, label %132, label %130

130:                                              ; preds = %127
  %131 = call noundef i32 @_ZL13addChunk_bKGDP8ucvectorPK15LodePNG_InfoPng(ptr noundef nonnull %8, ptr noundef nonnull %7)
  br label %132

132:                                              ; preds = %130, %127
  %133 = getelementptr inbounds i8, ptr %7, i64 160
  %134 = load i32, ptr %133, align 8, !tbaa !41
  %.not136 = icmp eq i32 %134, 0
  br i1 %.not136, label %137, label %135

135:                                              ; preds = %132
  %136 = call noundef i32 @_ZL13addChunk_pHYsP8ucvectorPK15LodePNG_InfoPng(ptr noundef nonnull %8, ptr noundef nonnull %7)
  br label %137

137:                                              ; preds = %135, %132
  %138 = getelementptr inbounds i8, ptr %7, i64 184
  %139 = load ptr, ptr %138, align 8, !tbaa !5
  %.not137 = icmp eq ptr %139, null
  br i1 %.not137, label %144, label %140

140:                                              ; preds = %137
  %141 = getelementptr inbounds i8, ptr %7, i64 208
  %142 = load i64, ptr %141, align 8, !tbaa !9
  %143 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %8, ptr noundef nonnull %139, i64 noundef %142)
  store i32 %143, ptr %11, align 8, !tbaa !11
  %.not138 = icmp eq i32 %143, 0
  br i1 %.not138, label %144, label %239

144:                                              ; preds = %140, %137
  %145 = load ptr, ptr %9, align 8, !tbaa !5
  %146 = load i64, ptr %10, align 8, !tbaa !9
  %147 = call noundef i32 @_ZL13addChunk_IDATP8ucvectorPKhmP25LodeZlib_CompressSettings(ptr noundef nonnull %8, ptr noundef %145, i64 noundef %146, ptr noundef nonnull %0)
  store i32 %147, ptr %11, align 8, !tbaa !11
  %.not139 = icmp eq i32 %147, 0
  br i1 %.not139, label %148, label %239

148:                                              ; preds = %144
  %149 = getelementptr inbounds i8, ptr %7, i64 144
  %150 = load i8, ptr %149, align 8, !tbaa !42
  %.not140 = icmp eq i8 %150, 0
  br i1 %.not140, label %154, label %151

151:                                              ; preds = %148
  %152 = getelementptr inbounds i8, ptr %7, i64 148
  %153 = call noundef i32 @_ZL13addChunk_tIMEP8ucvectorPK12LodePNG_Time(ptr noundef nonnull %8, ptr noundef nonnull %152)
  br label %154

154:                                              ; preds = %151, %148
  %155 = getelementptr inbounds i8, ptr %7, i64 80
  %156 = load i64, ptr %155, align 8, !tbaa !43
  %.not163 = icmp eq i64 %156, 0
  br i1 %.not163, label %.loopexit154.thread, label %.lr.ph

.lr.ph:                                           ; preds = %154
  %157 = getelementptr inbounds i8, ptr %7, i64 88
  %158 = getelementptr inbounds i8, ptr %0, i64 24
  %159 = getelementptr inbounds i8, ptr %7, i64 96
  %160 = load ptr, ptr %157, align 8, !tbaa !44
  %161 = load ptr, ptr %160, align 8, !tbaa !5
  %162 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %161) #9
  %163 = icmp ugt i64 %162, 79
  br i1 %163, label %.loopexit154.sink.split, label %.lr.ph182

164:                                              ; preds = %183
  %165 = load ptr, ptr %157, align 8, !tbaa !44
  %166 = getelementptr inbounds ptr, ptr %165, i64 %184
  %167 = load ptr, ptr %166, align 8, !tbaa !5
  %168 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %167) #9
  %169 = icmp ugt i64 %168, 79
  br i1 %169, label %.loopexit154.sink.split, label %.lr.ph182, !llvm.loop !45

.lr.ph182:                                        ; preds = %.lr.ph, %164
  %170 = phi i64 [ %168, %164 ], [ %162, %.lr.ph ]
  %171 = phi ptr [ %167, %164 ], [ %161, %.lr.ph ]
  %.0115157181 = phi i64 [ %184, %164 ], [ 0, %.lr.ph ]
  %172 = phi i64 [ %185, %164 ], [ %156, %.lr.ph ]
  %173 = icmp eq i64 %170, 0
  br i1 %173, label %.loopexit154.sink.split, label %174

174:                                              ; preds = %.lr.ph182
  %175 = load i32, ptr %158, align 8, !tbaa !47
  %.not141 = icmp eq i32 %175, 0
  %176 = load ptr, ptr %159, align 8, !tbaa !48
  %177 = getelementptr inbounds ptr, ptr %176, i64 %.0115157181
  %178 = load ptr, ptr %177, align 8, !tbaa !5
  br i1 %.not141, label %181, label %179

179:                                              ; preds = %174
  %180 = call noundef i32 @_ZL13addChunk_zTXtP8ucvectorPKcS2_P25LodeZlib_CompressSettings(ptr noundef nonnull %8, ptr noundef %171, ptr noundef %178, ptr noundef nonnull %0)
  br label %183

181:                                              ; preds = %174
  %182 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef nonnull %8, ptr noundef %171, ptr noundef %178)
  br label %183

183:                                              ; preds = %179, %181
  %184 = add nuw i64 %.0115157181, 1
  %185 = load i64, ptr %155, align 8, !tbaa !43
  %186 = icmp ult i64 %184, %185
  br i1 %186, label %164, label %.loopexit154, !llvm.loop !45

.loopexit154.sink.split:                          ; preds = %164, %.lr.ph182, %.lr.ph
  %.lcssa = phi i64 [ %156, %.lr.ph ], [ %185, %164 ], [ %172, %.lr.ph182 ]
  %.sink177 = phi i32 [ 66, %.lr.ph ], [ 66, %164 ], [ 67, %.lr.ph182 ]
  store i32 %.sink177, ptr %11, align 8, !tbaa !11
  br label %.loopexit154

.loopexit154:                                     ; preds = %183, %.loopexit154.sink.split
  %187 = phi i64 [ %.lcssa, %.loopexit154.sink.split ], [ %185, %183 ]
  %188 = getelementptr inbounds i8, ptr %0, i64 20
  %189 = load i32, ptr %188, align 4, !tbaa !49
  %.not142 = icmp eq i32 %189, 0
  br i1 %.not142, label %.loopexit153, label %.preheader

.loopexit154.thread:                              ; preds = %154
  %190 = getelementptr inbounds i8, ptr %0, i64 20
  %191 = load i32, ptr %190, align 4, !tbaa !49
  %.not142171 = icmp eq i32 %191, 0
  br i1 %.not142171, label %.loopexit153, label %.critedge

.preheader:                                       ; preds = %.loopexit154
  %.not144158.not = icmp eq i64 %187, 0
  br i1 %.not144158.not, label %.critedge, label %.lr.ph160

.lr.ph160:                                        ; preds = %.preheader
  %192 = getelementptr inbounds i8, ptr %7, i64 88
  %193 = load ptr, ptr %192, align 8, !tbaa !44
  br label %196

194:                                              ; preds = %196
  %195 = add nuw i64 %.1159, 1
  %exitcond.not = icmp eq i64 %195, %187
  br i1 %exitcond.not, label %.critedge, label %196, !llvm.loop !50

196:                                              ; preds = %.lr.ph160, %194
  %.1159 = phi i64 [ 0, %.lr.ph160 ], [ %195, %194 ]
  %197 = getelementptr inbounds ptr, ptr %193, i64 %.1159
  %198 = load ptr, ptr %197, align 8, !tbaa !5
  %199 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %198, ptr noundef nonnull dereferenceable(1) @.str) #9
  %.not143 = icmp eq i32 %199, 0
  br i1 %.not143, label %.loopexit153, label %194

.critedge:                                        ; preds = %194, %.loopexit154.thread, %.preheader
  %200 = call noundef i32 @_ZL13addChunk_tEXtP8ucvectorPKcS2_(ptr noundef nonnull %8, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  br label %.loopexit153

.loopexit153:                                     ; preds = %196, %.loopexit154.thread, %.critedge, %.loopexit154
  %201 = getelementptr inbounds i8, ptr %7, i64 104
  %202 = load i64, ptr %201, align 8, !tbaa !51
  %.not164 = icmp eq i64 %202, 0
  br i1 %.not164, label %.loopexit, label %.lr.ph162

.lr.ph162:                                        ; preds = %.loopexit153
  %203 = getelementptr inbounds i8, ptr %7, i64 112
  %204 = getelementptr inbounds i8, ptr %0, i64 24
  %205 = getelementptr inbounds i8, ptr %7, i64 120
  %206 = getelementptr inbounds i8, ptr %7, i64 128
  %207 = getelementptr inbounds i8, ptr %7, i64 136
  br label %208

208:                                              ; preds = %.lr.ph162, %216
  %.2161 = phi i64 [ 0, %.lr.ph162 ], [ %228, %216 ]
  %209 = load ptr, ptr %203, align 8, !tbaa !52
  %210 = getelementptr inbounds ptr, ptr %209, i64 %.2161
  %211 = load ptr, ptr %210, align 8, !tbaa !5
  %212 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %211) #9
  %213 = icmp ugt i64 %212, 79
  br i1 %213, label %.loopexit.sink.split, label %214

214:                                              ; preds = %208
  %215 = icmp eq i64 %212, 0
  br i1 %215, label %.loopexit.sink.split, label %216

216:                                              ; preds = %214
  %217 = load i32, ptr %204, align 8, !tbaa !47
  %218 = load ptr, ptr %205, align 8, !tbaa !53
  %219 = getelementptr inbounds ptr, ptr %218, i64 %.2161
  %220 = load ptr, ptr %219, align 8, !tbaa !5
  %221 = load ptr, ptr %206, align 8, !tbaa !54
  %222 = getelementptr inbounds ptr, ptr %221, i64 %.2161
  %223 = load ptr, ptr %222, align 8, !tbaa !5
  %224 = load ptr, ptr %207, align 8, !tbaa !55
  %225 = getelementptr inbounds ptr, ptr %224, i64 %.2161
  %226 = load ptr, ptr %225, align 8, !tbaa !5
  %227 = call noundef i32 @_ZL13addChunk_iTXtP8ucvectorjPKcS2_S2_S2_P25LodeZlib_CompressSettings(ptr noundef nonnull %8, i32 noundef %217, ptr noundef %211, ptr noundef %220, ptr noundef %223, ptr noundef %226, ptr noundef nonnull %0)
  %228 = add nuw i64 %.2161, 1
  %229 = load i64, ptr %201, align 8, !tbaa !51
  %230 = icmp ult i64 %228, %229
  br i1 %230, label %208, label %.loopexit, !llvm.loop !56

.loopexit.sink.split:                             ; preds = %214, %208
  %.sink178 = phi i32 [ 66, %208 ], [ 67, %214 ]
  store i32 %.sink178, ptr %11, align 8, !tbaa !11
  br label %.loopexit

.loopexit:                                        ; preds = %216, %.loopexit.sink.split, %.loopexit153
  %231 = getelementptr inbounds i8, ptr %7, i64 192
  %232 = load ptr, ptr %231, align 8, !tbaa !5
  %.not145 = icmp eq ptr %232, null
  br i1 %.not145, label %237, label %233

233:                                              ; preds = %.loopexit
  %234 = getelementptr inbounds i8, ptr %7, i64 216
  %235 = load i64, ptr %234, align 8, !tbaa !9
  %236 = call noundef i32 @_ZL16addUnknownChunksP8ucvectorPhm(ptr noundef nonnull %8, ptr noundef nonnull %232, i64 noundef %235)
  store i32 %236, ptr %11, align 8, !tbaa !11
  %.not146 = icmp eq i32 %236, 0
  br i1 %.not146, label %237, label %239

237:                                              ; preds = %233, %.loopexit
  %238 = call noundef i32 @_ZL13addChunk_IENDP8ucvector(ptr noundef nonnull %8)
  br label %239

239:                                              ; preds = %95, %106, %237, %84, %140, %144, %233, %74
  %240 = load ptr, ptr %9, align 8, !tbaa !5
  call void @free(ptr noundef %240) #7
  %241 = load ptr, ptr %8, align 8, !tbaa !57
  store ptr %241, ptr %1, align 8, !tbaa !5
  %242 = getelementptr inbounds i8, ptr %8, i64 8
  %243 = load i64, ptr %242, align 8, !tbaa !59
  store i64 %243, ptr %2, align 8, !tbaa !9
  br label %244

244:                                              ; preds = %71, %43, %37, %239, %36, %31, %27
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %7) #7
  ret void
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

; 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_P25LodeZlib_CompressSettings(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

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

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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #5 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { 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 296}
!12 = !{!"_ZTS15LodePNG_Encoder", !13, i64 0, !16, i64 32, !22, i64 256, !15, i64 296}
!13 = !{!"_ZTS22LodePNG_EncodeSettings", !14, i64 0, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24}
!14 = !{!"_ZTS25LodeZlib_CompressSettings", !15, i64 0, !15, i64 4, !15, i64 8}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTS15LodePNG_InfoPng", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !17, i64 24, !15, i64 64, !15, i64 68, !15, i64 72, !15, i64 76, !18, i64 80, !19, i64 104, !7, i64 144, !20, i64 148, !15, i64 160, !15, i64 164, !15, i64 168, !7, i64 172, !21, i64 176}
!17 = !{!"_ZTS17LodePNG_InfoColor", !15, i64 0, !15, i64 4, !6, i64 8, !10, i64 16, !15, i64 24, !15, i64 28, !15, i64 32, !15, i64 36}
!18 = !{!"_ZTS12LodePNG_Text", !10, i64 0, !6, i64 8, !6, i64 16}
!19 = !{!"_ZTS13LodePNG_IText", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!20 = !{!"_ZTS12LodePNG_Time", !15, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8}
!21 = !{!"_ZTS21LodePNG_UnknownChunks", !7, i64 0, !7, i64 24}
!22 = !{!"_ZTS15LodePNG_InfoRaw", !17, i64 0}
!23 = !{i64 0, i64 4, !24, i64 4, i64 4, !24, i64 8, i64 4, !24, i64 12, i64 4, !24, i64 16, i64 4, !24, i64 24, i64 4, !24, i64 28, i64 4, !24, i64 32, i64 8, !5, i64 40, i64 8, !9, i64 48, i64 4, !24, i64 52, i64 4, !24, i64 56, i64 4, !24, i64 60, i64 4, !24, i64 64, i64 4, !24, i64 68, i64 4, !24, i64 72, i64 4, !24, i64 76, i64 4, !24, i64 80, i64 8, !9, i64 88, i64 8, !5, i64 96, i64 8, !5, i64 104, i64 8, !9, i64 112, i64 8, !5, i64 120, i64 8, !5, i64 128, i64 8, !5, i64 136, i64 8, !5, i64 144, i64 1, !25, i64 148, i64 4, !24, i64 152, i64 1, !25, i64 153, i64 1, !25, i64 154, i64 1, !25, i64 155, i64 1, !25, i64 156, i64 1, !25, i64 160, i64 4, !24, i64 164, i64 4, !24, i64 168, i64 4, !24, i64 172, i64 1, !25, i64 176, i64 24, !25, i64 200, i64 24, !25}
!24 = !{!15, !15, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!16, !15, i64 0}
!27 = !{!16, !15, i64 4}
!28 = !{!12, !15, i64 12}
!29 = !{!16, !15, i64 24}
!30 = !{!12, !15, i64 8}
!31 = !{!12, !15, i64 0}
!32 = !{!12, !15, i64 48}
!33 = !{!16, !15, i64 28}
!34 = !{!12, !15, i64 256}
!35 = !{!12, !15, i64 260}
!36 = !{!16, !15, i64 16}
!37 = !{!12, !15, i64 16}
!38 = !{!16, !6, i64 32}
!39 = !{!16, !10, i64 40}
!40 = !{!16, !15, i64 64}
!41 = !{!16, !15, i64 160}
!42 = !{!16, !7, i64 144}
!43 = !{!16, !10, i64 80}
!44 = !{!16, !6, i64 88}
!45 = distinct !{!45, !46}
!46 = !{!"llvm.loop.mustprogress"}
!47 = !{!12, !15, i64 24}
!48 = !{!16, !6, i64 96}
!49 = !{!12, !15, i64 20}
!50 = distinct !{!50, !46}
!51 = !{!16, !10, i64 104}
!52 = !{!16, !6, i64 112}
!53 = !{!16, !6, i64 120}
!54 = !{!16, !6, i64 128}
!55 = !{!16, !6, i64 136}
!56 = distinct !{!56, !46}
!57 = !{!58, !6, i64 0}
!58 = !{!"_ZTS8ucvector", !6, i64 0, !10, i64 8, !10, i64 16}
!59 = !{!58, !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,TailCallElimPass