; 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_start_row.png_pass_start = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_start_row.png_pass_inc = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_start_row.png_pass_ystart = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_start_row.png_pass_yinc = external hidden unnamed_addr constant [7 x i32], align 16

; 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 ptr @png_malloc(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @png_write_start_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 i64, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 28, ptr %3) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.png_write_start_row.png_pass_start, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr %4) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %4, ptr align 16 @__const.png_write_start_row.png_pass_inc, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr %5) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %5, ptr align 16 @__const.png_write_start_row.png_pass_ystart, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 28, ptr %6) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.png_write_start_row.png_pass_yinc, i64 28, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.png_struct_def, ptr %8, i32 0, i32 55
  %10 = load i8, ptr %9, align 1, !tbaa !9
  %11 = zext i8 %10 to i32
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.png_struct_def, ptr %12, i32 0, i32 52
  %14 = load i8, ptr %13, align 8, !tbaa !20
  %15 = zext i8 %14 to i32
  %16 = mul nsw i32 %11, %15
  %17 = icmp sge i32 %16, 8
  br i1 %17, label %18, label %35

18:                                               ; preds = %1
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.png_struct_def, ptr %19, i32 0, i32 24
  %21 = load i32, ptr %20, align 4, !tbaa !21
  %22 = zext i32 %21 to i64
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.png_struct_def, ptr %23, i32 0, i32 55
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = zext i8 %25 to i32
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 52
  %29 = load i8, ptr %28, align 8, !tbaa !20
  %30 = zext i8 %29 to i32
  %31 = mul nsw i32 %26, %30
  %32 = sext i32 %31 to i64
  %33 = lshr i64 %32, 3
  %34 = mul i64 %22, %33
  br label %53

35:                                               ; preds = %1
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.png_struct_def, ptr %36, i32 0, i32 24
  %38 = load i32, ptr %37, align 4, !tbaa !21
  %39 = zext i32 %38 to i64
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.png_struct_def, ptr %40, i32 0, i32 55
  %42 = load i8, ptr %41, align 1, !tbaa !9
  %43 = zext i8 %42 to i32
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.png_struct_def, ptr %44, i32 0, i32 52
  %46 = load i8, ptr %45, align 8, !tbaa !20
  %47 = zext i8 %46 to i32
  %48 = mul nsw i32 %43, %47
  %49 = sext i32 %48 to i64
  %50 = mul i64 %39, %49
  %51 = add i64 %50, 7
  %52 = lshr i64 %51, 3
  br label %53

53:                                               ; preds = %35, %18
  %54 = phi i64 [ %34, %18 ], [ %52, %35 ]
  %55 = add i64 %54, 1
  store i64 %55, ptr %7, align 8, !tbaa !22
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = load i64, ptr %7, align 8, !tbaa !22
  %58 = call ptr @png_malloc(ptr noundef %56, i64 noundef %57)
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.png_struct_def, ptr %59, i32 0, i32 33
  store ptr %58, ptr %60, align 8, !tbaa !23
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.png_struct_def, ptr %61, i32 0, i32 33
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %64 = getelementptr inbounds i8, ptr %63, i64 0
  store i8 0, ptr %64, align 1, !tbaa !24
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 49
  %67 = load i8, ptr %66, align 1, !tbaa !25
  %68 = zext i8 %67 to i32
  %69 = and i32 %68, 16
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %84

71:                                               ; preds = %53
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.png_struct_def, ptr %73, i32 0, i32 28
  %75 = load i64, ptr %74, align 8, !tbaa !26
  %76 = add i64 %75, 1
  %77 = call ptr @png_malloc(ptr noundef %72, i64 noundef %76)
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_struct_def, ptr %78, i32 0, i32 34
  store ptr %77, ptr %79, align 8, !tbaa !27
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.png_struct_def, ptr %80, i32 0, i32 34
  %82 = load ptr, ptr %81, align 8, !tbaa !27
  %83 = getelementptr inbounds i8, ptr %82, i64 0
  store i8 1, ptr %83, align 1, !tbaa !24
  br label %84

