; LLVM IR from corentinartaud/graphics :: ThirdParty/FreeImage-3170/Source/LibPNG (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, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, i32, %struct.z_stream_s, ptr, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, i32, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, i32, 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, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, [29 x i8], i32, ptr, ptr, i32, i32, ptr, i8, i8, i16, i16, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, i64, %struct.png_unknown_chunk_t, i64, ptr, i64, i32, i32, ptr, [4 x ptr], %struct.png_colorspace }
%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_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 }
%struct.png_colorspace = type { i32, %struct.png_xy, %struct.png_XYZ, i16, i16 }
%struct.png_xy = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.png_XYZ = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }

@png_write_start_row.png_pass_start = external hidden constant [7 x i8], align 1
@png_write_start_row.png_pass_inc = external hidden constant [7 x i8], align 1
@png_write_start_row.png_pass_ystart = external hidden constant [7 x i8], align 1
@png_write_start_row.png_pass_yinc = external hidden constant [7 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

declare noalias ptr @png_malloc(ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @png_write_start_row(ptr noalias noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %5 = load ptr, ptr %2, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.png_struct_def, ptr %5, i32 0, i32 68
  %7 = load i8, ptr %6, align 4, !tbaa !9
  %8 = zext i8 %7 to i32
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.png_struct_def, ptr %9, i32 0, i32 65
  %11 = load i8, ptr %10, align 1, !tbaa !21
  %12 = zext i8 %11 to i32
  %13 = mul nsw i32 %8, %12
  store i32 %13, ptr %4, align 4, !tbaa !22
  %14 = load i32, ptr %4, align 4, !tbaa !22
  %15 = icmp sge i32 %14, 8
  br i1 %15, label %16, label %25

16:                                               ; preds = %1
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.png_struct_def, ptr %17, i32 0, i32 37
  %19 = load i32, ptr %18, align 8, !tbaa !23
  %20 = zext i32 %19 to i64
  %21 = load i32, ptr %4, align 4, !tbaa !22
  %22 = sext i32 %21 to i64
  %23 = lshr i64 %22, 3
  %24 = mul i64 %20, %23
  br label %35

25:                                               ; preds = %1
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_struct_def, ptr %26, i32 0, i32 37
  %28 = load i32, ptr %27, align 8, !tbaa !23
  %29 = zext i32 %28 to i64
  %30 = load i32, ptr %4, align 4, !tbaa !22
  %31 = sext i32 %30 to i64
  %32 = mul i64 %29, %31
  %33 = add i64 %32, 7
  %34 = lshr i64 %33, 3
  br label %35

35:                                               ; preds = %25, %16
  %36 = phi i64 [ %24, %16 ], [ %34, %25 ]
  %37 = add i64 %36, 1
  store i64 %37, ptr %3, align 8, !tbaa !24
  %38 = load ptr, ptr %2, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 66
  %40 = load i8, ptr %39, align 2, !tbaa !25
  %41 = load ptr, ptr %2, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 71
  store i8 %40, ptr %42, align 1, !tbaa !26
  %43 = load i32, ptr %4, align 4, !tbaa !22
  %44 = trunc i32 %43 to i8
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.png_struct_def, ptr %45, i32 0, i32 70
  store i8 %44, ptr %46, align 2, !tbaa !27
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = load i64, ptr %3, align 8, !tbaa !24
  %49 = call noalias ptr @png_malloc(ptr noundef %47, i64 noundef %48)
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.png_struct_def, ptr %50, i32 0, i32 46
  store ptr %49, ptr %51, align 8, !tbaa !28
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_struct_def, ptr %52, i32 0, i32 46
  %54 = load ptr, ptr %53, align 8, !tbaa !28
  %55 = getelementptr inbounds i8, ptr %54, i64 0
  store i8 0, ptr %55, align 1, !tbaa !29
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.png_struct_def, ptr %56, i32 0, i32 62
  %58 = load i8, ptr %57, align 2, !tbaa !30
  %59 = zext i8 %58 to i32
  %60 = and i32 %59, 16
  %61 = icmp ne i32 %60, 0
  br i1 %61, label %62, label %75

62:                                               ; preds = %35
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 41
  %66 = load i64, ptr %65, align 8, !tbaa !31
  %67 = add i64 %66, 1
  %68 = call noalias ptr @png_malloc(ptr noundef %63, i64 noundef %67)
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_struct_def, ptr %69, i32 0, i32 47
  store ptr %68, ptr %70, align 8, !tbaa !32
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_struct_def, ptr %71, i32 0, i32 47
  %73 = load ptr, ptr %72, align 8, !tbaa !32
  %74 = getelementptr inbounds i8, ptr %73, i64 0
  store i8 1, ptr %74, align 1, !tbaa !29
  br label %75

75:                                               ; preds = %62, %35
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.png_struct_def, ptr %76, i32 0, i32 62
  %78 = load i8, ptr %77, align 2, !tbaa !30
  %79 = zext i8 %78 to i32
  %80 = and i32 %79, 224
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %148

82:                                               ; preds = %75
  %83 = load ptr, ptr %2, align 8, !tbaa !5
  %84 = load i64, ptr %3, align 8, !tbaa !24
  %85 = call noalias ptr @png_calloc(ptr noundef %83, i64 noundef %84)
  %86 = load ptr, ptr %2, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.png_struct_def, ptr %86, i32 0, i32 45
  store ptr %85, ptr %87, align 8, !tbaa !33
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.png_struct_def, ptr %88, i32 0, i32 62
  %90 = load i8, ptr %89, align 2, !tbaa !30
  %91 = zext i8 %90 to i32
  %92 = and i32 %91, 32
  %93 = icmp ne i32 %92, 0
  br i1 %93, label %94, label %107

94:                                               ; preds = %82
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.png_struct_def, ptr %96, i32 0, i32 41
  %98 = load i64, ptr %97, align 8, !tbaa !31
  %99 = add i64 %98, 1
  %100 = call noalias ptr @png_malloc(ptr noundef %95, i64 noundef %99)
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.png_struct_def, ptr %101, i32 0, i32 48
  store ptr %100, ptr %102, align 8, !tbaa !34
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_struct_def, ptr %103, i32 0, i32 48
  %105 = load ptr, ptr %104, align 8, !tbaa !34
  %106 = getelementptr inbounds i8, ptr %105, i64 0
  store i8 2, ptr %106, align 1, !tbaa !29
  br label %107

107:                                              ; preds = %94, %82
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.png_struct_def, ptr %108, i32 0, i32 62
  %110 = load i8, ptr %109, align 2, !tbaa !30
  %111 = zext i8 %110 to i32
  %112 = and i32 %111, 64
  %113 = icmp ne i32 %112, 0
  br i1 %113, label %114, label %127

114:                                              ; preds = %107
  %115 = load ptr, ptr %2, align 8, !tbaa !5
  %116 = load ptr, ptr %2, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.png_struct_def, ptr %116, i32 0, i32 41
  %118 = load i64, ptr %117, align 8, !tbaa !31
  %119 = add i64 %118, 1
  %120 = call noalias ptr @png_malloc(ptr noundef %115, i64 noundef %119)
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.png_struct_def, ptr %121, i32 0, i32 49
  store ptr %120, ptr %122, align 8, !tbaa !35
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 49
  %125 = load ptr, ptr %124, align 8, !tbaa !35
  %126 = getelementptr inbounds i8, ptr %125, i64 0
  store i8 3, ptr %126, align 1, !tbaa !29
  br label %127

127:                                              ; preds = %114, %107
  %128 = load ptr, ptr %2, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 62
  %130 = load i8, ptr %129, align 2, !tbaa !30
  %131 = zext i8 %130 to i32
  %132 = and i32 %131, 128
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %147

134:                                              ; preds = %127
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = load ptr, ptr %2, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.png_struct_def, ptr %136, i32 0, i32 41
  %138 = load i64, ptr %137, align 8, !tbaa !31
  %139 = add i64 %138, 1
  %140 = call noalias ptr @png_malloc(ptr noundef %135, i64 noundef %139)
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.png_struct_def, ptr %141, i32 0, i32 50
  store ptr %140, ptr %142, align 8, !tbaa !36
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.png_struct_def, ptr %143, i32 0, i32 50
  %145 = load ptr, ptr %144, align 8, !tbaa !36
  %146 = getelementptr inbounds i8, ptr %145, i64 0
  store i8 4, ptr %146, align 1, !tbaa !29
  br label %147

147:                                              ; preds = %134, %127
  br label %148

148:                                              ; preds = %147, %75
  %149 = load ptr, ptr %2, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.png_struct_def, ptr %149, i32 0, i32 60
  %151 = load i8, ptr %150, align 4, !tbaa !37
  %152 = zext i8 %151 to i32
  %153 = icmp ne i32 %152, 0
  br i1 %153, label %154, label %203

154:                                              ; preds = %148
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_struct_def, ptr %155, i32 0, i32 17
  %157 = load i32, ptr %156, align 4, !tbaa !38
  %158 = and i32 %157, 2
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %191

160:                                              ; preds = %154
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.png_struct_def, ptr %161, i32 0, i32 38
  %163 = load i32, ptr %162, align 4, !tbaa !39
  %164 = load i8, ptr @png_write_start_row.png_pass_yinc, align 1, !tbaa !29
  %165 = zext i8 %164 to i32
  %166 = add i32 %163, %165
  %167 = sub i32 %166, 1
  %168 = load i8, ptr @png_write_start_row.png_pass_ystart, align 1, !tbaa !29
  %169 = zext i8 %168 to i32
  %170 = sub i32 %167, %169
  %171 = load i8, ptr @png_write_start_row.png_pass_yinc, align 1, !tbaa !29
  %172 = zext i8 %171 to i32
  %173 = udiv i32 %170, %172
  %174 = load ptr, ptr %2, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.png_struct_def, ptr %174, i32 0, i32 39
  store i32 %173, ptr %175, align 8, !tbaa !40
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.png_struct_def, ptr %176, i32 0, i32 37
  %178 = load i32, ptr %177, align 8, !tbaa !23
  %179 = load i8, ptr @png_write_start_row.png_pass_inc, align 1, !tbaa !29
  %180 = zext i8 %179 to i32
  %181 = add i32 %178, %180
  %182 = sub i32 %181, 1
  %183 = load i8, ptr @png_write_start_row.png_pass_start, align 1, !tbaa !29
  %184 = zext i8 %183 to i32
  %185 = sub i32 %182, %184
  %186 = load i8, ptr @png_write_start_row.png_pass_inc, align 1, !tbaa !29
  %187 = zext i8 %186 to i32
  %188 = udiv i32 %185, %187
  %189 = load ptr, ptr %2, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.png_struct_def, ptr %189, i32 0, i32 40
  store i32 %188, ptr %190, align 4, !tbaa !41
  br label %202

191:                                              ; preds = %154
  %192 = load ptr, ptr %2, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.png_struct_def, ptr %192, i32 0, i32 38
  %194 = load i32, ptr %193, align 4, !tbaa !39
  %195 = load ptr, ptr %2, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.png_struct_def, ptr %195, i32 0, i32 39
  store i32 %194, ptr %196, align 8, !tbaa !40
  %197 = load ptr, ptr %2, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.png_struct_def, ptr %197, i32 0, i32 37
  %199 = load i32, ptr %198, align 8, !tbaa !23
  %200 = load ptr, ptr %2, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.png_struct_def, ptr %200, i32 0, i32 40
  store i32 %199, ptr %201, align 4, !tbaa !41
  br label %202

202:                                              ; preds = %191, %160
  br label %214

203:                                              ; preds = %148
  %204 = load ptr, ptr %2, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.png_struct_def, ptr %204, i32 0, i32 38
  %206 = load i32, ptr %205, align 4, !tbaa !39
  %207 = load ptr, ptr %2, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.png_struct_def, ptr %207, i32 0, i32 39
  store i32 %206, ptr %208, align 8, !tbaa !40
  %209 = load ptr, ptr %2, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.png_struct_def, ptr %209, i32 0, i32 37
  %211 = load i32, ptr %210, align 8, !tbaa !23
  %212 = load ptr, ptr %2, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.png_struct_def, ptr %212, i32 0, i32 40
  store i32 %211, ptr %213, align 4, !tbaa !41
  br label %214

214:                                              ; preds = %203, %202
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret void
}

declare noalias ptr @png_calloc(ptr noundef, i64 noundef) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !7, i64 636}
!10 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !11, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !12, i64 300, !12, i64 304, !12, i64 308, !12, i64 312, !13, i64 320, !6, i64 432, !12, i64 440, !12, i64 444, !12, i64 448, !12, i64 452, !12, i64 456, !12, i64 460, !12, i64 464, !12, i64 468, !12, i64 472, !12, i64 476, !12, i64 480, !12, i64 484, !12, i64 488, !12, i64 492, !12, i64 496, !12, i64 500, !12, i64 504, !12, i64 508, !12, i64 512, !12, i64 516, !11, i64 520, !12, i64 528, !12, i64 532, !12, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !6, i64 576, !6, i64 584, !11, i64 592, !12, i64 600, !12, i64 604, !6, i64 608, !14, i64 616, !12, i64 620, !14, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !14, i64 640, !7, i64 642, !12, i64 644, !15, i64 648, !15, i64 658, !6, i64 672, !12, i64 680, !12, i64 684, !12, i64 688, !12, i64 692, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !16, i64 744, !16, i64 749, !6, i64 760, !15, i64 768, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !12, i64 856, !12, i64 860, !11, i64 864, !11, i64 872, !11, i64 880, !11, i64 888, !12, i64 896, !12, i64 900, !6, i64 904, !6, i64 912, !7, i64 920, !7, i64 921, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !7, i64 968, !7, i64 969, !12, i64 1000, !6, i64 1008, !6, i64 1016, !12, i64 1024, !12, i64 1028, !6, i64 1032, !7, i64 1040, !7, i64 1041, !14, i64 1042, !14, i64 1044, !12, i64 1048, !7, i64 1052, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !6, i64 1104, !7, i64 1112, !12, i64 1116, !12, i64 1120, !12, i64 1124, !11, i64 1128, !17, i64 1136, !11, i64 1168, !6, i64 1176, !11, i64 1184, !12, i64 1192, !12, i64 1196, !6, i64 1200, !7, i64 1208, !18, i64 1240}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"z_stream_s", !6, i64 0, !12, i64 8, !11, i64 16, !6, i64 24, !12, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !11, i64 96, !11, i64 104}
!14 = !{!"short", !7, i64 0}
!15 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!16 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!17 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!18 = !{!"png_colorspace", !12, i64 0, !19, i64 4, !20, i64 36, !14, i64 72, !14, i64 74}
!19 = !{!"png_xy", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!20 = !{!"png_XYZ", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32}
!21 = !{!10, !7, i64 633}
!22 = !{!12, !12, i64 0}
!23 = !{!10, !12, i64 504}
!24 = !{!11, !11, i64 0}
!25 = !{!10, !7, i64 634}
!26 = !{!10, !7, i64 639}
!27 = !{!10, !7, i64 638}
!28 = !{!10, !6, i64 552}
!29 = !{!7, !7, i64 0}
!30 = !{!10, !7, i64 630}
!31 = !{!10, !11, i64 520}
!32 = !{!10, !6, i64 560}
!33 = !{!10, !6, i64 544}
!34 = !{!10, !6, i64 568}
!35 = !{!10, !6, i64 576}
!36 = !{!10, !6, i64 584}
!37 = !{!10, !7, i64 628}
!38 = !{!10, !12, i64 308}
!39 = !{!10, !12, i64 508}
!40 = !{!10, !12, i64 512}
!41 = !{!10, !12, i64 516}


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

@png_write_start_row.png_pass_start = external hidden local_unnamed_addr constant [7 x i8], align 1
@png_write_start_row.png_pass_inc = external hidden local_unnamed_addr constant [7 x i8], align 1
@png_write_start_row.png_pass_ystart = external hidden local_unnamed_addr constant [7 x i8], align 1
@png_write_start_row.png_pass_yinc = external hidden local_unnamed_addr constant [7 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_start_row(ptr noalias noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 636
  %3 = load i8, ptr %2, align 4, !tbaa !5
  %4 = zext i8 %3 to i32
  %5 = getelementptr inbounds i8, ptr %0, i64 633
  %6 = load i8, ptr %5, align 1, !tbaa !20
  %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 504
  %11 = load i32, ptr %10, align 8, !tbaa !21
  %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 = getelementptr inbounds i8, ptr %0, i64 634
  %26 = load i8, ptr %25, align 2, !tbaa !22
  %27 = getelementptr inbounds i8, ptr %0, i64 639
  store i8 %26, ptr %27, align 1, !tbaa !23
  %28 = trunc i32 %8 to i8
  %29 = getelementptr inbounds i8, ptr %0, i64 638
  store i8 %28, ptr %29, align 2, !tbaa !24
  %30 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %24) #2
  %31 = getelementptr inbounds i8, ptr %0, i64 552
  store ptr %30, ptr %31, align 8, !tbaa !25
  store i8 0, ptr %30, align 1, !tbaa !26
  %32 = getelementptr inbounds i8, ptr %0, i64 630
  %33 = load i8, ptr %32, align 2, !tbaa !27
  %34 = and i8 %33, 16
  %.not = icmp eq i8 %34, 0
  br i1 %.not, label %41, label %35

35:                                               ; preds = %22
  %36 = getelementptr inbounds i8, ptr %0, i64 520
  %37 = load i64, ptr %36, align 8, !tbaa !28
  %38 = add i64 %37, 1
  %39 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %38) #2
  %40 = getelementptr inbounds i8, ptr %0, i64 560
  store ptr %39, ptr %40, align 8, !tbaa !29
  store i8 1, ptr %39, align 1, !tbaa !26
  %.pr = load i8, ptr %32, align 2, !tbaa !27
  br label %41

41:                                               ; preds = %35, %22
  %42 = phi i8 [ %.pr, %35 ], [ %33, %22 ]
  %.not52 = icmp ult i8 %42, 32
  br i1 %.not52, label %71, label %43

43:                                               ; preds = %41
  %44 = tail call noalias ptr @png_calloc(ptr noundef nonnull %0, i64 noundef %24) #2
  %45 = getelementptr inbounds i8, ptr %0, i64 544
  store ptr %44, ptr %45, align 8, !tbaa !30
  %46 = load i8, ptr %32, align 2, !tbaa !27
  %47 = and i8 %46, 32
  %.not53 = icmp eq i8 %47, 0
  br i1 %.not53, label %54, label %48

48:                                               ; preds = %43
  %49 = getelementptr inbounds i8, ptr %0, i64 520
  %50 = load i64, ptr %49, align 8, !tbaa !28
  %51 = add i64 %50, 1
  %52 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %51) #2
  %53 = getelementptr inbounds i8, ptr %0, i64 568
  store ptr %52, ptr %53, align 8, !tbaa !31
  store i8 2, ptr %52, align 1, !tbaa !26
  %.pre = load i8, ptr %32, align 2, !tbaa !27
  br label %54

