; LLVM IR from niessner/Matterport :: code/gaps/pkgs/png (pngwutil)

; 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.png_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i32, i32, ptr, i16, i16, [5 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, float, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, float, float, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, i8, i16, i16, i16, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, %struct.png_unknown_chunk_t, i32, i32, ptr, i32 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_row_info_struct = type { i32, i64, i8, i8, i8, i8 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }

@__const.png_write_finish_row.png_pass_start = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_finish_row.png_pass_inc = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_finish_row.png_pass_ystart = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_finish_row.png_pass_yinc = external hidden unnamed_addr constant [7 x i32], align 16
@.str.45 = external hidden unnamed_addr constant [11 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

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

declare void @png_error(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @png_write_IDAT(ptr noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @png_write_finish_row(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca [7 x i32], align 16
  %4 = alloca [7 x i32], align 16
  %5 = alloca [7 x i32], align 16
  %6 = alloca [7 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %3) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.png_write_finish_row.png_pass_start, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr %4) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.png_write_finish_row.png_pass_inc, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr %5) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const.png_write_finish_row.png_pass_ystart, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr %6) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.png_write_finish_row.png_pass_yinc, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.png_struct_def, ptr %9, i32 0, i32 31
  %11 = load i32, ptr %10, align 4, !tbaa !9
  %12 = add i32 %11, 1
  store i32 %12, ptr %10, align 4, !tbaa !9
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.png_struct_def, ptr %13, i32 0, i32 31
  %15 = load i32, ptr %14, align 4, !tbaa !9
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.png_struct_def, ptr %16, i32 0, i32 26
  %18 = load i32, ptr %17, align 4, !tbaa !20
  %19 = icmp ult i32 %15, %18
  br i1 %19, label %20, label %21

20:                                               ; preds = %1
  store i32 1, ptr %8, align 4
  br label %280

21:                                               ; preds = %1
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.png_struct_def, ptr %22, i32 0, i32 47
  %24 = load i8, ptr %23, align 1, !tbaa !21
  %25 = icmp ne i8 %24, 0
  br i1 %25, label %26, label %191

26:                                               ; preds = %21
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 31
  store i32 0, ptr %28, align 4, !tbaa !9
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.png_struct_def, ptr %29, i32 0, i32 15
  %31 = load i32, ptr %30, align 4, !tbaa !22
  %32 = and i32 %31, 2
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %39

34:                                               ; preds = %26
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_struct_def, ptr %35, i32 0, i32 48
  %37 = load i8, ptr %36, align 4, !tbaa !23
  %38 = add i8 %37, 1
  store i8 %38, ptr %36, align 4, !tbaa !23
  br label %126

39:                                               ; preds = %26
  br label %40

40:                                               ; preds = %123, %39
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 48
  %43 = load i8, ptr %42, align 4, !tbaa !23
  %44 = add i8 %43, 1
  store i8 %44, ptr %42, align 4, !tbaa !23
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.png_struct_def, ptr %45, i32 0, i32 48
  %47 = load i8, ptr %46, align 4, !tbaa !23
  %48 = zext i8 %47 to i32
  %49 = icmp sge i32 %48, 7
  br i1 %49, label %50, label %51

50:                                               ; preds = %40
  br label %125

51:                                               ; preds = %40
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_struct_def, ptr %52, i32 0, i32 24
  %54 = load i32, ptr %53, align 4, !tbaa !24
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.png_struct_def, ptr %55, i32 0, i32 48
  %57 = load i8, ptr %56, align 4, !tbaa !23
  %58 = zext i8 %57 to i64
  %59 = getelementptr inbounds [7 x i32], ptr %4, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !25
  %61 = add i32 %54, %60
  %62 = sub i32 %61, 1
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.png_struct_def, ptr %63, i32 0, i32 48
  %65 = load i8, ptr %64, align 4, !tbaa !23
  %66 = zext i8 %65 to i64
  %67 = getelementptr inbounds [7 x i32], ptr %3, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !25
  %69 = sub i32 %62, %68
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.png_struct_def, ptr %70, i32 0, i32 48
  %72 = load i8, ptr %71, align 4, !tbaa !23
  %73 = zext i8 %72 to i64
  %74 = getelementptr inbounds [7 x i32], ptr %4, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !25
  %76 = udiv i32 %69, %75
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.png_struct_def, ptr %77, i32 0, i32 27
  store i32 %76, ptr %78, align 8, !tbaa !26
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.png_struct_def, ptr %79, i32 0, i32 25
  %81 = load i32, ptr %80, align 8, !tbaa !27
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.png_struct_def, ptr %82, i32 0, i32 48
  %84 = load i8, ptr %83, align 4, !tbaa !23
  %85 = zext i8 %84 to i64
  %86 = getelementptr inbounds [7 x i32], ptr %6, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !25
  %88 = add i32 %81, %87
  %89 = sub i32 %88, 1
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.png_struct_def, ptr %90, i32 0, i32 48
  %92 = load i8, ptr %91, align 4, !tbaa !23
  %93 = zext i8 %92 to i64
  %94 = getelementptr inbounds [7 x i32], ptr %5, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !25
  %96 = sub i32 %89, %95
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 48
  %99 = load i8, ptr %98, align 4, !tbaa !23
  %100 = zext i8 %99 to i64
  %101 = getelementptr inbounds [7 x i32], ptr %6, i64 0, i64 %100
  %102 = load i32, ptr %101, align 4, !tbaa !25
  %103 = udiv i32 %96, %102
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.png_struct_def, ptr %104, i32 0, i32 26
  store i32 %103, ptr %105, align 4, !tbaa !20
  %106 = load ptr, ptr %2, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_struct_def, ptr %106, i32 0, i32 15
  %108 = load i32, ptr %107, align 4, !tbaa !22
  %109 = and i32 %108, 2
  %110 = icmp ne i32 %109, 0
  br i1 %110, label %111, label %112

111:                                              ; preds = %51
  br label %125

112:                                              ; preds = %51
  br label %113

113:                                              ; preds = %112
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.png_struct_def, ptr %114, i32 0, i32 27
  %116 = load i32, ptr %115, align 8, !tbaa !26
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %123, label %118

118:                                              ; preds = %113
  %119 = load ptr, ptr %2, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_struct_def, ptr %119, i32 0, i32 26
  %121 = load i32, ptr %120, align 4, !tbaa !20
  %122 = icmp eq i32 %121, 0
  br label %123

123:                                              ; preds = %118, %113
  %124 = phi i1 [ true, %113 ], [ %122, %118 ]
  br i1 %124, label %40, label %125, !llvm.loop !28

125:                                              ; preds = %123, %111, %50
  br label %126

126:                                              ; preds = %125, %34
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.png_struct_def, ptr %127, i32 0, i32 48
  %129 = load i8, ptr %128, align 4, !tbaa !23
  %130 = zext i8 %129 to i32
  %131 = icmp slt i32 %130, 7
  br i1 %131, label %132, label %190

132:                                              ; preds = %126
  %133 = load ptr, ptr %2, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.png_struct_def, ptr %133, i32 0, i32 32
  %135 = load ptr, ptr %134, align 8, !tbaa !30
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %189

137:                                              ; preds = %132
  %138 = load ptr, ptr %2, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.png_struct_def, ptr %138, i32 0, i32 32
  %140 = load ptr, ptr %139, align 8, !tbaa !30
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.png_struct_def, ptr %141, i32 0, i32 55
  %143 = load i8, ptr %142, align 1, !tbaa !31
  %144 = zext i8 %143 to i32
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.png_struct_def, ptr %145, i32 0, i32 52
  %147 = load i8, ptr %146, align 8, !tbaa !32
  %148 = zext i8 %147 to i32
  %149 = mul nsw i32 %144, %148
  %150 = icmp sge i32 %149, 8
  br i1 %150, label %151, label %168

151:                                              ; preds = %137
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.png_struct_def, ptr %152, i32 0, i32 24
  %154 = load i32, ptr %153, align 4, !tbaa !24
  %155 = zext i32 %154 to i64
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.png_struct_def, ptr %156, i32 0, i32 55
  %158 = load i8, ptr %157, align 1, !tbaa !31
  %159 = zext i8 %158 to i32
  %160 = load ptr, ptr %2, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.png_struct_def, ptr %160, i32 0, i32 52
  %162 = load i8, ptr %161, align 8, !tbaa !32
  %163 = zext i8 %162 to i32
  %164 = mul nsw i32 %159, %163
  %165 = sext i32 %164 to i64
  %166 = lshr i64 %165, 3
  %167 = mul i64 %155, %166
  br label %186

168:                                              ; preds = %137
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_struct_def, ptr %169, i32 0, i32 24
  %171 = load i32, ptr %170, align 4, !tbaa !24
  %172 = zext i32 %171 to i64
  %173 = load ptr, ptr %2, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.png_struct_def, ptr %173, i32 0, i32 55
  %175 = load i8, ptr %174, align 1, !tbaa !31
  %176 = zext i8 %175 to i32
  %177 = load ptr, ptr %2, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.png_struct_def, ptr %177, i32 0, i32 52
  %179 = load i8, ptr %178, align 8, !tbaa !32
  %180 = zext i8 %179 to i32
  %181 = mul nsw i32 %176, %180
  %182 = sext i32 %181 to i64
  %183 = mul i64 %172, %182
  %184 = add i64 %183, 7
  %185 = lshr i64 %184, 3
  br label %186

186:                                              ; preds = %168, %151
  %187 = phi i64 [ %167, %151 ], [ %185, %168 ]
  %188 = add i64 %187, 1
  call void @llvm.memset.p0.i64(ptr align 1 %140, i8 0, i64 %188, i1 false)
  br label %189

189:                                              ; preds = %186, %132
  store i32 1, ptr %8, align 4
  br label %280

190:                                              ; preds = %126
  br label %191

191:                                              ; preds = %190, %21
  br label %192

192:                                              ; preds = %246, %191
  %193 = load ptr, ptr %2, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct.png_struct_def, ptr %193, i32 0, i32 16
  %195 = call i32 @deflate(ptr noundef %194, i32 noundef 4)
  store i32 %195, ptr %7, align 4, !tbaa !25
  %196 = load i32, ptr %7, align 4, !tbaa !25
  %197 = icmp eq i32 %196, 0
  br i1 %197, label %198, label %226

198:                                              ; preds = %192
  %199 = load ptr, ptr %2, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.png_struct_def, ptr %199, i32 0, i32 16
  %201 = getelementptr inbounds %struct.z_stream_s, ptr %200, i32 0, i32 4
  %202 = load i32, ptr %201, align 8, !tbaa !33
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %225, label %204

204:                                              ; preds = %198
  %205 = load ptr, ptr %2, align 8, !tbaa !5
  %206 = load ptr, ptr %2, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.png_struct_def, ptr %206, i32 0, i32 17
  %208 = load ptr, ptr %207, align 8, !tbaa !34
  %209 = load ptr, ptr %2, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.png_struct_def, ptr %209, i32 0, i32 18
  %211 = load i64, ptr %210, align 8, !tbaa !35
  call void @png_write_IDAT(ptr noundef %205, ptr noundef %208, i64 noundef %211)
  %212 = load ptr, ptr %2, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.png_struct_def, ptr %212, i32 0, i32 17
  %214 = load ptr, ptr %213, align 8, !tbaa !34
  %215 = load ptr, ptr %2, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.png_struct_def, ptr %215, i32 0, i32 16
  %217 = getelementptr inbounds %struct.z_stream_s, ptr %216, i32 0, i32 3
  store ptr %214, ptr %217, align 8, !tbaa !36
  %218 = load ptr, ptr %2, align 8, !tbaa !5
  %219 = getelementptr inbounds %struct.png_struct_def, ptr %218, i32 0, i32 18
  %220 = load i64, ptr %219, align 8, !tbaa !35
  %221 = trunc i64 %220 to i32
  %222 = load ptr, ptr %2, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.png_struct_def, ptr %222, i32 0, i32 16
  %224 = getelementptr inbounds %struct.z_stream_s, ptr %223, i32 0, i32 4
  store i32 %221, ptr %224, align 8, !tbaa !33
  br label %225

225:                                              ; preds = %204, %198
  br label %245

226:                                              ; preds = %192
  %227 = load i32, ptr %7, align 4, !tbaa !25
  %228 = icmp ne i32 %227, 1
  br i1 %228, label %229, label %244

229:                                              ; preds = %226
  %230 = load ptr, ptr %2, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.png_struct_def, ptr %230, i32 0, i32 16
  %232 = getelementptr inbounds %struct.z_stream_s, ptr %231, i32 0, i32 6
  %233 = load ptr, ptr %232, align 8, !tbaa !37
  %234 = icmp ne ptr %233, null
  br i1 %234, label %235, label %241

235:                                              ; preds = %229
  %236 = load ptr, ptr %2, align 8, !tbaa !5
  %237 = load ptr, ptr %2, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.png_struct_def, ptr %237, i32 0, i32 16
  %239 = getelementptr inbounds %struct.z_stream_s, ptr %238, i32 0, i32 6
  %240 = load ptr, ptr %239, align 8, !tbaa !37
  call void @png_error(ptr noundef %236, ptr noundef %240)
  br label %243

241:                                              ; preds = %229
  %242 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %242, ptr noundef @.str.45)
  br label %243

243:                                              ; preds = %241, %235
  br label %244

244:                                              ; preds = %243, %226
  br label %245

245:                                              ; preds = %244, %225
  br label %246

246:                                              ; preds = %245
  %247 = load i32, ptr %7, align 4, !tbaa !25
  %248 = icmp ne i32 %247, 1
  br i1 %248, label %192, label %249, !llvm.loop !38

249:                                              ; preds = %246
  %250 = load ptr, ptr %2, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.png_struct_def, ptr %250, i32 0, i32 16
  %252 = getelementptr inbounds %struct.z_stream_s, ptr %251, i32 0, i32 4
  %253 = load i32, ptr %252, align 8, !tbaa !33
  %254 = zext i32 %253 to i64
  %255 = load ptr, ptr %2, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.png_struct_def, ptr %255, i32 0, i32 18
  %257 = load i64, ptr %256, align 8, !tbaa !35
  %258 = icmp ult i64 %254, %257
  br i1 %258, label %259, label %273

259:                                              ; preds = %249
  %260 = load ptr, ptr %2, align 8, !tbaa !5
  %261 = load ptr, ptr %2, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.png_struct_def, ptr %261, i32 0, i32 17
  %263 = load ptr, ptr %262, align 8, !tbaa !34
  %264 = load ptr, ptr %2, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.png_struct_def, ptr %264, i32 0, i32 18
  %266 = load i64, ptr %265, align 8, !tbaa !35
  %267 = load ptr, ptr %2, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.png_struct_def, ptr %267, i32 0, i32 16
  %269 = getelementptr inbounds %struct.z_stream_s, ptr %268, i32 0, i32 4
  %270 = load i32, ptr %269, align 8, !tbaa !33
  %271 = zext i32 %270 to i64
  %272 = sub i64 %266, %271
  call void @png_write_IDAT(ptr noundef %260, ptr noundef %263, i64 noundef %272)
  br label %273

273:                                              ; preds = %259, %249
  %274 = load ptr, ptr %2, align 8, !tbaa !5
  %275 = getelementptr inbounds %struct.png_struct_def, ptr %274, i32 0, i32 16
  %276 = call i32 @deflateReset(ptr noundef %275)
  %277 = load ptr, ptr %2, align 8, !tbaa !5
  %278 = getelementptr inbounds %struct.png_struct_def, ptr %277, i32 0, i32 16
  %279 = getelementptr inbounds %struct.z_stream_s, ptr %278, i32 0, i32 11
  store i32 0, ptr %279, align 8, !tbaa !39
  store i32 0, ptr %8, align 4
  br label %280

280:                                              ; preds = %273, %189, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 28, ptr %3) #5
  %281 = load i32, ptr %8, align 4
  switch i32 %281, label %283 [
    i32 0, label %282
    i32 1, label %282
  ]