84:                                               ; preds = %71, %53
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.png_struct_def, ptr %85, i32 0, i32 49
  %87 = load i8, ptr %86, align 1, !tbaa !25
  %88 = zext i8 %87 to i32
  %89 = and i32 %88, 224
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %157

91:                                               ; preds = %84
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = load i64, ptr %7, align 8, !tbaa !22
  %94 = call ptr @png_calloc(ptr noundef %92, i64 noundef %93)
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.png_struct_def, ptr %95, i32 0, i32 32
  store ptr %94, ptr %96, align 8, !tbaa !28
  %97 = load ptr, ptr %2, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_struct_def, ptr %97, i32 0, i32 49
  %99 = load i8, ptr %98, align 1, !tbaa !25
  %100 = zext i8 %99 to i32
  %101 = and i32 %100, 32
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %116

103:                                              ; preds = %91
  %104 = load ptr, ptr %2, align 8, !tbaa !5
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_struct_def, ptr %105, i32 0, i32 28
  %107 = load i64, ptr %106, align 8, !tbaa !26
  %108 = add i64 %107, 1
  %109 = call ptr @png_malloc(ptr noundef %104, i64 noundef %108)
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.png_struct_def, ptr %110, i32 0, i32 35
  store ptr %109, ptr %111, align 8, !tbaa !29
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_struct_def, ptr %112, i32 0, i32 35
  %114 = load ptr, ptr %113, align 8, !tbaa !29
  %115 = getelementptr inbounds i8, ptr %114, i64 0
  store i8 2, ptr %115, align 1, !tbaa !24
  br label %116

116:                                              ; preds = %103, %91
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.png_struct_def, ptr %117, i32 0, i32 49
  %119 = load i8, ptr %118, align 1, !tbaa !25
  %120 = zext i8 %119 to i32
  %121 = and i32 %120, 64
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %136

123:                                              ; preds = %116
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.png_struct_def, ptr %125, i32 0, i32 28
  %127 = load i64, ptr %126, align 8, !tbaa !26
  %128 = add i64 %127, 1
  %129 = call ptr @png_malloc(ptr noundef %124, i64 noundef %128)
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 36
  store ptr %129, ptr %131, align 8, !tbaa !30
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.png_struct_def, ptr %132, i32 0, i32 36
  %134 = load ptr, ptr %133, align 8, !tbaa !30
  %135 = getelementptr inbounds i8, ptr %134, i64 0
  store i8 3, ptr %135, align 1, !tbaa !24
  br label %136

136:                                              ; preds = %123, %116
  %137 = load ptr, ptr %2, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.png_struct_def, ptr %137, i32 0, i32 49
  %139 = load i8, ptr %138, align 1, !tbaa !25
  %140 = zext i8 %139 to i32
  %141 = and i32 %140, 128
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %156

143:                                              ; preds = %136
  %144 = load ptr, ptr %2, align 8, !tbaa !5
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.png_struct_def, ptr %145, i32 0, i32 28
  %147 = load i64, ptr %146, align 8, !tbaa !26
  %148 = add i64 %147, 1
  %149 = call ptr @png_malloc(ptr noundef %144, i64 noundef %148)
  %150 = load ptr, ptr %2, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.png_struct_def, ptr %150, i32 0, i32 37
  store ptr %149, ptr %151, align 8, !tbaa !31
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.png_struct_def, ptr %152, i32 0, i32 37
  %154 = load ptr, ptr %153, align 8, !tbaa !31
  %155 = getelementptr inbounds i8, ptr %154, i64 0
  store i8 4, ptr %155, align 1, !tbaa !24
  br label %156

156:                                              ; preds = %143, %136
  br label %157

157:                                              ; preds = %156, %84
  %158 = load ptr, ptr %2, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.png_struct_def, ptr %158, i32 0, i32 47
  %160 = load i8, ptr %159, align 1, !tbaa !32
  %161 = icmp ne i8 %160, 0
  br i1 %161, label %162, label %211

162:                                              ; preds = %157
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.png_struct_def, ptr %163, i32 0, i32 15
  %165 = load i32, ptr %164, align 4, !tbaa !33
  %166 = and i32 %165, 2
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %199, label %168

168:                                              ; preds = %162
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_struct_def, ptr %169, i32 0, i32 25
  %171 = load i32, ptr %170, align 8, !tbaa !34
  %172 = getelementptr inbounds [7 x i32], ptr %6, i64 0, i64 0
  %173 = load i32, ptr %172, align 16, !tbaa !35
  %174 = add i32 %171, %173
  %175 = sub i32 %174, 1
  %176 = getelementptr inbounds [7 x i32], ptr %5, i64 0, i64 0
  %177 = load i32, ptr %176, align 16, !tbaa !35
  %178 = sub i32 %175, %177
  %179 = getelementptr inbounds [7 x i32], ptr %6, i64 0, i64 0
  %180 = load i32, ptr %179, align 16, !tbaa !35
  %181 = udiv i32 %178, %180
  %182 = load ptr, ptr %2, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.png_struct_def, ptr %182, i32 0, i32 26
  store i32 %181, ptr %183, align 4, !tbaa !36
  %184 = load ptr, ptr %2, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.png_struct_def, ptr %184, i32 0, i32 24
  %186 = load i32, ptr %185, align 4, !tbaa !21
  %187 = getelementptr inbounds [7 x i32], ptr %4, i64 0, i64 0
  %188 = load i32, ptr %187, align 16, !tbaa !35
  %189 = add i32 %186, %188
  %190 = sub i32 %189, 1
  %191 = getelementptr inbounds [7 x i32], ptr %3, i64 0, i64 0
  %192 = load i32, ptr %191, align 16, !tbaa !35
  %193 = sub i32 %190, %192
  %194 = getelementptr inbounds [7 x i32], ptr %4, i64 0, i64 0
  %195 = load i32, ptr %194, align 16, !tbaa !35
  %196 = udiv i32 %193, %195
  %197 = load ptr, ptr %2, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.png_struct_def, ptr %197, i32 0, i32 27
  store i32 %196, ptr %198, align 8, !tbaa !37
  br label %210

199:                                              ; preds = %162
  %200 = load ptr, ptr %2, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.png_struct_def, ptr %200, i32 0, i32 25
  %202 = load i32, ptr %201, align 8, !tbaa !34
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.png_struct_def, ptr %203, i32 0, i32 26
  store i32 %202, ptr %204, align 4, !tbaa !36
  %205 = load ptr, ptr %2, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.png_struct_def, ptr %205, i32 0, i32 24
  %207 = load i32, ptr %206, align 4, !tbaa !21
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.png_struct_def, ptr %208, i32 0, i32 27
  store i32 %207, ptr %209, align 8, !tbaa !37
  br label %210

210:                                              ; preds = %199, %168
  br label %222

211:                                              ; preds = %157
  %212 = load ptr, ptr %2, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.png_struct_def, ptr %212, i32 0, i32 25
  %214 = load i32, 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 26
  store i32 %214, ptr %216, align 4, !tbaa !36
  %217 = load ptr, ptr %2, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.png_struct_def, ptr %217, i32 0, i32 24
  %219 = load i32, ptr %218, align 4, !tbaa !21
  %220 = load ptr, ptr %2, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.png_struct_def, ptr %220, i32 0, i32 27
  store i32 %219, ptr %221, align 8, !tbaa !37
  br label %222

222:                                              ; preds = %211, %210
  %223 = load ptr, ptr %2, align 8, !tbaa !5
  %224 = getelementptr inbounds %struct.png_struct_def, ptr %223, i32 0, i32 18
  %225 = load i64, ptr %224, align 8, !tbaa !38
  %226 = trunc i64 %225 to i32
  %227 = load ptr, ptr %2, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.png_struct_def, ptr %227, i32 0, i32 16
  %229 = getelementptr inbounds %struct.z_stream_s, ptr %228, i32 0, i32 4
  store i32 %226, ptr %229, align 8, !tbaa !39
  %230 = load ptr, ptr %2, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.png_struct_def, ptr %230, i32 0, i32 17
  %232 = load ptr, ptr %231, align 8, !tbaa !40
  %233 = load ptr, ptr %2, align 8, !tbaa !5
  %234 = getelementptr inbounds %struct.png_struct_def, ptr %233, i32 0, i32 16
  %235 = getelementptr inbounds %struct.z_stream_s, ptr %234, i32 0, i32 3
  store ptr %232, ptr %235, align 8, !tbaa !41
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 28, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 28, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 28, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 28, ptr %3) #4
  ret void
}

declare ptr @png_calloc(ptr noundef, i64 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 = { 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, !7, i64 595}
!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, !7, i64 592}
!21 = !{!10, !11, i64 444}
!22 = !{!13, !13, i64 0}
!23 = !{!10, !6, i64 496}
!24 = !{!7, !7, i64 0}
!25 = !{!10, !7, i64 589}
!26 = !{!10, !13, i64 464}
!27 = !{!10, !6, i64 504}
!28 = !{!10, !6, i64 488}
!29 = !{!10, !6, i64 512}
!30 = !{!10, !6, i64 520}
!31 = !{!10, !6, i64 528}
!32 = !{!10, !7, i64 587}
!33 = !{!10, !11, i64 292}
!34 = !{!10, !11, i64 448}
!35 = !{!11, !11, i64 0}
!36 = !{!10, !11, i64 452}
!37 = !{!10, !11, i64 456}
!38 = !{!10, !13, i64 416}
!39 = !{!10, !11, i64 328}
!40 = !{!10, !6, i64 408}
!41 = !{!10, !6, i64 320}


; 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_start_row.png_pass_start = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_start_row.png_pass_inc = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_start_row.png_pass_ystart = external hidden unnamed_addr constant [7 x i32], align 16
@__const.png_write_start_row.png_pass_yinc = external hidden unnamed_addr constant [7 x i32], align 16

declare ptr @png_malloc(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @png_write_start_row(ptr noundef %0) local_unnamed_addr #1 {
  %.sroa.07.0.copyload = load i32, ptr @__const.png_write_start_row.png_pass_start, align 16
  %.sroa.04.0.copyload = load i32, ptr @__const.png_write_start_row.png_pass_inc, align 16
  %.sroa.03.0.copyload = load i32, ptr @__const.png_write_start_row.png_pass_ystart, align 16
  %.sroa.0.0.copyload = load i32, ptr @__const.png_write_start_row.png_pass_yinc, align 16
  %2 = getelementptr inbounds i8, ptr %0, i64 595
  %3 = load i8, ptr %2, align 1, !tbaa !5
  %4 = zext i8 %3 to i32
  %5 = getelementptr inbounds i8, ptr %0, i64 592
  %6 = load i8, ptr %5, align 8, !tbaa !19
  %7 = zext i8 %6 to i32
  %8 = mul nuw nsw i32 %7, %4
  %9 = icmp ugt i32 %8, 7
  %10 = getelementptr inbounds i8, ptr %0, i64 444
  %11 = load i32, ptr %10, align 4, !tbaa !20
  %12 = zext i32 %11 to i64
  br i1 %9, label %13, label %17

13:                                               ; preds = %1
  %14 = lshr i32 %8, 3
  %15 = zext nneg i32 %14 to i64
  %16 = mul nuw nsw i64 %12, %15
  br label %22

17:                                               ; preds = %1
  %18 = zext nneg i32 %8 to i64
  %19 = mul nuw nsw i64 %12, %18
  %20 = add nuw nsw i64 %19, 7
  %21 = lshr i64 %20, 3
  br label %22

22:                                               ; preds = %17, %13
  %23 = phi i64 [ %16, %13 ], [ %21, %17 ]
  %24 = add nuw nsw i64 %23, 1
  %25 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %24) #2
  %26 = getelementptr inbounds i8, ptr %0, i64 496
  store ptr %25, ptr %26, align 8, !tbaa !21
  store i8 0, ptr %25, align 1, !tbaa !22
  %27 = getelementptr inbounds i8, ptr %0, i64 589
  %28 = load i8, ptr %27, align 1, !tbaa !23
  %29 = and i8 %28, 16
  %.not = icmp eq i8 %29, 0
  br i1 %.not, label %36, label %30

30:                                               ; preds = %22
  %31 = getelementptr inbounds i8, ptr %0, i64 464
  %32 = load i64, ptr %31, align 8, !tbaa !24
  %33 = add i64 %32, 1
  %34 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %33) #2
  %35 = getelementptr inbounds i8, ptr %0, i64 504
  store ptr %34, ptr %35, align 8, !tbaa !25
  store i8 1, ptr %34, align 1, !tbaa !22
  %.pr = load i8, ptr %27, align 1, !tbaa !23
  br label %36

36:                                               ; preds = %30, %22
  %37 = phi i8 [ %.pr, %30 ], [ %28, %22 ]
  %.not60 = icmp ult i8 %37, 32
  br i1 %.not60, label %66, label %38

38:                                               ; preds = %36
  %39 = tail call ptr @png_calloc(ptr noundef nonnull %0, i64 noundef %24) #2
  %40 = getelementptr inbounds i8, ptr %0, i64 488
  store ptr %39, ptr %40, align 8, !tbaa !26
  %41 = load i8, ptr %27, align 1, !tbaa !23
  %42 = and i8 %41, 32
  %.not61 = icmp eq i8 %42, 0
  br i1 %.not61, label %49, label %43

43:                                               ; preds = %38
  %44 = getelementptr inbounds i8, ptr %0, i64 464
  %45 = load i64, ptr %44, align 8, !tbaa !24
  %46 = add i64 %45, 1
  %47 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %46) #2
  %48 = getelementptr inbounds i8, ptr %0, i64 512
  store ptr %47, ptr %48, align 8, !tbaa !27
  store i8 2, ptr %47, align 1, !tbaa !22
  %.pre = load i8, ptr %27, align 1, !tbaa !23
  br label %49

49:                                               ; preds = %43, %38
  %50 = phi i8 [ %.pre, %43 ], [ %41, %38 ]
  %51 = and i8 %50, 64
  %.not62 = icmp eq i8 %51, 0
  br i1 %.not62, label %58, label %52

52:                                               ; preds = %49
  %53 = getelementptr inbounds i8, ptr %0, i64 464
  %54 = load i64, ptr %53, align 8, !tbaa !24
  %55 = add i64 %54, 1
  %56 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %55) #2
  %57 = getelementptr inbounds i8, ptr %0, i64 520
  store ptr %56, ptr %57, align 8, !tbaa !28
  store i8 3, ptr %56, align 1, !tbaa !22
  %.pr66 = load i8, ptr %27, align 1, !tbaa !23
  br label %58

58:                                               ; preds = %52, %49
  %59 = phi i8 [ %.pr66, %52 ], [ %50, %49 ]
  %.not63 = icmp sgt i8 %59, -1
  br i1 %.not63, label %66, label %60

60:                                               ; preds = %58
  %61 = getelementptr inbounds i8, ptr %0, i64 464
  %62 = load i64, ptr %61, align 8, !tbaa !24
  %63 = add i64 %62, 1
  %64 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %63) #2
  %65 = getelementptr inbounds i8, ptr %0, i64 528
  store ptr %64, ptr %65, align 8, !tbaa !29
  store i8 4, ptr %64, align 1, !tbaa !22
  br label %66

66:                                               ; preds = %58, %60, %36
  %67 = getelementptr inbounds i8, ptr %0, i64 587
  %68 = load i8, ptr %67, align 1, !tbaa !30
  %.not64 = icmp eq i8 %68, 0
  br i1 %.not64, label %91, label %69

69:                                               ; preds = %66
  %70 = getelementptr inbounds i8, ptr %0, i64 292
  %71 = load i32, ptr %70, align 4, !tbaa !31
  %72 = and i32 %71, 2
  %.not65 = icmp eq i32 %72, 0
  %73 = getelementptr inbounds i8, ptr %0, i64 448
  %74 = load i32, ptr %73, align 8, !tbaa !32
  br i1 %.not65, label %75, label %87

75:                                               ; preds = %69
  %76 = xor i32 %.sroa.03.0.copyload, -1
  %77 = add i32 %.sroa.0.0.copyload, %76
  %78 = add i32 %77, %74
  %79 = udiv i32 %78, %.sroa.0.0.copyload
  %80 = getelementptr inbounds i8, ptr %0, i64 452
  store i32 %79, ptr %80, align 4, !tbaa !33
  %81 = getelementptr inbounds i8, ptr %0, i64 444
  %82 = load i32, ptr %81, align 4, !tbaa !20
  %83 = xor i32 %.sroa.07.0.copyload, -1
  %84 = add i32 %.sroa.04.0.copyload, %83
  %85 = add i32 %84, %82
  %86 = udiv i32 %85, %.sroa.04.0.copyload
  br label %97

87:                                               ; preds = %69
  %88 = getelementptr inbounds i8, ptr %0, i64 452
  store i32 %74, ptr %88, align 4, !tbaa !33
  %89 = getelementptr inbounds i8, ptr %0, i64 444
  %90 = load i32, ptr %89, align 4, !tbaa !20
  br label %97

91:                                               ; preds = %66
  %92 = getelementptr inbounds i8, ptr %0, i64 448
  %93 = load i32, ptr %92, align 8, !tbaa !32
  %94 = getelementptr inbounds i8, ptr %0, i64 452
  store i32 %93, ptr %94, align 4, !tbaa !33
  %95 = getelementptr inbounds i8, ptr %0, i64 444
  %96 = load i32, ptr %95, align 4, !tbaa !20
  br label %97

97:                                               ; preds = %75, %87, %91
  %.sink = phi i32 [ %86, %75 ], [ %90, %87 ], [ %96, %91 ]
  %98 = getelementptr inbounds i8, ptr %0, i64 456
  store i32 %.sink, ptr %98, align 8, !tbaa !34
  %99 = getelementptr inbounds i8, ptr %0, i64 416
  %100 = load i64, ptr %99, align 8, !tbaa !35
  %101 = trunc i64 %100 to i32
  %102 = getelementptr inbounds i8, ptr %0, i64 328
  store i32 %101, ptr %102, align 8, !tbaa !36
  %103 = getelementptr inbounds i8, ptr %0, i64 408
  %104 = load ptr, ptr %103, align 8, !tbaa !37
  %105 = getelementptr inbounds i8, ptr %0, i64 320
  store ptr %104, ptr %105, align 8, !tbaa !38
  ret void
}

declare ptr @png_calloc(ptr noundef, i64 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 = { 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, !7, i64 595}
!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, !7, i64 592}
!20 = !{!6, !10, i64 444}
!21 = !{!6, !9, i64 496}
!22 = !{!7, !7, i64 0}
!23 = !{!6, !7, i64 589}
!24 = !{!6, !12, i64 464}
!25 = !{!6, !9, i64 504}
!26 = !{!6, !9, i64 488}
!27 = !{!6, !9, i64 512}
!28 = !{!6, !9, i64 520}
!29 = !{!6, !9, i64 528}
!30 = !{!6, !7, i64 587}
!31 = !{!6, !10, i64 292}
!32 = !{!6, !10, i64 448}
!33 = !{!6, !10, i64 452}
!34 = !{!6, !10, i64 456}
!35 = !{!6, !12, i64 416}
!36 = !{!6, !10, i64 328}
!37 = !{!6, !9, i64 408}
!38 = !{!6, !9, i64 320}


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