54:                                               ; preds = %48, %43
  %55 = phi i8 [ %.pre, %48 ], [ %46, %43 ]
  %56 = and i8 %55, 64
  %.not54 = icmp eq i8 %56, 0
  br i1 %.not54, label %63, label %57

57:                                               ; preds = %54
  %58 = getelementptr inbounds i8, ptr %0, i64 520
  %59 = load i64, ptr %58, align 8, !tbaa !28
  %60 = add i64 %59, 1
  %61 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %60) #2
  %62 = getelementptr inbounds i8, ptr %0, i64 576
  store ptr %61, ptr %62, align 8, !tbaa !32
  store i8 3, ptr %61, align 1, !tbaa !26
  %.pr57 = load i8, ptr %32, align 2, !tbaa !27
  br label %63

63:                                               ; preds = %57, %54
  %64 = phi i8 [ %.pr57, %57 ], [ %55, %54 ]
  %.not55 = icmp sgt i8 %64, -1
  br i1 %.not55, label %71, label %65

65:                                               ; preds = %63
  %66 = getelementptr inbounds i8, ptr %0, i64 520
  %67 = load i64, ptr %66, align 8, !tbaa !28
  %68 = add i64 %67, 1
  %69 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %68) #2
  %70 = getelementptr inbounds i8, ptr %0, i64 584
  store ptr %69, ptr %70, align 8, !tbaa !33
  store i8 4, ptr %69, align 1, !tbaa !26
  br label %71