282:                                              ; preds = %280, %280
  ret void

283:                                              ; preds = %280
  unreachable
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare i32 @deflate(ptr noundef, i32 noundef) #2

declare i32 @deflateReset(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 484}
!10 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !7, i64 280, !7, i64 281, !11, i64 284, !11, i64 288, !11, i64 292, !12, i64 296, !6, i64 408, !13, i64 416, !11, i64 424, !11, i64 428, !11, i64 432, !11, i64 436, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !13, i64 464, !13, i64 472, !11, i64 480, !11, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !14, i64 536, !11, i64 560, !11, i64 564, !6, i64 568, !15, i64 576, !15, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !15, i64 598, !7, i64 600, !16, i64 604, !17, i64 608, !17, i64 618, !6, i64 632, !11, i64 640, !11, i64 644, !11, i64 648, !16, i64 652, !16, i64 656, !6, i64 664, !6, i64 672, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !18, i64 712, !18, i64 717, !6, i64 728, !17, i64 736, !6, i64 752, !6, i64 760, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !11, i64 824, !11, i64 828, !13, i64 832, !13, i64 840, !13, i64 848, !13, i64 856, !11, i64 864, !11, i64 868, !13, i64 872, !13, i64 880, !6, i64 888, !6, i64 896, !6, i64 904, !6, i64 912, !6, i64 920, !7, i64 928, !7, i64 929, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !11, i64 984, !6, i64 992, !6, i64 1000, !11, i64 1008, !6, i64 1016, !7, i64 1024, !15, i64 1026, !15, i64 1028, !15, i64 1030, !11, i64 1032, !11, i64 1036, !7, i64 1040, !6, i64 1048, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !7, i64 1104, !11, i64 1108, !11, i64 1112, !11, i64 1116, !19, i64 1120, !11, i64 1152, !11, i64 1156, !6, i64 1160, !11, i64 1168}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !11, i64 8, !13, i64 16, !6, i64 24, !11, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !11, i64 88, !13, i64 96, !13, i64 104}
!13 = !{!"long", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !13, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, i64 8}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !13, i64 16, !7, i64 24}
!20 = !{!10, !11, i64 452}
!21 = !{!10, !7, i64 587}
!22 = !{!10, !11, i64 292}
!23 = !{!10, !7, i64 588}
!24 = !{!10, !11, i64 444}
!25 = !{!11, !11, i64 0}
!26 = !{!10, !11, i64 456}
!27 = !{!10, !11, i64 448}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!10, !6, i64 488}
!31 = !{!10, !7, i64 595}
!32 = !{!10, !7, i64 592}
!33 = !{!10, !11, i64 328}
!34 = !{!10, !6, i64 408}
!35 = !{!10, !13, i64 416}
!36 = !{!10, !6, i64 320}
!37 = !{!10, !6, i64 344}
!38 = distinct !{!38, !29}
!39 = !{!10, !11, i64 384}


