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

; 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.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_check_IHDR(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i32 %1, ptr %10, align 4, !tbaa !9
  store i32 %2, ptr %11, align 4, !tbaa !9
  store i32 %3, ptr %12, align 4, !tbaa !9
  store i32 %4, ptr %13, align 4, !tbaa !9
  store i32 %5, ptr %14, align 4, !tbaa !9
  store i32 %6, ptr %15, align 4, !tbaa !9
  store i32 %7, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %17, align 4, !tbaa !9
  %18 = load i32, ptr %10, align 4, !tbaa !9
  %19 = icmp eq i32 %18, 0
  br i1 %19, label %20, label %22

20:                                               ; preds = %8
  %21 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %21, ptr noundef @.str.14)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %20, %8
  %23 = load i32, ptr %11, align 4, !tbaa !9
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %26, ptr noundef @.str.15)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %25, %22
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.png_struct_def, ptr %29, i32 0, i32 130
  %31 = load i32, ptr %30, align 4, !tbaa !11
  %32 = icmp ugt i32 %28, %31
  br i1 %32, label %37, label %33

33:                                               ; preds = %27
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = zext i32 %34 to i64
  %36 = icmp sgt i64 %35, 1000000
  br i1 %36, label %37, label %39

37:                                               ; preds = %33, %27
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %38, ptr noundef @.str.16)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %39

39:                                               ; preds = %37, %33
  %40 = load i32, ptr %11, align 4, !tbaa !9
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_struct_def, ptr %41, i32 0, i32 131
  %43 = load i32, ptr %42, align 8, !tbaa !21
  %44 = icmp ugt i32 %40, %43
  br i1 %44, label %49, label %45

45:                                               ; preds = %39
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = zext i32 %46 to i64
  %48 = icmp sgt i64 %47, 1000000
  br i1 %48, label %49, label %51

49:                                               ; preds = %45, %39
  %50 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %50, ptr noundef @.str.17)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %51

51:                                               ; preds = %49, %45
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = icmp ugt i32 %52, 2147483647
  br i1 %53, label %54, label %56

54:                                               ; preds = %51
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %55, ptr noundef @.str.18)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %54, %51
  %57 = load i32, ptr %11, align 4, !tbaa !9
  %58 = icmp ugt i32 %57, 2147483647
  br i1 %58, label %59, label %61

59:                                               ; preds = %56
  %60 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %60, ptr noundef @.str.19)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %59, %56
  %62 = load i32, ptr %10, align 4, !tbaa !9
  %63 = icmp ugt i32 %62, 536870782
  br i1 %63, label %64, label %66

64:                                               ; preds = %61
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %65, ptr noundef @.str.20)
  br label %66

66:                                               ; preds = %64, %61
  %67 = load i32, ptr %12, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 1
  br i1 %68, label %69, label %83

69:                                               ; preds = %66
  %70 = load i32, ptr %12, align 4, !tbaa !9
  %71 = icmp ne i32 %70, 2
  br i1 %71, label %72, label %83

72:                                               ; preds = %69
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = icmp ne i32 %73, 4
  br i1 %74, label %75, label %83

75:                                               ; preds = %72
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = icmp ne i32 %76, 8
  br i1 %77, label %78, label %83

78:                                               ; preds = %75
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = icmp ne i32 %79, 16
  br i1 %80, label %81, label %83

81:                                               ; preds = %78
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %82, ptr noundef @.str.21)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %83

83:                                               ; preds = %81, %78, %75, %72, %69, %66
  %84 = load i32, ptr %13, align 4, !tbaa !9
  %85 = icmp slt i32 %84, 0
  br i1 %85, label %95, label %86

86:                                               ; preds = %83
  %87 = load i32, ptr %13, align 4, !tbaa !9
  %88 = icmp eq i32 %87, 1
  br i1 %88, label %95, label %89

89:                                               ; preds = %86
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = icmp eq i32 %90, 5
  br i1 %91, label %95, label %92

92:                                               ; preds = %89
  %93 = load i32, ptr %13, align 4, !tbaa !9
  %94 = icmp sgt i32 %93, 6
  br i1 %94, label %95, label %97

95:                                               ; preds = %92, %89, %86, %83
  %96 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %96, ptr noundef @.str.22)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %95, %92
  %98 = load i32, ptr %13, align 4, !tbaa !9
  %99 = icmp eq i32 %98, 3
  br i1 %99, label %100, label %103

100:                                              ; preds = %97
  %101 = load i32, ptr %12, align 4, !tbaa !9
  %102 = icmp sgt i32 %101, 8
  br i1 %102, label %115, label %103

103:                                              ; preds = %100, %97
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = icmp eq i32 %104, 2
  br i1 %105, label %112, label %106

106:                                              ; preds = %103
  %107 = load i32, ptr %13, align 4, !tbaa !9
  %108 = icmp eq i32 %107, 4
  br i1 %108, label %112, label %109

109:                                              ; preds = %106
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = icmp eq i32 %110, 6
  br i1 %111, label %112, label %117

112:                                              ; preds = %109, %106, %103
  %113 = load i32, ptr %12, align 4, !tbaa !9
  %114 = icmp slt i32 %113, 8
  br i1 %114, label %115, label %117

115:                                              ; preds = %112, %100
  %116 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %116, ptr noundef @.str.23)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %117

117:                                              ; preds = %115, %112, %109
  %118 = load i32, ptr %14, align 4, !tbaa !9
  %119 = icmp sge i32 %118, 2
  br i1 %119, label %120, label %122

120:                                              ; preds = %117
  %121 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %121, ptr noundef @.str.24)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %122

122:                                              ; preds = %120, %117
  %123 = load i32, ptr %15, align 4, !tbaa !9
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %127

125:                                              ; preds = %122
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %126, ptr noundef @.str.25)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %127

127:                                              ; preds = %125, %122
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.png_struct_def, ptr %128, i32 0, i32 13
  %130 = load i32, ptr %129, align 4, !tbaa !22
  %131 = and i32 %130, 4096
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %133, label %140

133:                                              ; preds = %127
  %134 = load ptr, ptr %9, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_struct_def, ptr %134, i32 0, i32 119
  %136 = load i32, ptr %135, align 8, !tbaa !23
  %137 = icmp ne i32 %136, 0
  br i1 %137, label %138, label %140

138:                                              ; preds = %133
  %139 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %139, ptr noundef @.str.26)
  br label %140

140:                                              ; preds = %138, %133, %127
  %141 = load i32, ptr %16, align 4, !tbaa !9
  %142 = icmp ne i32 %141, 0
  br i1 %142, label %143, label %175

143:                                              ; preds = %140
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.png_struct_def, ptr %144, i32 0, i32 119
  %146 = load i32, ptr %145, align 8, !tbaa !23
  %147 = and i32 %146, 4
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %164

149:                                              ; preds = %143
  %150 = load i32, ptr %16, align 4, !tbaa !9
  %151 = icmp eq i32 %150, 64
  br i1 %151, label %152, label %164

152:                                              ; preds = %149
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.png_struct_def, ptr %153, i32 0, i32 13
  %155 = load i32, ptr %154, align 4, !tbaa !22
  %156 = and i32 %155, 4096
  %157 = icmp eq i32 %156, 0
  br i1 %157, label %158, label %164

158:                                              ; preds = %152
  %159 = load i32, ptr %13, align 4, !tbaa !9
  %160 = icmp eq i32 %159, 2
  br i1 %160, label %166, label %161

161:                                              ; preds = %158
  %162 = load i32, ptr %13, align 4, !tbaa !9
  %163 = icmp eq i32 %162, 6
  br i1 %163, label %166, label %164

164:                                              ; preds = %161, %152, %149, %143
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %165, ptr noundef @.str.27)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %166

166:                                              ; preds = %164, %161, %158
  %167 = load ptr, ptr %9, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.png_struct_def, ptr %167, i32 0, i32 13
  %169 = load i32, ptr %168, align 4, !tbaa !22
  %170 = and i32 %169, 4096
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %174

172:                                              ; preds = %166
  %173 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %173, ptr noundef @.str.28)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %174

174:                                              ; preds = %172, %166
  br label %175

175:                                              ; preds = %174, %140
  %176 = load i32, ptr %17, align 4, !tbaa !9
  %177 = icmp eq i32 %176, 1
  br i1 %177, label %178, label %180

178:                                              ; preds = %175
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %179, ptr noundef @.str.29)
  br label %180

180:                                              ; preds = %178, %175
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  ret void
}

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 1108}
!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, !10, i64 284, !10, i64 288, !10, i64 292, !13, i64 296, !6, i64 408, !14, 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, !14, i64 464, !14, i64 472, !10, i64 480, !10, i64 484, !6, i64 488, !6, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !6, i64 528, !15, i64 536, !10, i64 560, !10, 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, !10, i64 640, !10, i64 644, !10, 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, !10, i64 824, !10, i64 828, !14, i64 832, !14, i64 840, !14, i64 848, !14, i64 856, !10, i64 864, !10, i64 868, !14, i64 872, !14, 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, !10, i64 984, !6, i64 992, !6, i64 1000, !10, i64 1008, !6, i64 1016, !7, i64 1024, !16, i64 1026, !16, i64 1028, !16, i64 1030, !10, i64 1032, !10, 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, !10, i64 1108, !10, i64 1112, !10, i64 1116, !20, i64 1120, !10, i64 1152, !10, i64 1156, !6, i64 1160, !10, i64 1168}
!13 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !14, i64 16, !6, i64 24, !10, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !14, i64 96, !14, i64 104}
!14 = !{!"long", !7, i64 0}
!15 = !{!"png_row_info_struct", !10, i64 0, !14, 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, !14, i64 16, !7, i64 24}
!21 = !{!12, !10, i64 1112}
!22 = !{!12, !10, i64 284}
!23 = !{!12, !10, i64 1032}


; 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.14 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [18 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_check_IHDR(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) local_unnamed_addr #1 {
  %9 = icmp eq i32 %1, 0
  br i1 %9, label %10, label %11

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

11:                                               ; preds = %10, %8
  %.0 = phi i32 [ 1, %10 ], [ 0, %8 ]
  %12 = icmp eq i32 %2, 0
  br i1 %12, label %13, label %14

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

14:                                               ; preds = %13, %11
  %.1 = phi i32 [ 1, %13 ], [ %.0, %11 ]
  %15 = getelementptr inbounds i8, ptr %0, i64 1108
  %16 = load i32, ptr %15, align 4, !tbaa !5
  %17 = icmp ult i32 %16, %1
  %18 = icmp ugt i32 %1, 1000000
  %or.cond = or i1 %18, %17
  br i1 %or.cond, label %19, label %20

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

20:                                               ; preds = %14, %19
  %.2 = phi i32 [ 1, %19 ], [ %.1, %14 ]
  %21 = getelementptr inbounds i8, ptr %0, i64 1112
  %22 = load i32, ptr %21, align 8, !tbaa !19
  %23 = icmp ult i32 %22, %2
  %24 = icmp ugt i32 %2, 1000000
  %or.cond5 = or i1 %24, %23
  br i1 %or.cond5, label %25, label %26

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

26:                                               ; preds = %20, %25
  %.3 = phi i32 [ 1, %25 ], [ %.2, %20 ]
  %27 = icmp slt i32 %1, 0
  br i1 %27, label %28, label %29

28:                                               ; preds = %26
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.18) #2
  br label %29

29:                                               ; preds = %28, %26
  %.4 = phi i32 [ 1, %28 ], [ %.3, %26 ]
  %30 = icmp slt i32 %2, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %29
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.19) #2
  br label %32

32:                                               ; preds = %31, %29
  %.5 = phi i32 [ 1, %31 ], [ %.4, %29 ]
  %33 = icmp ugt i32 %1, 536870782
  br i1 %33, label %34, label %35

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

35:                                               ; preds = %34, %32
  switch i32 %3, label %36 [
    i32 16, label %37
    i32 8, label %37
    i32 4, label %37
    i32 2, label %37
    i32 1, label %37
  ]

36:                                               ; preds = %35
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.21) #2
  br label %37

37:                                               ; preds = %35, %35, %35, %35, %35, %36
  %.6 = phi i32 [ 1, %36 ], [ %.5, %35 ], [ %.5, %35 ], [ %.5, %35 ], [ %.5, %35 ], [ %.5, %35 ]
  %38 = and i32 %4, -5
  %39 = icmp eq i32 %38, 1
  %40 = icmp ugt i32 %4, 6
  %or.cond19 = or i1 %40, %39
  br i1 %or.cond19, label %41, label %42

41:                                               ; preds = %37
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.22) #2
  br label %42

42:                                               ; preds = %37, %41
  %.7 = phi i32 [ 1, %41 ], [ %.6, %37 ]
  %43 = icmp eq i32 %4, 3
  %44 = icmp sgt i32 %3, 8
  %or.cond21 = and i1 %44, %43
  br i1 %or.cond21, label %49, label %45

45:                                               ; preds = %42
  %46 = icmp eq i32 %4, 4
  %47 = icmp eq i32 %38, 2
  %or.cond25 = or i1 %46, %47
  %48 = icmp slt i32 %3, 8
  %or.cond27 = and i1 %48, %or.cond25
  br i1 %or.cond27, label %49, label %50

49:                                               ; preds = %45, %42
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.23) #2
  br label %50

50:                                               ; preds = %45, %49
  %.8 = phi i32 [ 1, %49 ], [ %.7, %45 ]
  %51 = icmp sgt i32 %5, 1
  br i1 %51, label %52, label %53

52:                                               ; preds = %50
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.24) #2
  br label %53

53:                                               ; preds = %52, %50
  %.9 = phi i32 [ 1, %52 ], [ %.8, %50 ]
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %55, label %54

54:                                               ; preds = %53
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.25) #2
  br label %55

55:                                               ; preds = %54, %53
  %.10 = phi i32 [ 1, %54 ], [ %.9, %53 ]
  %56 = getelementptr inbounds i8, ptr %0, i64 284
  %57 = load i32, ptr %56, align 4, !tbaa !20
  %58 = and i32 %57, 4096
  %.not85 = icmp eq i32 %58, 0
  br i1 %.not85, label %63, label %59

59:                                               ; preds = %55
  %60 = getelementptr inbounds i8, ptr %0, i64 1032
  %61 = load i32, ptr %60, align 8, !tbaa !21
  %.not86 = icmp eq i32 %61, 0
  br i1 %.not86, label %63, label %62

62:                                               ; preds = %59
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.26) #2
  br label %63

63:                                               ; preds = %62, %59, %55
  %.not87 = icmp eq i32 %7, 0
  br i1 %.not87, label %.thread92, label %64

64:                                               ; preds = %63
  %65 = getelementptr inbounds i8, ptr %0, i64 1032
  %66 = load i32, ptr %65, align 8, !tbaa !21
  %67 = and i32 %66, 4
  %68 = icmp ne i32 %67, 0
  %69 = icmp eq i32 %7, 64
  %or.cond29 = and i1 %69, %68
  br i1 %or.cond29, label %70, label %74

70:                                               ; preds = %64
  %71 = load i32, ptr %56, align 4, !tbaa !20
  %72 = and i32 %71, 4096
  %73 = icmp eq i32 %72, 0
  %or.cond31 = icmp eq i32 %38, 2
  %or.cond89 = and i1 %or.cond31, %73
  br i1 %or.cond89, label %.thread92, label %74

74:                                               ; preds = %64, %70
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.27) #2
  %.pre = load i32, ptr %56, align 4, !tbaa !20
  %.pre91 = and i32 %.pre, 4096
  %75 = icmp eq i32 %.pre91, 0
  br i1 %75, label %.thread95, label %.thread

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

.thread92:                                        ; preds = %70, %63
  %76 = icmp eq i32 %.10, 1
  br i1 %76, label %.thread95, label %77

.thread95:                                        ; preds = %74, %.thread, %.thread92
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.29) #2
  br label %77

77:                                               ; preds = %.thread95, %.thread92
  ret void
}

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, !10, i64 1108}
!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 1112}
!20 = !{!6, !10, i64 284}
!21 = !{!6, !10, i64 1032}


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