71:                                               ; preds = %63, %65, %41
  %72 = getelementptr inbounds i8, ptr %0, i64 628
  %73 = load i8, ptr %72, align 4, !tbaa !34
  %.not56 = icmp eq i8 %73, 0
  br i1 %.not56, label %105, label %74

74:                                               ; preds = %71
  %75 = getelementptr inbounds i8, ptr %0, i64 308
  %76 = load i32, ptr %75, align 4, !tbaa !35
  %77 = and i32 %76, 2
  %78 = icmp eq i32 %77, 0
  %79 = getelementptr inbounds i8, ptr %0, i64 508
  %80 = load i32, ptr %79, align 4, !tbaa !36
  br i1 %78, label %81, label %101

81:                                               ; preds = %74
  %82 = load i8, ptr @png_write_start_row.png_pass_yinc, align 1, !tbaa !26
  %83 = zext i8 %82 to i32
  %84 = add i32 %80, %83
  %85 = load i8, ptr @png_write_start_row.png_pass_ystart, align 1, !tbaa !26
  %86 = zext i8 %85 to i32
  %87 = xor i32 %86, -1
  %88 = add i32 %84, %87
  %89 = udiv i32 %88, %83
  %90 = getelementptr inbounds i8, ptr %0, i64 512
  store i32 %89, ptr %90, align 8, !tbaa !37
  %91 = getelementptr inbounds i8, ptr %0, i64 504
  %92 = load i32, ptr %91, align 8, !tbaa !21
  %93 = load i8, ptr @png_write_start_row.png_pass_inc, align 1, !tbaa !26
  %94 = zext i8 %93 to i32
  %95 = add i32 %92, %94
  %96 = load i8, ptr @png_write_start_row.png_pass_start, align 1, !tbaa !26
  %97 = zext i8 %96 to i32
  %98 = xor i32 %97, -1
  %99 = add i32 %95, %98
  %100 = udiv i32 %99, %94
  br label %111

