; LLVM IR from Try/Tempest :: Engine/thirdparty/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, i64, i32, i32, ptr, i16, i32, i16, i8, 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, i32, [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
  %5 = alloca i8, align 1
  %6 = 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
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #3
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.png_struct_def, ptr %7, i32 0, i32 66
  %9 = load i8, ptr %8, align 4, !tbaa !9
  %10 = zext i8 %9 to i32
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.png_struct_def, ptr %11, i32 0, i32 63
  %13 = load i8, ptr %12, align 1, !tbaa !21
  %14 = zext i8 %13 to i32
  %15 = mul nsw i32 %10, %14
  store i32 %15, ptr %4, align 4, !tbaa !22
  %16 = load i32, ptr %4, align 4, !tbaa !22
  %17 = icmp sge i32 %16, 8
  br i1 %17, label %18, label %27

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

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

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

65:                                               ; preds = %37
  %66 = load i8, ptr %5, align 1, !tbaa !29
  %67 = zext i8 %66 to i32
  %68 = and i32 %67, 31
  %69 = trunc i32 %68 to i8
  store i8 %69, ptr %5, align 1, !tbaa !29
  br label %70

70:                                               ; preds = %65, %37
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_struct_def, ptr %71, i32 0, i32 37
  %73 = load i32, ptr %72, align 8, !tbaa !23
  %74 = icmp eq i32 %73, 1
  br i1 %74, label %75, label %80

75:                                               ; preds = %70
  %76 = load i8, ptr %5, align 1, !tbaa !29
  %77 = zext i8 %76 to i32
  %78 = and i32 %77, 47
  %79 = trunc i32 %78 to i8
  store i8 %79, ptr %5, align 1, !tbaa !29
  br label %80

80:                                               ; preds = %75, %70
  %81 = load i8, ptr %5, align 1, !tbaa !29
  %82 = zext i8 %81 to i32
  %83 = icmp eq i32 %82, 0
  br i1 %83, label %84, label %85

84:                                               ; preds = %80
  store i8 8, ptr %5, align 1, !tbaa !29
  br label %85

85:                                               ; preds = %84, %80
  %86 = load i8, ptr %5, align 1, !tbaa !29
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.png_struct_def, ptr %87, i32 0, i32 60
  store i8 %86, ptr %88, align 2, !tbaa !30
  %89 = load i8, ptr %5, align 1, !tbaa !29
  %90 = zext i8 %89 to i32
  %91 = and i32 %90, 240
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %145

93:                                               ; preds = %85
  %94 = load ptr, ptr %2, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.png_struct_def, ptr %94, i32 0, i32 47
  %96 = load ptr, ptr %95, align 8, !tbaa !32
  %97 = icmp eq ptr %96, null
  br i1 %97, label %98, label %145

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !22
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = load i64, ptr %3, align 8, !tbaa !24
  %101 = call noalias ptr @png_malloc(ptr noundef %99, i64 noundef %100)
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.png_struct_def, ptr %102, i32 0, i32 47
  store ptr %101, ptr %103, align 8, !tbaa !32
  %104 = load i8, ptr %5, align 1, !tbaa !29
  %105 = zext i8 %104 to i32
  %106 = and i32 %105, 16
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %111

108:                                              ; preds = %98
  %109 = load i32, ptr %6, align 4, !tbaa !22
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %6, align 4, !tbaa !22
  br label %111

111:                                              ; preds = %108, %98
  %112 = load i8, ptr %5, align 1, !tbaa !29
  %113 = zext i8 %112 to i32
  %114 = and i32 %113, 32
  %115 = icmp ne i32 %114, 0
  br i1 %115, label %116, label %119

116:                                              ; preds = %111
  %117 = load i32, ptr %6, align 4, !tbaa !22
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %6, align 4, !tbaa !22
  br label %119

119:                                              ; preds = %116, %111
  %120 = load i8, ptr %5, align 1, !tbaa !29
  %121 = zext i8 %120 to i32
  %122 = and i32 %121, 64
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %127

124:                                              ; preds = %119
  %125 = load i32, ptr %6, align 4, !tbaa !22
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %6, align 4, !tbaa !22
  br label %127

127:                                              ; preds = %124, %119
  %128 = load i8, ptr %5, align 1, !tbaa !29
  %129 = zext i8 %128 to i32
  %130 = and i32 %129, 128
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %135

132:                                              ; preds = %127
  %133 = load i32, ptr %6, align 4, !tbaa !22
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %6, align 4, !tbaa !22
  br label %135

135:                                              ; preds = %132, %127
  %136 = load i32, ptr %6, align 4, !tbaa !22
  %137 = icmp sgt i32 %136, 1
  br i1 %137, label %138, label %144

138:                                              ; preds = %135
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  %140 = load i64, ptr %3, align 8, !tbaa !24
  %141 = call noalias ptr @png_malloc(ptr noundef %139, i64 noundef %140)
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.png_struct_def, ptr %142, i32 0, i32 48
  store ptr %141, ptr %143, align 8, !tbaa !33
  br label %144

144:                                              ; preds = %138, %135
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %145

145:                                              ; preds = %144, %93, %85
  %146 = load i8, ptr %5, align 1, !tbaa !29
  %147 = zext i8 %146 to i32
  %148 = and i32 %147, 224
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %156

150:                                              ; preds = %145
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  %152 = load i64, ptr %3, align 8, !tbaa !24
  %153 = call noalias ptr @png_calloc(ptr noundef %151, i64 noundef %152)
  %154 = load ptr, ptr %2, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.png_struct_def, ptr %154, i32 0, i32 45
  store ptr %153, ptr %155, align 8, !tbaa !34
  br label %156

156:                                              ; preds = %150, %145
  %157 = load ptr, ptr %2, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.png_struct_def, ptr %157, i32 0, i32 58
  %159 = load i8, ptr %158, align 4, !tbaa !35
  %160 = zext i8 %159 to i32
  %161 = icmp ne i32 %160, 0
  br i1 %161, label %162, label %211

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

168:                                              ; preds = %162
  %169 = load ptr, ptr %2, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.png_struct_def, ptr %169, i32 0, i32 38
  %171 = load i32, ptr %170, align 4, !tbaa !31
  %172 = load i8, ptr @png_write_start_row.png_pass_yinc, align 1, !tbaa !29
  %173 = zext i8 %172 to i32
  %174 = add i32 %171, %173
  %175 = sub i32 %174, 1
  %176 = load i8, ptr @png_write_start_row.png_pass_ystart, align 1, !tbaa !29
  %177 = zext i8 %176 to i32
  %178 = sub i32 %175, %177
  %179 = load i8, ptr @png_write_start_row.png_pass_yinc, align 1, !tbaa !29
  %180 = zext i8 %179 to i32
  %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 39
  store i32 %181, ptr %183, align 8, !tbaa !37
  %184 = load ptr, ptr %2, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.png_struct_def, ptr %184, i32 0, i32 37
  %186 = load i32, ptr %185, align 8, !tbaa !23
  %187 = load i8, ptr @png_write_start_row.png_pass_inc, align 1, !tbaa !29
  %188 = zext i8 %187 to i32
  %189 = add i32 %186, %188
  %190 = sub i32 %189, 1
  %191 = load i8, ptr @png_write_start_row.png_pass_start, align 1, !tbaa !29
  %192 = zext i8 %191 to i32
  %193 = sub i32 %190, %192
  %194 = load i8, ptr @png_write_start_row.png_pass_inc, align 1, !tbaa !29
  %195 = zext i8 %194 to i32
  %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 40
  store i32 %196, ptr %198, align 4, !tbaa !38
  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 38
  %202 = load i32, ptr %201, align 4, !tbaa !31
  %203 = load ptr, ptr %2, align 8, !tbaa !5
  %204 = getelementptr inbounds %struct.png_struct_def, ptr %203, i32 0, i32 39
  store i32 %202, ptr %204, align 8, !tbaa !37
  %205 = load ptr, ptr %2, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.png_struct_def, ptr %205, i32 0, i32 37
  %207 = load i32, ptr %206, align 8, !tbaa !23
  %208 = load ptr, ptr %2, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.png_struct_def, ptr %208, i32 0, i32 40
  store i32 %207, ptr %209, align 4, !tbaa !38
  br label %210

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

211:                                              ; preds = %156
  %212 = load ptr, ptr %2, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.png_struct_def, ptr %212, i32 0, i32 38
  %214 = load i32, ptr %213, align 4, !tbaa !31
  %215 = load ptr, ptr %2, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.png_struct_def, ptr %215, i32 0, i32 39
  store i32 %214, ptr %216, align 8, !tbaa !37
  %217 = load ptr, ptr %2, align 8, !tbaa !5
  %218 = getelementptr inbounds %struct.png_struct_def, ptr %217, i32 0, i32 37
  %219 = load i32, ptr %218, align 8, !tbaa !23
  %220 = load ptr, ptr %2, align 8, !tbaa !5
  %221 = getelementptr inbounds %struct.png_struct_def, ptr %220, i32 0, i32 40
  store i32 %219, ptr %221, align 4, !tbaa !38
  br label %222

222:                                              ; preds = %211, %210
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #3
  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 620}
!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, !11, i64 576, !12, i64 584, !12, i64 588, !6, i64 592, !14, i64 600, !12, i64 604, !14, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !14, i64 626, !7, i64 628, !12, i64 632, !15, i64 636, !15, i64 646, !6, i64 656, !12, i64 664, !12, i64 668, !12, i64 672, !12, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !16, i64 728, !16, i64 733, !6, i64 744, !15, i64 752, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !12, i64 840, !12, i64 844, !11, i64 848, !11, i64 856, !11, i64 864, !11, i64 872, !12, i64 880, !12, i64 884, !6, i64 888, !6, i64 896, !12, i64 904, !7, i64 908, !12, i64 940, !6, i64 944, !6, i64 952, !12, i64 960, !12, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !14, i64 978, !14, i64 980, !12, i64 984, !7, i64 988, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !7, i64 1048, !12, i64 1052, !12, i64 1056, !12, i64 1060, !11, i64 1064, !17, i64 1072, !11, i64 1104, !6, i64 1112, !11, i64 1120, !12, i64 1128, !12, i64 1132, !6, i64 1136, !7, i64 1144, !18, i64 1176}
!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 617}
!22 = !{!12, !12, i64 0}
!23 = !{!10, !12, i64 504}
!24 = !{!11, !11, i64 0}
!25 = !{!10, !7, i64 618}
!26 = !{!10, !7, i64 623}
!27 = !{!10, !7, i64 622}
!28 = !{!10, !6, i64 552}
!29 = !{!7, !7, i64 0}
!30 = !{!10, !7, i64 614}
!31 = !{!10, !12, i64 508}
!32 = !{!10, !6, i64 560}
!33 = !{!10, !6, i64 568}
!34 = !{!10, !6, i64 544}
!35 = !{!10, !7, i64 612}
!36 = !{!10, !12, i64 308}
!37 = !{!10, !12, i64 512}
!38 = !{!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 620
  %3 = load i8, ptr %2, align 4, !tbaa !5
  %4 = zext i8 %3 to i32
  %5 = getelementptr inbounds i8, ptr %0, i64 617
  %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 618
  %26 = load i8, ptr %25, align 2, !tbaa !22
  %27 = getelementptr inbounds i8, ptr %0, i64 623
  store i8 %26, ptr %27, align 1, !tbaa !23
  %28 = trunc i32 %8 to i8
  %29 = getelementptr inbounds i8, ptr %0, i64 622
  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 614
  %33 = load i8, ptr %32, align 2, !tbaa !27
  %34 = getelementptr inbounds i8, ptr %0, i64 508
  %35 = load i32, ptr %34, align 4, !tbaa !28
  %36 = icmp eq i32 %35, 1
  %37 = and i8 %33, 31
  %spec.select = select i1 %36, i8 %37, i8 %33
  %38 = getelementptr inbounds i8, ptr %0, i64 504
  %39 = load i32, ptr %38, align 8, !tbaa !21
  %40 = icmp eq i32 %39, 1
  %41 = and i8 %spec.select, 47
  %.158 = select i1 %40, i8 %41, i8 %spec.select
  %42 = icmp eq i8 %.158, 0
  %spec.store.select = select i1 %42, i8 8, i8 %.158
  store i8 %spec.store.select, ptr %32, align 2, !tbaa !27
  %43 = zext i8 %spec.store.select to i32
  %.not = icmp ult i8 %spec.store.select, 16
  br i1 %.not, label %.thread, label %44

44:                                               ; preds = %22
  %45 = getelementptr inbounds i8, ptr %0, i64 560
  %46 = load ptr, ptr %45, align 8, !tbaa !29
  %47 = icmp eq ptr %46, null
  br i1 %47, label %48, label %60

48:                                               ; preds = %44
  %49 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %24) #2
  store ptr %49, ptr %45, align 8, !tbaa !29
  %50 = lshr i32 %43, 4
  %.lobit = and i32 %50, 1
  %51 = lshr i32 %43, 5
  %52 = and i32 %51, 1
  %53 = lshr i32 %43, 6
  %54 = and i32 %53, 1
  %spec.store.select.lobit = lshr i8 %spec.store.select, 7
  %55 = zext nneg i8 %spec.store.select.lobit to i32
  %.1 = add nuw nsw i32 %52, %55
  %.2 = add nuw nsw i32 %.1, %.lobit
  %.3 = add nuw nsw i32 %.2, %54
  %56 = icmp ugt i32 %.3, 1
  br i1 %56, label %57, label %60

57:                                               ; preds = %48
  %58 = tail call noalias ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %24) #2
  %59 = getelementptr inbounds i8, ptr %0, i64 568
  store ptr %58, ptr %59, align 8, !tbaa !30
  br label %60

60:                                               ; preds = %48, %57, %44
  %.not65 = icmp ult i8 %spec.store.select, 32
  br i1 %.not65, label %.thread, label %61

61:                                               ; preds = %60
  %62 = tail call noalias ptr @png_calloc(ptr noundef nonnull %0, i64 noundef %24) #2
  %63 = getelementptr inbounds i8, ptr %0, i64 544
  store ptr %62, ptr %63, align 8, !tbaa !31
  br label %.thread

.thread:                                          ; preds = %22, %61, %60
  %64 = getelementptr inbounds i8, ptr %0, i64 612
  %65 = load i8, ptr %64, align 4, !tbaa !32
  %.not66 = icmp eq i8 %65, 0
  br i1 %.not66, label %94, label %66

66:                                               ; preds = %.thread
  %67 = getelementptr inbounds i8, ptr %0, i64 308
  %68 = load i32, ptr %67, align 4, !tbaa !33
  %69 = and i32 %68, 2
  %70 = icmp eq i32 %69, 0
  %71 = load i32, ptr %34, align 4, !tbaa !28
  br i1 %70, label %72, label %91

72:                                               ; preds = %66
  %73 = load i8, ptr @png_write_start_row.png_pass_yinc, align 1, !tbaa !26
  %74 = zext i8 %73 to i32
  %75 = add i32 %71, %74
  %76 = load i8, ptr @png_write_start_row.png_pass_ystart, align 1, !tbaa !26
  %77 = zext i8 %76 to i32
  %78 = xor i32 %77, -1
  %79 = add i32 %75, %78
  %80 = udiv i32 %79, %74
  %81 = getelementptr inbounds i8, ptr %0, i64 512
  store i32 %80, ptr %81, align 8, !tbaa !34
  %82 = load i32, ptr %38, align 8, !tbaa !21
  %83 = load i8, ptr @png_write_start_row.png_pass_inc, align 1, !tbaa !26
  %84 = zext i8 %83 to i32
  %85 = add i32 %82, %84
  %86 = load i8, ptr @png_write_start_row.png_pass_start, align 1, !tbaa !26
  %87 = zext i8 %86 to i32
  %88 = xor i32 %87, -1
  %89 = add i32 %85, %88
  %90 = udiv i32 %89, %84
  br label %98

91:                                               ; preds = %66
  %92 = getelementptr inbounds i8, ptr %0, i64 512
  store i32 %71, ptr %92, align 8, !tbaa !34
  %93 = load i32, ptr %38, align 8, !tbaa !21
  br label %98

94:                                               ; preds = %.thread
  %95 = load i32, ptr %34, align 4, !tbaa !28
  %96 = getelementptr inbounds i8, ptr %0, i64 512
  store i32 %95, ptr %96, align 8, !tbaa !34
  %97 = load i32, ptr %38, align 8, !tbaa !21
  br label %98

98:                                               ; preds = %72, %91, %94
  %.sink = phi i32 [ %90, %72 ], [ %93, %91 ], [ %97, %94 ]
  %99 = getelementptr inbounds i8, ptr %0, i64 516
  store i32 %.sink, ptr %99, align 4, !tbaa !35
  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 620}
!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, !10, i64 576, !11, i64 584, !11, i64 588, !9, i64 592, !13, i64 600, !11, i64 604, !13, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !13, i64 626, !7, i64 628, !11, i64 632, !14, i64 636, !14, i64 646, !9, i64 656, !11, i64 664, !11, i64 668, !11, i64 672, !11, i64 676, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !15, i64 728, !15, i64 733, !9, i64 744, !14, i64 752, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !11, i64 840, !11, i64 844, !10, i64 848, !10, i64 856, !10, i64 864, !10, i64 872, !11, i64 880, !11, i64 884, !9, i64 888, !9, i64 896, !11, i64 904, !7, i64 908, !11, i64 940, !9, i64 944, !9, i64 952, !11, i64 960, !11, i64 964, !9, i64 968, !7, i64 976, !7, i64 977, !13, i64 978, !13, i64 980, !11, i64 984, !7, i64 988, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !9, i64 1040, !7, i64 1048, !11, i64 1052, !11, i64 1056, !11, i64 1060, !10, i64 1064, !16, i64 1072, !10, i64 1104, !9, i64 1112, !10, i64 1120, !11, i64 1128, !11, i64 1132, !9, i64 1136, !7, i64 1144, !17, i64 1176}
!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 617}
!21 = !{!6, !11, i64 504}
!22 = !{!6, !7, i64 618}
!23 = !{!6, !7, i64 623}
!24 = !{!6, !7, i64 622}
!25 = !{!6, !9, i64 552}
!26 = !{!7, !7, i64 0}
!27 = !{!6, !7, i64 614}
!28 = !{!6, !11, i64 508}
!29 = !{!6, !9, i64 560}
!30 = !{!6, !9, i64 568}
!31 = !{!6, !9, i64 544}
!32 = !{!6, !7, i64 612}
!33 = !{!6, !11, i64 308}
!34 = !{!6, !11, i64 512}
!35 = !{!6, !11, i64 516}


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