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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.png_struct_def = type { [1 x %struct.__jmp_buf_tag], ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i8, i32, i32, i32, %struct.z_stream_s, ptr, i64, i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, i64, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_row_info_struct, i32, i32, ptr, i16, i16, [5 x i8], i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i16, i8, float, %struct.png_color_16_struct, %struct.png_color_16_struct, ptr, i32, i32, i32, float, float, ptr, ptr, ptr, ptr, ptr, ptr, %struct.png_color_8_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i64, i64, i64, i64, i32, i32, i64, i64, ptr, ptr, ptr, ptr, ptr, i8, i8, ptr, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, i8, i16, i16, i16, i32, i32, i8, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i8, i32, i32, i32, %struct.png_unknown_chunk_t, i32, i32, ptr, i32 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }
%struct.png_row_info_struct = type { i32, i64, i8, i8, i8, i8 }
%struct.png_color_8_struct = type { i8, i8, i8, i8, i8 }
%struct.png_color_16_struct = type { i8, i16, i16, i16, i16 }
%struct.png_unknown_chunk_t = type { [5 x i8], ptr, i64, i8 }

@.str.10 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_process_IDAT_data(ptr noundef %0, ptr noundef %1, i64 noundef %2) #2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i64 %2, ptr %6, align 8, !tbaa !9
  %9 = load i64, ptr %6, align 8, !tbaa !9
  %10 = icmp ugt i64 %9, 0
  br i1 %10, label %11, label %14

11:                                               ; preds = %3
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %16

14:                                               ; preds = %11, %3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %15, ptr noundef @.str.10)
  br label %16

16:                                               ; preds = %14, %11
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.png_struct_def, ptr %18, i32 0, i32 16
  %20 = getelementptr inbounds %struct.z_stream_s, ptr %19, i32 0, i32 0
  store ptr %17, ptr %20, align 8, !tbaa !11
  %21 = load i64, ptr %6, align 8, !tbaa !9
  %22 = trunc i64 %21 to i32
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.png_struct_def, ptr %23, i32 0, i32 16
  %25 = getelementptr inbounds %struct.z_stream_s, ptr %24, i32 0, i32 1
  store i32 %22, ptr %25, align 8, !tbaa !21
  br label %26

26:                                               ; preds = %170, %16
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 16
  %29 = getelementptr inbounds %struct.z_stream_s, ptr %28, i32 0, i32 1
  %30 = load i32, ptr %29, align 8, !tbaa !21
  %31 = icmp ugt i32 %30, 0
  br i1 %31, label %32, label %39

32:                                               ; preds = %26
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.png_struct_def, ptr %33, i32 0, i32 14
  %35 = load i32, ptr %34, align 8, !tbaa !22
  %36 = and i32 %35, 32
  %37 = icmp ne i32 %36, 0
  %38 = xor i1 %37, true
  br label %39

39:                                               ; preds = %32, %26
  %40 = phi i1 [ false, %26 ], [ %38, %32 ]
  br i1 %40, label %41, label %171

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.png_struct_def, ptr %42, i32 0, i32 16
  %44 = getelementptr inbounds %struct.z_stream_s, ptr %43, i32 0, i32 4
  %45 = load i32, ptr %44, align 8, !tbaa !23
  %46 = icmp ugt i32 %45, 0
  br i1 %46, label %89, label %47

47:                                               ; preds = %41
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.png_struct_def, ptr %48, i32 0, i32 53
  %50 = load i8, ptr %49, align 1, !tbaa !24
  %51 = zext i8 %50 to i32
  %52 = icmp sge i32 %51, 8
  br i1 %52, label %53, label %64

53:                                               ; preds = %47
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.png_struct_def, ptr %54, i32 0, i32 30
  %56 = load i32, ptr %55, align 8, !tbaa !25
  %57 = zext i32 %56 to i64
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.png_struct_def, ptr %58, i32 0, i32 53
  %60 = load i8, ptr %59, align 1, !tbaa !24
  %61 = zext i8 %60 to i64
  %62 = lshr i64 %61, 3
  %63 = mul i64 %57, %62
  br label %76