101:                                              ; preds = %74
  %102 = getelementptr inbounds i8, ptr %0, i64 512
  store i32 %80, ptr %102, align 8, !tbaa !37
  %103 = getelementptr inbounds i8, ptr %0, i64 504
  %104 = load i32, ptr %103, align 8, !tbaa !21
  br label %111

105:                                              ; preds = %71
  %106 = getelementptr inbounds i8, ptr %0, i64 508
  %107 = load i32, ptr %106, align 4, !tbaa !36
  %108 = getelementptr inbounds i8, ptr %0, i64 512
  store i32 %107, ptr %108, align 8, !tbaa !37
  %109 = getelementptr inbounds i8, ptr %0, i64 504
  %110 = load i32, ptr %109, align 8, !tbaa !21
  br label %111

111:                                              ; preds = %81, %101, %105
  %.sink = phi i32 [ %100, %81 ], [ %104, %101 ], [ %110, %105 ]
  %112 = getelementptr inbounds i8, ptr %0, i64 516
  store i32 %.sink, ptr %112, align 4, !tbaa !38
  ret void
}

declare noalias 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 636}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !10, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !9, i64 280, !9, i64 288, !7, i64 296, !7, i64 297, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !12, i64 320, !9, i64 432, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !11, i64 460, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !11, i64 512, !11, i64 516, !10, i64 520, !11, i64 528, !11, i64 532, !11, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !9, i64 568, !9, i64 576, !9, i64 584, !10, i64 592, !11, i64 600, !11, i64 604, !9, i64 608, !13, i64 616, !11, i64 620, !13, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !13, i64 640, !7, i64 642, !11, i64 644, !14, i64 648, !14, i64 658, !9, i64 672, !11, i64 680, !11, i64 684, !11, i64 688, !11, i64 692, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !15, i64 744, !15, i64 749, !9, i64 760, !14, i64 768, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !11, i64 856, !11, i64 860, !10, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !11, i64 896, !11, i64 900, !9, i64 904, !9, i64 912, !7, i64 920, !7, i64 921, !9, i64 928, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !7, i64 968, !7, i64 969, !11, i64 1000, !9, i64 1008, !9, i64 1016, !11, i64 1024, !11, i64 1028, !9, i64 1032, !7, i64 1040, !7, i64 1041, !13, i64 1042, !13, i64 1044, !11, i64 1048, !7, i64 1052, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !9, i64 1104, !7, i64 1112, !11, i64 1116, !11, i64 1120, !11, i64 1124, !10, i64 1128, !16, i64 1136, !10, i64 1168, !9, i64 1176, !10, i64 1184, !11, i64 1192, !11, i64 1196, !9, i64 1200, !7, i64 1208, !17, i64 1240}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !9, i64 0, !11, i64 8, !10, i64 16, !9, i64 24, !11, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !11, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!"short", !7, i64 0}
!14 = !{!"png_color_16_struct", !7, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!15 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!16 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!17 = !{!"png_colorspace", !11, i64 0, !18, i64 4, !19, i64 36, !13, i64 72, !13, i64 74}
!18 = !{!"png_xy", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!19 = !{!"png_XYZ", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!20 = !{!6, !7, i64 633}
!21 = !{!6, !11, i64 504}
!22 = !{!6, !7, i64 634}
!23 = !{!6, !7, i64 639}
!24 = !{!6, !7, i64 638}
!25 = !{!6, !9, i64 552}
!26 = !{!7, !7, i64 0}
!27 = !{!6, !7, i64 630}
!28 = !{!6, !10, i64 520}
!29 = !{!6, !9, i64 560}
!30 = !{!6, !9, i64 544}
!31 = !{!6, !9, i64 568}
!32 = !{!6, !9, i64 576}
!33 = !{!6, !9, i64 584}
!34 = !{!6, !7, i64 628}
!35 = !{!6, !11, i64 308}
!36 = !{!6, !11, i64 508}
!37 = !{!6, !11, i64 512}
!38 = !{!6, !11, i64 516}


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