; 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"

@__const.png_write_finish_row.png_pass_start = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_finish_row.png_pass_inc = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_finish_row.png_pass_ystart = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_finish_row.png_pass_yinc = external hidden unnamed_addr constant [7 x i32], align 16
@.str.45 = external hidden unnamed_addr constant [11 x i8], align 1

declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_finish_row(ptr noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 484
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = add i32 %3, 1
  store i32 %4, ptr %2, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 452
  %6 = load i32, ptr %5, align 4, !tbaa !19
  %7 = icmp ult i32 %4, %6
  br i1 %7, label %271, label %8

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 587
  %10 = load i8, ptr %9, align 1, !tbaa !20
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %239, label %11

11:                                               ; preds = %8
  store i32 0, ptr %2, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 292
  %13 = load i32, ptr %12, align 4, !tbaa !21
  %14 = and i32 %13, 2
  %.not61 = icmp eq i32 %14, 0
  %15 = getelementptr inbounds i8, ptr %0, i64 588
  %.promoted = load i8, ptr %15, align 4, !tbaa !22
  br i1 %.not61, label %.critedge.preheader, label %21

.critedge.preheader:                              ; preds = %11
  %16 = getelementptr inbounds i8, ptr %0, i64 444
  %17 = getelementptr inbounds i8, ptr %0, i64 456
  %18 = getelementptr inbounds i8, ptr %0, i64 448
  %19 = add i8 %.promoted, 1
  %20 = icmp ugt i8 %19, 6
  br i1 %20, label %.loopexit, label %23

21:                                               ; preds = %11
  %22 = add i8 %.promoted, 1
  br label %.loopexit

23:                                               ; preds = %.critedge.preheader
  %24 = load i32, ptr %16, align 4, !tbaa !23
  %25 = zext nneg i8 %19 to i64
  %26 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %25
  %27 = load i32, ptr %26, align 4, !tbaa !24
  %28 = add i32 %27, %24
  %29 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %25
  %30 = load i32, ptr %29, align 4, !tbaa !24
  %31 = xor i32 %30, -1
  %32 = add i32 %28, %31
  %33 = udiv i32 %32, %27
  store i32 %33, ptr %17, align 8, !tbaa !25
  %34 = load i32, ptr %18, align 8, !tbaa !26
  %35 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %25
  %36 = load i32, ptr %35, align 4, !tbaa !24
  %37 = add i32 %36, %34
  %38 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %25
  %39 = load i32, ptr %38, align 4, !tbaa !24
  %40 = xor i32 %39, -1
  %41 = add i32 %37, %40
  %42 = udiv i32 %41, %36
  store i32 %42, ptr %5, align 4, !tbaa !19
  %43 = icmp ugt i32 %27, %32
  %44 = icmp ugt i32 %36, %41
  %or.cond = select i1 %43, i1 true, i1 %44
  br i1 %or.cond, label %.critedge.1, label %.loopexit, !llvm.loop !27

.critedge.1:                                      ; preds = %23
  %45 = add i8 %.promoted, 2
  %46 = icmp ugt i8 %45, 6
  br i1 %46, label %.loopexit, label %47

47:                                               ; preds = %.critedge.1
  %48 = load i32, ptr %16, align 4, !tbaa !23
  %49 = zext nneg i8 %45 to i64
  %50 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !24
  %52 = add i32 %51, %48
  %53 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %49
  %54 = load i32, ptr %53, align 4, !tbaa !24
  %55 = xor i32 %54, -1
  %56 = add i32 %52, %55
  %57 = udiv i32 %56, %51
  store i32 %57, ptr %17, align 8, !tbaa !25
  %58 = load i32, ptr %18, align 8, !tbaa !26
  %59 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %49
  %60 = load i32, ptr %59, align 4, !tbaa !24
  %61 = add i32 %60, %58
  %62 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %49
  %63 = load i32, ptr %62, align 4, !tbaa !24
  %64 = xor i32 %63, -1
  %65 = add i32 %61, %64
  %66 = udiv i32 %65, %60
  store i32 %66, ptr %5, align 4, !tbaa !19
  %67 = icmp ugt i32 %51, %56
  %68 = icmp ugt i32 %60, %65
  %or.cond.1 = select i1 %67, i1 true, i1 %68
  br i1 %or.cond.1, label %.critedge.2, label %.loopexit, !llvm.loop !27

.critedge.2:                                      ; preds = %47
  %69 = add i8 %.promoted, 3
  %70 = icmp ugt i8 %69, 6
  br i1 %70, label %.loopexit, label %71

71:                                               ; preds = %.critedge.2
  %72 = load i32, ptr %16, align 4, !tbaa !23
  %73 = zext nneg i8 %69 to i64
  %74 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %73
  %75 = load i32, ptr %74, align 4, !tbaa !24
  %76 = add i32 %75, %72
  %77 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %73
  %78 = load i32, ptr %77, align 4, !tbaa !24
  %79 = xor i32 %78, -1
  %80 = add i32 %76, %79
  %81 = udiv i32 %80, %75
  store i32 %81, ptr %17, align 8, !tbaa !25
  %82 = load i32, ptr %18, align 8, !tbaa !26
  %83 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %73
  %84 = load i32, ptr %83, align 4, !tbaa !24
  %85 = add i32 %84, %82
  %86 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %73
  %87 = load i32, ptr %86, align 4, !tbaa !24
  %88 = xor i32 %87, -1
  %89 = add i32 %85, %88
  %90 = udiv i32 %89, %84
  store i32 %90, ptr %5, align 4, !tbaa !19
  %91 = icmp ugt i32 %75, %80
  %92 = icmp ugt i32 %84, %89
  %or.cond.2 = select i1 %91, i1 true, i1 %92
  br i1 %or.cond.2, label %.critedge.3, label %.loopexit, !llvm.loop !27

.critedge.3:                                      ; preds = %71
  %93 = add i8 %.promoted, 4
  %94 = icmp ugt i8 %93, 6
  br i1 %94, label %.loopexit, label %95

95:                                               ; preds = %.critedge.3
  %96 = load i32, ptr %16, align 4, !tbaa !23
  %97 = zext nneg i8 %93 to i64
  %98 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !24
  %100 = add i32 %99, %96
  %101 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %97
  %102 = load i32, ptr %101, align 4, !tbaa !24
  %103 = xor i32 %102, -1
  %104 = add i32 %100, %103
  %105 = udiv i32 %104, %99
  store i32 %105, ptr %17, align 8, !tbaa !25
  %106 = load i32, ptr %18, align 8, !tbaa !26
  %107 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %97
  %108 = load i32, ptr %107, align 4, !tbaa !24
  %109 = add i32 %108, %106
  %110 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %97
  %111 = load i32, ptr %110, align 4, !tbaa !24
  %112 = xor i32 %111, -1
  %113 = add i32 %109, %112
  %114 = udiv i32 %113, %108
  store i32 %114, ptr %5, align 4, !tbaa !19
  %115 = icmp ugt i32 %99, %104
  %116 = icmp ugt i32 %108, %113
  %or.cond.3 = select i1 %115, i1 true, i1 %116
  br i1 %or.cond.3, label %.critedge.4, label %.loopexit, !llvm.loop !27

.critedge.4:                                      ; preds = %95
  %117 = add i8 %.promoted, 5
  %118 = icmp ugt i8 %117, 6
  br i1 %118, label %.loopexit, label %119

119:                                              ; preds = %.critedge.4
  %120 = load i32, ptr %16, align 4, !tbaa !23
  %121 = zext nneg i8 %117 to i64
  %122 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !24
  %124 = add i32 %123, %120
  %125 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %121
  %126 = load i32, ptr %125, align 4, !tbaa !24
  %127 = xor i32 %126, -1
  %128 = add i32 %124, %127
  %129 = udiv i32 %128, %123
  store i32 %129, ptr %17, align 8, !tbaa !25
  %130 = load i32, ptr %18, align 8, !tbaa !26
  %131 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %121
  %132 = load i32, ptr %131, align 4, !tbaa !24
  %133 = add i32 %132, %130
  %134 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %121
  %135 = load i32, ptr %134, align 4, !tbaa !24
  %136 = xor i32 %135, -1
  %137 = add i32 %133, %136
  %138 = udiv i32 %137, %132
  store i32 %138, ptr %5, align 4, !tbaa !19
  %139 = icmp ugt i32 %123, %128
  %140 = icmp ugt i32 %132, %137
  %or.cond.4 = select i1 %139, i1 true, i1 %140
  br i1 %or.cond.4, label %.critedge.5, label %.loopexit, !llvm.loop !27

.critedge.5:                                      ; preds = %119
  %141 = add i8 %.promoted, 6
  %142 = icmp ugt i8 %141, 6
  br i1 %142, label %.loopexit, label %143

143:                                              ; preds = %.critedge.5
  %144 = load i32, ptr %16, align 4, !tbaa !23
  %145 = zext nneg i8 %141 to i64
  %146 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !24
  %148 = add i32 %147, %144
  %149 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %145
  %150 = load i32, ptr %149, align 4, !tbaa !24
  %151 = xor i32 %150, -1
  %152 = add i32 %148, %151
  %153 = udiv i32 %152, %147
  store i32 %153, ptr %17, align 8, !tbaa !25
  %154 = load i32, ptr %18, align 8, !tbaa !26
  %155 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %145
  %156 = load i32, ptr %155, align 4, !tbaa !24
  %157 = add i32 %156, %154
  %158 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %145
  %159 = load i32, ptr %158, align 4, !tbaa !24
  %160 = xor i32 %159, -1
  %161 = add i32 %157, %160
  %162 = udiv i32 %161, %156
  store i32 %162, ptr %5, align 4, !tbaa !19
  %163 = icmp ugt i32 %147, %152
  %164 = icmp ugt i32 %156, %161
  %or.cond.5 = select i1 %163, i1 true, i1 %164
  br i1 %or.cond.5, label %.critedge.6, label %.loopexit, !llvm.loop !27

.critedge.6:                                      ; preds = %143
  %165 = add i8 %.promoted, 7
  %166 = icmp ult i8 %.promoted, -7
  br i1 %166, label %.loopexit, label %167

167:                                              ; preds = %.critedge.6
  %168 = load i32, ptr %16, align 4, !tbaa !23
  %169 = zext nneg i8 %165 to i64
  %170 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !24
  %172 = add i32 %171, %168
  %173 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %169
  %174 = load i32, ptr %173, align 4, !tbaa !24
  %175 = xor i32 %174, -1
  %176 = add i32 %172, %175
  %177 = udiv i32 %176, %171
  store i32 %177, ptr %17, align 8, !tbaa !25
  %178 = load i32, ptr %18, align 8, !tbaa !26
  %179 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %169
  %180 = load i32, ptr %179, align 4, !tbaa !24
  %181 = add i32 %180, %178
  %182 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %169
  %183 = load i32, ptr %182, align 4, !tbaa !24
  %184 = xor i32 %183, -1
  %185 = add i32 %181, %184
  %186 = udiv i32 %185, %180
  store i32 %186, ptr %5, align 4, !tbaa !19
  %187 = icmp ugt i32 %171, %176
  %188 = icmp ugt i32 %180, %185
  %or.cond.6 = select i1 %187, i1 true, i1 %188
  br i1 %or.cond.6, label %.critedge.7, label %.loopexit, !llvm.loop !27

.critedge.7:                                      ; preds = %167
  %189 = add nsw i8 %.promoted, 8
  %190 = icmp ugt i8 %189, 6
  br i1 %190, label %.loopexit, label %191

191:                                              ; preds = %.critedge.7
  %192 = load i32, ptr %16, align 4, !tbaa !23
  %193 = zext nneg i8 %189 to i64
  %194 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_inc, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !24
  %196 = add i32 %195, %192
  %197 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_start, i64 0, i64 %193
  %198 = load i32, ptr %197, align 4, !tbaa !24
  %199 = xor i32 %198, -1
  %200 = add i32 %196, %199
  %201 = udiv i32 %200, %195
  store i32 %201, ptr %17, align 8, !tbaa !25
  %202 = load i32, ptr %18, align 8, !tbaa !26
  %203 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_yinc, i64 0, i64 %193
  %204 = load i32, ptr %203, align 4, !tbaa !24
  %205 = add i32 %204, %202
  %206 = getelementptr inbounds [7 x i32], ptr @__const.png_write_finish_row.png_pass_ystart, i64 0, i64 %193
  %207 = load i32, ptr %206, align 4, !tbaa !24
  %208 = xor i32 %207, -1
  %209 = add i32 %205, %208
  %210 = udiv i32 %209, %204
  store i32 %210, ptr %5, align 4, !tbaa !19
  br label %.loopexit

.loopexit:                                        ; preds = %23, %.critedge.preheader, %.critedge.1, %47, %.critedge.2, %71, %.critedge.3, %95, %.critedge.4, %119, %.critedge.5, %143, %.critedge.6, %167, %.critedge.7, %191, %21
  %.lcssa.sink = phi i8 [ %22, %21 ], [ %19, %.critedge.preheader ], [ %19, %23 ], [ %45, %.critedge.1 ], [ %45, %47 ], [ %69, %.critedge.2 ], [ %69, %71 ], [ %93, %.critedge.3 ], [ %93, %95 ], [ %117, %.critedge.4 ], [ %117, %119 ], [ %141, %.critedge.5 ], [ %141, %143 ], [ %165, %.critedge.6 ], [ %165, %167 ], [ %189, %.critedge.7 ], [ %189, %191 ]
  store i8 %.lcssa.sink, ptr %15, align 4, !tbaa !22
  %211 = icmp ult i8 %.lcssa.sink, 7
  br i1 %211, label %212, label %239

212:                                              ; preds = %.loopexit
  %213 = getelementptr inbounds i8, ptr %0, i64 488
  %214 = load ptr, ptr %213, align 8, !tbaa !29
  %.not67 = icmp eq ptr %214, null
  br i1 %.not67, label %271, label %215

215:                                              ; preds = %212
  %216 = getelementptr inbounds i8, ptr %0, i64 595
  %217 = load i8, ptr %216, align 1, !tbaa !30
  %218 = zext i8 %217 to i32
  %219 = getelementptr inbounds i8, ptr %0, i64 592
  %220 = load i8, ptr %219, align 8, !tbaa !31
  %221 = zext i8 %220 to i32
  %222 = mul nuw nsw i32 %221, %218
  %223 = icmp ugt i32 %222, 7
  %224 = getelementptr inbounds i8, ptr %0, i64 444
  %225 = load i32, ptr %224, align 4, !tbaa !23
  %226 = zext i32 %225 to i64
  br i1 %223, label %227, label %231

227:                                              ; preds = %215
  %228 = lshr i32 %222, 3
  %229 = zext nneg i32 %228 to i64
  %230 = mul nuw nsw i64 %226, %229
  br label %236

231:                                              ; preds = %215
  %232 = zext nneg i32 %222 to i64
  %233 = mul nuw nsw i64 %226, %232
  %234 = add nuw nsw i64 %233, 7
  %235 = lshr i64 %234, 3
  br label %236

236:                                              ; preds = %231, %227
  %237 = phi i64 [ %230, %227 ], [ %235, %231 ]
  %238 = add nuw nsw i64 %237, 1
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 1 dereferenceable(1) %214, i8 0, i64 %238, i1 false)
  br label %271