64:                                               ; preds = %47
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 30
  %67 = load i32, ptr %66, align 8, !tbaa !25
  %68 = zext i32 %67 to i64
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_struct_def, ptr %69, i32 0, i32 53
  %71 = load i8, ptr %70, align 1, !tbaa !24
  %72 = zext i8 %71 to i64
  %73 = mul i64 %68, %72
  %74 = add i64 %73, 7
  %75 = lshr i64 %74, 3
  br label %76

76:                                               ; preds = %64, %53
  %77 = phi i64 [ %63, %53 ], [ %75, %64 ]
  %78 = trunc i64 %77 to i32
  %79 = add i32 %78, 1
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.png_struct_def, ptr %80, i32 0, i32 16
  %82 = getelementptr inbounds %struct.z_stream_s, ptr %81, i32 0, i32 4
  store i32 %79, ptr %82, align 8, !tbaa !23
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.png_struct_def, ptr %83, i32 0, i32 33
  %85 = load ptr, ptr %84, align 8, !tbaa !26
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.png_struct_def, ptr %86, i32 0, i32 16
  %88 = getelementptr inbounds %struct.z_stream_s, ptr %87, i32 0, i32 3
  store ptr %85, ptr %88, align 8, !tbaa !27
  br label %89

89:                                               ; preds = %76, %41
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.png_struct_def, ptr %90, i32 0, i32 16
  %92 = call i32 @inflate(ptr noundef %91, i32 noundef 2)
  store i32 %92, ptr %7, align 4, !tbaa !28
  %93 = load i32, ptr %7, align 4, !tbaa !28
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %121

95:                                               ; preds = %89
  %96 = load i32, ptr %7, align 4, !tbaa !28
  %97 = icmp ne i32 %96, 1
  br i1 %97, label %98, label %121

98:                                               ; preds = %95
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.png_struct_def, ptr %99, i32 0, i32 14
  %101 = load i32, ptr %100, align 8, !tbaa !22
  %102 = or i32 %101, 32
  store i32 %102, ptr %100, align 8, !tbaa !22
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_struct_def, ptr %103, i32 0, i32 31
  %105 = load i32, ptr %104, align 4, !tbaa !29
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.png_struct_def, ptr %106, i32 0, i32 26
  %108 = load i32, ptr %107, align 4, !tbaa !30
  %109 = icmp uge i32 %105, %108
  br i1 %109, label %116, label %110

110:                                              ; preds = %98
  %111 = load ptr, ptr %4, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.png_struct_def, ptr %111, i32 0, i32 48
  %113 = load i8, ptr %112, align 4, !tbaa !31
  %114 = zext i8 %113 to i32
  %115 = icmp sgt i32 %114, 6
  br i1 %115, label %116, label %118

116:                                              ; preds = %110, %98
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %117, ptr noundef @.str.11)
  br label %120

118:                                              ; preds = %110
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %119, ptr noundef @.str.12)
  br label %120

120:                                              ; preds = %118, %116
  store i32 1, ptr %8, align 4
  br label %168

121:                                              ; preds = %95, %89
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.png_struct_def, ptr %122, i32 0, i32 16
  %124 = getelementptr inbounds %struct.z_stream_s, ptr %123, i32 0, i32 3
  %125 = load ptr, ptr %124, align 8, !tbaa !27
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.png_struct_def, ptr %126, i32 0, i32 33
  %128 = load ptr, ptr %127, align 8, !tbaa !26
  %129 = icmp ne ptr %125, %128
  br i1 %129, label %130, label %159

130:                                              ; preds = %121
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.png_struct_def, ptr %131, i32 0, i32 31
  %133 = load i32, ptr %132, align 4, !tbaa !29
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_struct_def, ptr %134, i32 0, i32 26
  %136 = load i32, ptr %135, align 4, !tbaa !30
  %137 = icmp uge i32 %133, %136
  br i1 %137, label %144, label %138

138:                                              ; preds = %130
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.png_struct_def, ptr %139, i32 0, i32 48
  %141 = load i8, ptr %140, align 4, !tbaa !31
  %142 = zext i8 %141 to i32
  %143 = icmp sgt i32 %142, 6
  br i1 %143, label %144, label %150

