; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (pngrutil)

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_read_finish_IDAT(ptr noalias noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @png_read_finish_row(ptr noalias noundef %0) #1 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.png_struct_def, ptr %3, i32 0, i32 43
  %5 = load i32, ptr %4, align 4, !tbaa !9
  %6 = add i32 %5, 1
  store i32 %6, ptr %4, align 4, !tbaa !9
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.png_struct_def, ptr %7, i32 0, i32 43
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.png_struct_def, ptr %10, i32 0, i32 39
  %12 = load i32, ptr %11, align 8, !tbaa !21
  %13 = icmp ult i32 %9, %12
  br i1 %13, label %14, label %15

14:                                               ; preds = %1
  br label %133

15:                                               ; preds = %1
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.png_struct_def, ptr %16, i32 0, i32 58
  %18 = load i8, ptr %17, align 4, !tbaa !22
  %19 = zext i8 %18 to i32
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %131

21:                                               ; preds = %15
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.png_struct_def, ptr %22, i32 0, i32 43
  store i32 0, ptr %23, align 4, !tbaa !9
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.png_struct_def, ptr %24, i32 0, i32 45
  %26 = load ptr, ptr %25, align 8, !tbaa !23
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 41
  %29 = load i64, ptr %28, align 8, !tbaa !24
  %30 = add i64 %29, 1
  call void @llvm.memset.p0.i64(ptr align 1 %26, i8 0, i64 %30, i1 false)
  br label %31

31:                                               ; preds = %121, %21
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.png_struct_def, ptr %32, i32 0, i32 59
  %34 = load i8, ptr %33, align 1, !tbaa !25
  %35 = add i8 %34, 1
  store i8 %35, ptr %33, align 1, !tbaa !25
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.png_struct_def, ptr %36, i32 0, i32 59
  %38 = load i8, ptr %37, align 1, !tbaa !25
  %39 = zext i8 %38 to i32
  %40 = icmp sge i32 %39, 7
  br i1 %40, label %41, label %42

41:                                               ; preds = %31
  br label %123

42:                                               ; preds = %31
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.png_struct_def, ptr %43, i32 0, i32 37
  %45 = load i32, ptr %44, align 8, !tbaa !26
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_struct_def, ptr %46, i32 0, i32 59
  %48 = load i8, ptr %47, align 1, !tbaa !25
  %49 = zext i8 %48 to i64
  %50 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !27
  %52 = zext i8 %51 to i32
  %53 = add i32 %45, %52
  %54 = sub i32 %53, 1
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.png_struct_def, ptr %55, i32 0, i32 59
  %57 = load i8, ptr %56, align 1, !tbaa !25
  %58 = zext i8 %57 to i64
  %59 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %58
  %60 = load i8, ptr %59, align 1, !tbaa !27
  %61 = zext i8 %60 to i32
  %62 = sub i32 %54, %61
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.png_struct_def, ptr %63, i32 0, i32 59
  %65 = load i8, ptr %64, align 1, !tbaa !25
  %66 = zext i8 %65 to i64
  %67 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !27
  %69 = zext i8 %68 to i32
  %70 = udiv i32 %62, %69
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.png_struct_def, ptr %71, i32 0, i32 42
  store i32 %70, ptr %72, align 8, !tbaa !28
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.png_struct_def, ptr %73, i32 0, i32 17
  %75 = load i32, ptr %74, align 4, !tbaa !29
  %76 = and i32 %75, 2
  %77 = icmp eq i32 %76, 0
  br i1 %77, label %78, label %109

78:                                               ; preds = %42
  %79 = load ptr, ptr %2, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.png_struct_def, ptr %79, i32 0, i32 38
  %81 = load i32, ptr %80, align 4, !tbaa !30
  %82 = load ptr, ptr %2, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.png_struct_def, ptr %82, i32 0, i32 59
  %84 = load i8, ptr %83, align 1, !tbaa !25
  %85 = zext i8 %84 to i64
  %86 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !27
  %88 = zext i8 %87 to i32
  %89 = add i32 %81, %88
  %90 = sub i32 %89, 1
  %91 = load ptr, ptr %2, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.png_struct_def, ptr %91, i32 0, i32 59
  %93 = load i8, ptr %92, align 1, !tbaa !25
  %94 = zext i8 %93 to i64
  %95 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %94
  %96 = load i8, ptr %95, align 1, !tbaa !27
  %97 = zext i8 %96 to i32
  %98 = sub i32 %90, %97
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.png_struct_def, ptr %99, i32 0, i32 59
  %101 = load i8, ptr %100, align 1, !tbaa !25
  %102 = zext i8 %101 to i64
  %103 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !27
  %105 = zext i8 %104 to i32
  %106 = udiv i32 %98, %105
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.png_struct_def, ptr %107, i32 0, i32 39
  store i32 %106, ptr %108, align 8, !tbaa !21
  br label %110

109:                                              ; preds = %42
  br label %123

110:                                              ; preds = %78
  br label %111

111:                                              ; preds = %110
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_struct_def, ptr %112, i32 0, i32 39
  %114 = load i32, ptr %113, align 8, !tbaa !21
  %115 = icmp eq i32 %114, 0
  br i1 %115, label %121, label %116

116:                                              ; preds = %111
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.png_struct_def, ptr %117, i32 0, i32 42
  %119 = load i32, ptr %118, align 8, !tbaa !28
  %120 = icmp eq i32 %119, 0
  br label %121

121:                                              ; preds = %116, %111
  %122 = phi i1 [ true, %111 ], [ %120, %116 ]
  br i1 %122, label %31, label %123, !llvm.loop !31

123:                                              ; preds = %121, %109, %41
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.png_struct_def, ptr %124, i32 0, i32 59
  %126 = load i8, ptr %125, align 1, !tbaa !25
  %127 = zext i8 %126 to i32
  %128 = icmp slt i32 %127, 7
  br i1 %128, label %129, label %130

129:                                              ; preds = %123
  br label %133

130:                                              ; preds = %123
  br label %131

131:                                              ; preds = %130, %15
  %132 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_read_finish_IDAT(ptr noundef %132)
  br label %133

133:                                              ; preds = %131, %129, %14
  ret void
}

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

!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, !12, i64 532}
!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, !12, i64 512}
!22 = !{!10, !7, i64 612}
!23 = !{!10, !6, i64 544}
!24 = !{!10, !11, i64 520}
!25 = !{!10, !7, i64 613}
!26 = !{!10, !12, i64 504}
!27 = !{!7, !7, i64 0}
!28 = !{!10, !12, i64 528}
!29 = !{!10, !12, i64 308}
!30 = !{!10, !12, i64 508}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}


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

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_read_finish_IDAT(ptr noalias noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @png_read_finish_row(ptr noalias noundef %0) local_unnamed_addr #1 {
  %2 = getelementptr inbounds i8, ptr %0, i64 532
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = add i32 %3, 1
  store i32 %4, ptr %2, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 512
  %6 = load i32, ptr %5, align 8, !tbaa !20
  %7 = icmp ult i32 %4, %6
  br i1 %7, label %.thread, label %8

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 612
  %10 = load i8, ptr %9, align 4, !tbaa !21
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %275, label %.critedge

.critedge:                                        ; preds = %8
  store i32 0, ptr %2, align 4, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 544
  %12 = load ptr, ptr %11, align 8, !tbaa !22
  %13 = getelementptr inbounds i8, ptr %0, i64 520
  %14 = load i64, ptr %13, align 8, !tbaa !23
  %15 = add i64 %14, 1
  tail call void @llvm.memset.p0.i64(ptr align 1 %12, i8 0, i64 %15, i1 false)
  %16 = getelementptr inbounds i8, ptr %0, i64 613
  %.promoted = load i8, ptr %16, align 1, !tbaa !24
  %17 = getelementptr inbounds i8, ptr %0, i64 504
  %18 = getelementptr inbounds i8, ptr %0, i64 528
  %19 = getelementptr inbounds i8, ptr %0, i64 308
  %20 = getelementptr inbounds i8, ptr %0, i64 508
  %21 = add i8 %.promoted, 1
  %22 = icmp ugt i8 %21, 6
  br i1 %22, label %.loopexit, label %23

23:                                               ; preds = %.critedge
  %24 = load i32, ptr %17, align 8, !tbaa !25
  %25 = zext nneg i8 %21 to i64
  %26 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %25
  %27 = load i8, ptr %26, align 1, !tbaa !26
  %28 = zext i8 %27 to i32
  %29 = add i32 %24, %28
  %30 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %25
  %31 = load i8, ptr %30, align 1, !tbaa !26
  %32 = zext i8 %31 to i32
  %33 = xor i32 %32, -1
  %34 = add i32 %29, %33
  %35 = udiv i32 %34, %28
  store i32 %35, ptr %18, align 8, !tbaa !27
  %36 = load i32, ptr %19, align 4, !tbaa !28
  %37 = and i32 %36, 2
  %38 = icmp eq i32 %37, 0
  br i1 %38, label %39, label %.thread.loopexit

39:                                               ; preds = %23
  %40 = load i32, ptr %20, align 4, !tbaa !29
  %41 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %25
  %42 = load i8, ptr %41, align 1, !tbaa !26
  %43 = zext i8 %42 to i32
  %44 = add i32 %40, %43
  %45 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %25
  %46 = load i8, ptr %45, align 1, !tbaa !26
  %47 = zext i8 %46 to i32
  %48 = xor i32 %47, -1
  %49 = add i32 %44, %48
  %50 = udiv i32 %49, %43
  store i32 %50, ptr %5, align 8, !tbaa !20
  %51 = icmp ult i32 %49, %43
  %52 = icmp ult i32 %34, %28
  %or.cond = select i1 %51, i1 true, i1 %52
  br i1 %or.cond, label %.critedge.1, label %.thread.loopexit, !llvm.loop !30

.critedge.1:                                      ; preds = %39
  %53 = add i8 %.promoted, 2
  %54 = icmp ugt i8 %53, 6
  br i1 %54, label %.loopexit, label %55

55:                                               ; preds = %.critedge.1
  %56 = load i32, ptr %17, align 8, !tbaa !25
  %57 = zext nneg i8 %53 to i64
  %58 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %57
  %59 = load i8, ptr %58, align 1, !tbaa !26
  %60 = zext i8 %59 to i32
  %61 = add i32 %56, %60
  %62 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %57
  %63 = load i8, ptr %62, align 1, !tbaa !26
  %64 = zext i8 %63 to i32
  %65 = xor i32 %64, -1
  %66 = add i32 %61, %65
  %67 = udiv i32 %66, %60
  store i32 %67, ptr %18, align 8, !tbaa !27
  %68 = load i32, ptr %19, align 4, !tbaa !28
  %69 = and i32 %68, 2
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %.thread.loopexit

71:                                               ; preds = %55
  %72 = load i32, ptr %20, align 4, !tbaa !29
  %73 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %57
  %74 = load i8, ptr %73, align 1, !tbaa !26
  %75 = zext i8 %74 to i32
  %76 = add i32 %72, %75
  %77 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %57
  %78 = load i8, ptr %77, align 1, !tbaa !26
  %79 = zext i8 %78 to i32
  %80 = xor i32 %79, -1
  %81 = add i32 %76, %80
  %82 = udiv i32 %81, %75
  store i32 %82, ptr %5, align 8, !tbaa !20
  %83 = icmp ult i32 %81, %75
  %84 = icmp ult i32 %66, %60
  %or.cond.1 = select i1 %83, i1 true, i1 %84
  br i1 %or.cond.1, label %.critedge.2, label %.thread.loopexit, !llvm.loop !30

.critedge.2:                                      ; preds = %71
  %85 = add i8 %.promoted, 3
  %86 = icmp ugt i8 %85, 6
  br i1 %86, label %.loopexit, label %87

87:                                               ; preds = %.critedge.2
  %88 = load i32, ptr %17, align 8, !tbaa !25
  %89 = zext nneg i8 %85 to i64
  %90 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %89
  %91 = load i8, ptr %90, align 1, !tbaa !26
  %92 = zext i8 %91 to i32
  %93 = add i32 %88, %92
  %94 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %89
  %95 = load i8, ptr %94, align 1, !tbaa !26
  %96 = zext i8 %95 to i32
  %97 = xor i32 %96, -1
  %98 = add i32 %93, %97
  %99 = udiv i32 %98, %92
  store i32 %99, ptr %18, align 8, !tbaa !27
  %100 = load i32, ptr %19, align 4, !tbaa !28
  %101 = and i32 %100, 2
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %.thread.loopexit

103:                                              ; preds = %87
  %104 = load i32, ptr %20, align 4, !tbaa !29
  %105 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %89
  %106 = load i8, ptr %105, align 1, !tbaa !26
  %107 = zext i8 %106 to i32
  %108 = add i32 %104, %107
  %109 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %89
  %110 = load i8, ptr %109, align 1, !tbaa !26
  %111 = zext i8 %110 to i32
  %112 = xor i32 %111, -1
  %113 = add i32 %108, %112
  %114 = udiv i32 %113, %107
  store i32 %114, ptr %5, align 8, !tbaa !20
  %115 = icmp ult i32 %113, %107
  %116 = icmp ult i32 %98, %92
  %or.cond.2 = select i1 %115, i1 true, i1 %116
  br i1 %or.cond.2, label %.critedge.3, label %.thread.loopexit, !llvm.loop !30

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

119:                                              ; preds = %.critedge.3
  %120 = load i32, ptr %17, align 8, !tbaa !25
  %121 = zext nneg i8 %117 to i64
  %122 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %121
  %123 = load i8, ptr %122, align 1, !tbaa !26
  %124 = zext i8 %123 to i32
  %125 = add i32 %120, %124
  %126 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %121
  %127 = load i8, ptr %126, align 1, !tbaa !26
  %128 = zext i8 %127 to i32
  %129 = xor i32 %128, -1
  %130 = add i32 %125, %129
  %131 = udiv i32 %130, %124
  store i32 %131, ptr %18, align 8, !tbaa !27
  %132 = load i32, ptr %19, align 4, !tbaa !28
  %133 = and i32 %132, 2
  %134 = icmp eq i32 %133, 0
  br i1 %134, label %135, label %.thread.loopexit

135:                                              ; preds = %119
  %136 = load i32, ptr %20, align 4, !tbaa !29
  %137 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %121
  %138 = load i8, ptr %137, align 1, !tbaa !26
  %139 = zext i8 %138 to i32
  %140 = add i32 %136, %139
  %141 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %121
  %142 = load i8, ptr %141, align 1, !tbaa !26
  %143 = zext i8 %142 to i32
  %144 = xor i32 %143, -1
  %145 = add i32 %140, %144
  %146 = udiv i32 %145, %139
  store i32 %146, ptr %5, align 8, !tbaa !20
  %147 = icmp ult i32 %145, %139
  %148 = icmp ult i32 %130, %124
  %or.cond.3 = select i1 %147, i1 true, i1 %148
  br i1 %or.cond.3, label %.critedge.4, label %.thread.loopexit, !llvm.loop !30

.critedge.4:                                      ; preds = %135
  %149 = add i8 %.promoted, 5
  %150 = icmp ugt i8 %149, 6
  br i1 %150, label %.loopexit, label %151

151:                                              ; preds = %.critedge.4
  %152 = load i32, ptr %17, align 8, !tbaa !25
  %153 = zext nneg i8 %149 to i64
  %154 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %153
  %155 = load i8, ptr %154, align 1, !tbaa !26
  %156 = zext i8 %155 to i32
  %157 = add i32 %152, %156
  %158 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %153
  %159 = load i8, ptr %158, align 1, !tbaa !26
  %160 = zext i8 %159 to i32
  %161 = xor i32 %160, -1
  %162 = add i32 %157, %161
  %163 = udiv i32 %162, %156
  store i32 %163, ptr %18, align 8, !tbaa !27
  %164 = load i32, ptr %19, align 4, !tbaa !28
  %165 = and i32 %164, 2
  %166 = icmp eq i32 %165, 0
  br i1 %166, label %167, label %.thread.loopexit

167:                                              ; preds = %151
  %168 = load i32, ptr %20, align 4, !tbaa !29
  %169 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %153
  %170 = load i8, ptr %169, align 1, !tbaa !26
  %171 = zext i8 %170 to i32
  %172 = add i32 %168, %171
  %173 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %153
  %174 = load i8, ptr %173, align 1, !tbaa !26
  %175 = zext i8 %174 to i32
  %176 = xor i32 %175, -1
  %177 = add i32 %172, %176
  %178 = udiv i32 %177, %171
  store i32 %178, ptr %5, align 8, !tbaa !20
  %179 = icmp ult i32 %177, %171
  %180 = icmp ult i32 %162, %156
  %or.cond.4 = select i1 %179, i1 true, i1 %180
  br i1 %or.cond.4, label %.critedge.5, label %.thread.loopexit, !llvm.loop !30

.critedge.5:                                      ; preds = %167
  %181 = add i8 %.promoted, 6
  %182 = icmp ugt i8 %181, 6
  br i1 %182, label %.loopexit, label %183

183:                                              ; preds = %.critedge.5
  %184 = load i32, ptr %17, align 8, !tbaa !25
  %185 = zext nneg i8 %181 to i64
  %186 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %185
  %187 = load i8, ptr %186, align 1, !tbaa !26
  %188 = zext i8 %187 to i32
  %189 = add i32 %184, %188
  %190 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %185
  %191 = load i8, ptr %190, align 1, !tbaa !26
  %192 = zext i8 %191 to i32
  %193 = xor i32 %192, -1
  %194 = add i32 %189, %193
  %195 = udiv i32 %194, %188
  store i32 %195, ptr %18, align 8, !tbaa !27
  %196 = load i32, ptr %19, align 4, !tbaa !28
  %197 = and i32 %196, 2
  %198 = icmp eq i32 %197, 0
  br i1 %198, label %199, label %.thread.loopexit

199:                                              ; preds = %183
  %200 = load i32, ptr %20, align 4, !tbaa !29
  %201 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %185
  %202 = load i8, ptr %201, align 1, !tbaa !26
  %203 = zext i8 %202 to i32
  %204 = add i32 %200, %203
  %205 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %185
  %206 = load i8, ptr %205, align 1, !tbaa !26
  %207 = zext i8 %206 to i32
  %208 = xor i32 %207, -1
  %209 = add i32 %204, %208
  %210 = udiv i32 %209, %203
  store i32 %210, ptr %5, align 8, !tbaa !20
  %211 = icmp ult i32 %209, %203
  %212 = icmp ult i32 %194, %188
  %or.cond.5 = select i1 %211, i1 true, i1 %212
  br i1 %or.cond.5, label %.critedge.6, label %.thread.loopexit, !llvm.loop !30

.critedge.6:                                      ; preds = %199
  %213 = add i8 %.promoted, 7
  %214 = icmp ult i8 %.promoted, -7
  br i1 %214, label %.loopexit, label %215

215:                                              ; preds = %.critedge.6
  %216 = load i32, ptr %17, align 8, !tbaa !25
  %217 = zext nneg i8 %213 to i64
  %218 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %217
  %219 = load i8, ptr %218, align 1, !tbaa !26
  %220 = zext i8 %219 to i32
  %221 = add i32 %216, %220
  %222 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %217
  %223 = load i8, ptr %222, align 1, !tbaa !26
  %224 = zext i8 %223 to i32
  %225 = xor i32 %224, -1
  %226 = add i32 %221, %225
  %227 = udiv i32 %226, %220
  store i32 %227, ptr %18, align 8, !tbaa !27
  %228 = load i32, ptr %19, align 4, !tbaa !28
  %229 = and i32 %228, 2
  %230 = icmp eq i32 %229, 0
  br i1 %230, label %231, label %.thread.loopexit

231:                                              ; preds = %215
  %232 = load i32, ptr %20, align 4, !tbaa !29
  %233 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %217
  %234 = load i8, ptr %233, align 1, !tbaa !26
  %235 = zext i8 %234 to i32
  %236 = add i32 %232, %235
  %237 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %217
  %238 = load i8, ptr %237, align 1, !tbaa !26
  %239 = zext i8 %238 to i32
  %240 = xor i32 %239, -1
  %241 = add i32 %236, %240
  %242 = udiv i32 %241, %235
  store i32 %242, ptr %5, align 8, !tbaa !20
  %243 = icmp ult i32 %241, %235
  %244 = icmp ult i32 %226, %220
  %or.cond.6 = select i1 %243, i1 true, i1 %244
  br i1 %or.cond.6, label %.critedge.7, label %.thread.loopexit, !llvm.loop !30

.critedge.7:                                      ; preds = %231
  %245 = add nsw i8 %.promoted, 8
  %246 = icmp ugt i8 %245, 6
  br i1 %246, label %.loopexit, label %247

247:                                              ; preds = %.critedge.7
  %248 = load i32, ptr %17, align 8, !tbaa !25
  %249 = zext nneg i8 %245 to i64
  %250 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_inc, i64 0, i64 %249
  %251 = load i8, ptr %250, align 1, !tbaa !26
  %252 = zext i8 %251 to i32
  %253 = add i32 %248, %252
  %254 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_start, i64 0, i64 %249
  %255 = load i8, ptr %254, align 1, !tbaa !26
  %256 = zext i8 %255 to i32
  %257 = xor i32 %256, -1
  %258 = add i32 %253, %257
  %259 = udiv i32 %258, %252
  store i32 %259, ptr %18, align 8, !tbaa !27
  %260 = load i32, ptr %19, align 4, !tbaa !28
  %261 = and i32 %260, 2
  %262 = icmp eq i32 %261, 0
  br i1 %262, label %263, label %.thread.loopexit

263:                                              ; preds = %247
  %264 = load i32, ptr %20, align 4, !tbaa !29
  %265 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_yinc, i64 0, i64 %249
  %266 = load i8, ptr %265, align 1, !tbaa !26
  %267 = zext i8 %266 to i32
  %268 = add i32 %264, %267
  %269 = getelementptr inbounds [7 x i8], ptr @png_read_finish_row.png_pass_ystart, i64 0, i64 %249
  %270 = load i8, ptr %269, align 1, !tbaa !26
  %271 = zext i8 %270 to i32
  %272 = xor i32 %271, -1
  %273 = add i32 %268, %272
  %274 = udiv i32 %273, %267
  store i32 %274, ptr %5, align 8, !tbaa !20
  br label %.thread.loopexit

.loopexit:                                        ; preds = %.critedge.7, %.critedge.6, %.critedge.5, %.critedge.4, %.critedge.3, %.critedge.2, %.critedge.1, %.critedge
  %.lcssa = phi i8 [ %21, %.critedge ], [ %53, %.critedge.1 ], [ %85, %.critedge.2 ], [ %117, %.critedge.3 ], [ %149, %.critedge.4 ], [ %181, %.critedge.5 ], [ %213, %.critedge.6 ], [ %245, %.critedge.7 ]
  store i8 %.lcssa, ptr %16, align 1, !tbaa !24
  br label %275

275:                                              ; preds = %.loopexit, %8
  tail call void @png_read_finish_IDAT(ptr noundef nonnull %0)
  br label %.thread

.thread.loopexit:                                 ; preds = %263, %247, %231, %215, %199, %183, %167, %151, %135, %119, %103, %87, %71, %55, %23, %39
  %.lcssa28 = phi i8 [ %21, %23 ], [ %21, %39 ], [ %53, %55 ], [ %53, %71 ], [ %85, %87 ], [ %85, %103 ], [ %117, %119 ], [ %117, %135 ], [ %149, %151 ], [ %149, %167 ], [ %181, %183 ], [ %181, %199 ], [ %213, %215 ], [ %213, %231 ], [ %245, %247 ], [ %245, %263 ]
  store i8 %.lcssa28, ptr %16, align 1, !tbaa !24
  br label %.thread

.thread:                                          ; preds = %.thread.loopexit, %1, %275
  ret void
}

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

!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, !11, i64 532}
!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, !11, i64 512}
!21 = !{!6, !7, i64 612}
!22 = !{!6, !9, i64 544}
!23 = !{!6, !10, i64 520}
!24 = !{!6, !7, i64 613}
!25 = !{!6, !11, i64 504}
!26 = !{!7, !7, i64 0}
!27 = !{!6, !11, i64 528}
!28 = !{!6, !11, i64 308}
!29 = !{!6, !11, i64 508}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}


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