239:                                              ; preds = %.loopexit, %8
  %240 = getelementptr inbounds i8, ptr %0, i64 296
  %241 = getelementptr inbounds i8, ptr %0, i64 328
  %242 = getelementptr inbounds i8, ptr %0, i64 408
  %243 = getelementptr inbounds i8, ptr %0, i64 416
  %244 = getelementptr inbounds i8, ptr %0, i64 320
  %245 = getelementptr inbounds i8, ptr %0, i64 344
  br label %246

246:                                              ; preds = %.backedge, %239
  %247 = tail call i32 @deflate(ptr noundef nonnull %240, i32 noundef 4) #3
  switch i32 %247, label %256 [
    i32 0, label %248
    i32 1, label %260
  ]

248:                                              ; preds = %246
  %249 = load i32, ptr %241, align 8, !tbaa !32
  %.not65 = icmp eq i32 %249, 0
  br i1 %.not65, label %250, label %.backedge

250:                                              ; preds = %248
  %251 = load ptr, ptr %242, align 8, !tbaa !33
  %252 = load i64, ptr %243, align 8, !tbaa !34
  tail call void @png_write_IDAT(ptr noundef nonnull %0, ptr noundef %251, i64 noundef %252)
  %253 = load ptr, ptr %242, align 8, !tbaa !33
  store ptr %253, ptr %244, align 8, !tbaa !35
  %254 = load i64, ptr %243, align 8, !tbaa !34
  %255 = trunc i64 %254 to i32
  store i32 %255, ptr %241, align 8, !tbaa !32
  br label %.backedge