144:                                              ; preds = %138, %130
  %145 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %145, ptr noundef @.str.13)
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.png_struct_def, ptr %146, i32 0, i32 14
  %148 = load i32, ptr %147, align 8, !tbaa !22
  %149 = or i32 %148, 32
  store i32 %149, ptr %147, align 8, !tbaa !22
  store i32 1, ptr %8, align 4
  br label %168

150:                                              ; preds = %138
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.png_struct_def, ptr %151, i32 0, i32 16
  %153 = getelementptr inbounds %struct.z_stream_s, ptr %152, i32 0, i32 4
  %154 = load i32, ptr %153, align 8, !tbaa !23
  %155 = icmp eq i32 %154, 0
  br i1 %155, label %156, label %158

156:                                              ; preds = %150
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_push_process_row(ptr noundef %157)
  br label %158

158:                                              ; preds = %156, %150
  br label %159

159:                                              ; preds = %158, %121
  %160 = load i32, ptr %7, align 4, !tbaa !28
  %161 = icmp eq i32 %160, 1
  br i1 %161, label %162, label %167

162:                                              ; preds = %159
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.png_struct_def, ptr %163, i32 0, i32 14
  %165 = load i32, ptr %164, align 8, !tbaa !22
  %166 = or i32 %165, 32
  store i32 %166, ptr %164, align 8, !tbaa !22
  br label %167

167:                                              ; preds = %162, %159
  store i32 0, ptr %8, align 4
  br label %168

168:                                              ; preds = %167, %144, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %169 = load i32, ptr %8, align 4
  switch i32 %169, label %180 [
    i32 0, label %170
    i32 1, label %179
  ]

170:                                              ; preds = %168
  br label %26, !llvm.loop !32

171:                                              ; preds = %39
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.png_struct_def, ptr %172, i32 0, i32 16
  %174 = getelementptr inbounds %struct.z_stream_s, ptr %173, i32 0, i32 1
  %175 = load i32, ptr %174, align 8, !tbaa !21
  %176 = icmp ugt i32 %175, 0
  br i1 %176, label %177, label %179

177:                                              ; preds = %171
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %178, ptr noundef @.str.14)
  br label %179

179:                                              ; preds = %177, %171, %168
  ret void

180:                                              ; preds = %168
  unreachable
}

declare i32 @inflate(ptr noundef, i32 noundef) #1

declare void @png_warning(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @png_push_process_row(ptr noundef) #2

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

@.str.10 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [23 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_process_IDAT_data(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #1 {
  %4 = icmp eq i64 %2, 0
  %5 = icmp eq ptr %1, null
  %or.cond = or i1 %5, %4
  br i1 %or.cond, label %6, label %7

6:                                                ; preds = %3
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.10) #2
  br label %7

7:                                                ; preds = %3, %6
  %8 = getelementptr inbounds i8, ptr %0, i64 296
  store ptr %1, ptr %8, align 8, !tbaa !5
  %9 = trunc i64 %2 to i32
  %10 = getelementptr inbounds i8, ptr %0, i64 304
  store i32 %9, ptr %10, align 8, !tbaa !19
  %.not53 = icmp eq i32 %9, 0
  br i1 %.not53, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 288
  %12 = getelementptr inbounds i8, ptr %0, i64 328
  %13 = getelementptr inbounds i8, ptr %0, i64 593
  %14 = getelementptr inbounds i8, ptr %0, i64 480
  %15 = getelementptr inbounds i8, ptr %0, i64 496
  %16 = getelementptr inbounds i8, ptr %0, i64 320
  %17 = getelementptr inbounds i8, ptr %0, i64 484
  %18 = getelementptr inbounds i8, ptr %0, i64 452
  %19 = getelementptr inbounds i8, ptr %0, i64 588
  br label %20

thread-pre-split:                                 ; preds = %74, %72
  %.pr = load i32, ptr %10, align 8, !tbaa !19
  %.not = icmp eq i32 %.pr, 0
  br i1 %.not, label %.critedge.thread, label %20

20:                                               ; preds = %.lr.ph, %thread-pre-split
  %21 = load i32, ptr %11, align 8, !tbaa !20
  %22 = and i32 %21, 32
  %.not43 = icmp eq i32 %22, 0
  br i1 %.not43, label %23, label %.critedge

23:                                               ; preds = %20
  %24 = load i32, ptr %12, align 8, !tbaa !21
  %.not45 = icmp eq i32 %24, 0
  br i1 %.not45, label %25, label %44

25:                                               ; preds = %23
  %26 = load i8, ptr %13, align 1, !tbaa !22
  %27 = icmp ugt i8 %26, 7
  %28 = load i32, ptr %14, align 8, !tbaa !23
  %29 = zext i32 %28 to i64
  br i1 %27, label %30, label %34

30:                                               ; preds = %25
  %31 = lshr i8 %26, 3
  %32 = zext nneg i8 %31 to i64
  %33 = mul nuw nsw i64 %29, %32
  br label %39

34:                                               ; preds = %25
  %35 = zext nneg i8 %26 to i64
  %36 = mul nuw nsw i64 %29, %35
  %37 = add nuw nsw i64 %36, 7
  %38 = lshr i64 %37, 3
  br label %39

39:                                               ; preds = %34, %30
  %40 = phi i64 [ %33, %30 ], [ %38, %34 ]
  %41 = trunc i64 %40 to i32
  %42 = add i32 %41, 1
  store i32 %42, ptr %12, align 8, !tbaa !21
  %43 = load ptr, ptr %15, align 8, !tbaa !24
  store ptr %43, ptr %16, align 8, !tbaa !25
  br label %44

44:                                               ; preds = %39, %23
  %45 = tail call i32 @inflate(ptr noundef nonnull %8, i32 noundef 2) #2
  %or.cond3 = icmp ugt i32 %45, 1
  br i1 %or.cond3, label %46, label %56

46:                                               ; preds = %44
  %47 = load i32, ptr %11, align 8, !tbaa !20
  %48 = or i32 %47, 32
  store i32 %48, ptr %11, align 8, !tbaa !20
  %49 = load i32, ptr %17, align 4, !tbaa !26
  %50 = load i32, ptr %18, align 4, !tbaa !27
  %.not48 = icmp ult i32 %49, %50
  br i1 %.not48, label %51, label %54

51:                                               ; preds = %46
  %52 = load i8, ptr %19, align 4, !tbaa !28
  %53 = icmp ugt i8 %52, 6
  br i1 %53, label %54, label %55

54:                                               ; preds = %51, %46
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.11) #2
  br label %.critedge.thread

55:                                               ; preds = %51
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.12) #2
  br label %.critedge.thread

56:                                               ; preds = %44
  %57 = load ptr, ptr %16, align 8, !tbaa !25
  %58 = load ptr, ptr %15, align 8, !tbaa !24
  %.not46 = icmp eq ptr %57, %58
  br i1 %.not46, label %72, label %59

59:                                               ; preds = %56
  %60 = load i32, ptr %17, align 4, !tbaa !26
  %61 = load i32, ptr %18, align 4, !tbaa !27
  %.not47 = icmp ult i32 %60, %61
  br i1 %.not47, label %62, label %65

62:                                               ; preds = %59
  %63 = load i8, ptr %19, align 4, !tbaa !28
  %64 = icmp ugt i8 %63, 6
  br i1 %64, label %65, label %68

65:                                               ; preds = %62, %59
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.13) #2
  %66 = load i32, ptr %11, align 8, !tbaa !20
  %67 = or i32 %66, 32
  store i32 %67, ptr %11, align 8, !tbaa !20
  br label %.critedge.thread

68:                                               ; preds = %62
  %69 = load i32, ptr %12, align 8, !tbaa !21
  %70 = icmp eq i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %68
  tail call void @png_push_process_row(ptr noundef nonnull %0)
  br label %72

72:                                               ; preds = %68, %71, %56
  %73 = icmp eq i32 %45, 1
  br i1 %73, label %74, label %thread-pre-split

74:                                               ; preds = %72
  %75 = load i32, ptr %11, align 8, !tbaa !20
  %76 = or i32 %75, 32
  store i32 %76, ptr %11, align 8, !tbaa !20
  br label %thread-pre-split

.critedge:                                        ; preds = %20
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.14) #2
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %thread-pre-split, %7, %54, %55, %65, %.critedge
  ret void
}

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

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

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

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


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