.backedge:                                        ; preds = %250, %248, %258, %259
  br label %246, !llvm.loop !36

256:                                              ; preds = %246
  %257 = load ptr, ptr %245, align 8, !tbaa !37
  %.not64 = icmp eq ptr %257, null
  br i1 %.not64, label %259, label %258

258:                                              ; preds = %256
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull %257) #3
  br label %.backedge

259:                                              ; preds = %256
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.45) #3
  br label %.backedge

260:                                              ; preds = %246
  %261 = load i32, ptr %241, align 8, !tbaa !32
  %262 = zext i32 %261 to i64
  %263 = load i64, ptr %243, align 8, !tbaa !34
  %264 = icmp ugt i64 %263, %262
  br i1 %264, label %265, label %268

265:                                              ; preds = %260
  %266 = load ptr, ptr %242, align 8, !tbaa !33
  %267 = sub i64 %263, %262
  tail call void @png_write_IDAT(ptr noundef nonnull %0, ptr noundef %266, i64 noundef %267)
  br label %268

268:                                              ; preds = %265, %260
  %269 = tail call i32 @deflateReset(ptr noundef nonnull %240) #3
  %270 = getelementptr inbounds i8, ptr %0, i64 384
  store i32 0, ptr %270, align 8, !tbaa !38
  br label %271

271:                                              ; preds = %212, %236, %1, %268
  ret void
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare i32 @deflate(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @deflateReset(ptr noundef) local_unnamed_addr #0

attributes #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 #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !10, i64 484}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !7, i64 280, !7, i64 281, !10, i64 284, !10, i64 288, !10, i64 292, !11, i64 296, !9, i64 408, !12, i64 416, !10, i64 424, !10, i64 428, !10, i64 432, !10, i64 436, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !12, i64 464, !12, i64 472, !10, i64 480, !10, i64 484, !9, i64 488, !9, i64 496, !9, i64 504, !9, i64 512, !9, i64 520, !9, i64 528, !13, i64 536, !10, i64 560, !10, i64 564, !9, i64 568, !14, i64 576, !14, i64 578, !7, i64 580, !7, i64 585, !7, i64 586, !7, i64 587, !7, i64 588, !7, i64 589, !7, i64 590, !7, i64 591, !7, i64 592, !7, i64 593, !7, i64 594, !7, i64 595, !7, i64 596, !14, i64 598, !7, i64 600, !15, i64 604, !16, i64 608, !16, i64 618, !9, i64 632, !10, i64 640, !10, i64 644, !10, i64 648, !15, i64 652, !15, i64 656, !9, i64 664, !9, i64 672, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !17, i64 712, !17, i64 717, !9, i64 728, !16, i64 736, !9, i64 752, !9, i64 760, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !10, i64 824, !10, i64 828, !12, i64 832, !12, i64 840, !12, i64 848, !12, i64 856, !10, i64 864, !10, i64 868, !12, i64 872, !12, i64 880, !9, i64 888, !9, i64 896, !9, i64 904, !9, i64 912, !9, i64 920, !7, i64 928, !7, i64 929, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !10, i64 984, !9, i64 992, !9, i64 1000, !10, i64 1008, !9, i64 1016, !7, i64 1024, !14, i64 1026, !14, i64 1028, !14, i64 1030, !10, i64 1032, !10, i64 1036, !7, i64 1040, !9, i64 1048, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !7, i64 1104, !10, i64 1108, !10, i64 1112, !10, i64 1116, !18, i64 1120, !10, i64 1152, !10, i64 1156, !9, i64 1160, !10, i64 1168}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !10, i64 8, !12, i64 16, !9, i64 24, !10, i64 32, !12, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !10, i64 88, !12, i64 96, !12, i64 104}
!12 = !{!"long", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !12, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !12, i64 16, !7, i64 24}
!19 = !{!6, !10, i64 452}
!20 = !{!6, !7, i64 587}
!21 = !{!6, !10, i64 292}
!22 = !{!6, !7, i64 588}
!23 = !{!6, !10, i64 444}
!24 = !{!10, !10, i64 0}
!25 = !{!6, !10, i64 456}
!26 = !{!6, !10, i64 448}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!6, !9, i64 488}
!30 = !{!6, !7, i64 595}
!31 = !{!6, !7, i64 592}
!32 = !{!6, !10, i64 328}
!33 = !{!6, !9, i64 408}
!34 = !{!6, !12, i64 416}
!35 = !{!6, !9, i64 320}
!36 = distinct !{!36, !28}
!37 = !{!6, !9, i64 344}
!38 = !{!6, !10, i64 384}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass