; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (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, 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 }

@.str.50 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [18 x i8], align 1

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

; Function Attrs: noreturn
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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_check_IHDR(ptr noalias noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, i32 noundef %6, i32 noundef %7) #3 {
  %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) #4
  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.50)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %20, %8
  %23 = load i32, ptr %10, align 4, !tbaa !9
  %24 = icmp ugt i32 %23, 2147483647
  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.51)
  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 = add i32 %28, 7
  %30 = and i32 %29, -8
  %31 = zext i32 %30 to i64
  %32 = call i32 @png_gt(i64 noundef %31, i64 noundef 2305843009213693944)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %27
  %35 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %35, ptr noundef @.str.52)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %34, %27
  %37 = load i32, ptr %10, align 4, !tbaa !9
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_struct_def, ptr %38, i32 0, i32 132
  %40 = load i32, ptr %39, align 4, !tbaa !11
  %41 = icmp ugt i32 %37, %40
  br i1 %41, label %42, label %44

42:                                               ; preds = %36
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %43, ptr noundef @.str.53)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %42, %36
  %45 = load i32, ptr %11, align 4, !tbaa !9
  %46 = icmp eq i32 %45, 0
  br i1 %46, label %47, label %49

47:                                               ; preds = %44
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %48, ptr noundef @.str.54)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %49

49:                                               ; preds = %47, %44
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = icmp ugt i32 %50, 2147483647
  br i1 %51, label %52, label %54

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

54:                                               ; preds = %52, %49
  %55 = load i32, ptr %11, align 4, !tbaa !9
  %56 = load ptr, ptr %9, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.png_struct_def, ptr %56, i32 0, i32 133
  %58 = load i32, ptr %57, align 8, !tbaa !22
  %59 = icmp ugt i32 %55, %58
  br i1 %59, label %60, label %62

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

62:                                               ; preds = %60, %54
  %63 = load i32, ptr %12, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 1
  br i1 %64, label %65, label %79

65:                                               ; preds = %62
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = icmp ne i32 %66, 2
  br i1 %67, label %68, label %79

68:                                               ; preds = %65
  %69 = load i32, ptr %12, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 4
  br i1 %70, label %71, label %79

71:                                               ; preds = %68
  %72 = load i32, ptr %12, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 8
  br i1 %73, label %74, label %79

74:                                               ; preds = %71
  %75 = load i32, ptr %12, align 4, !tbaa !9
  %76 = icmp ne i32 %75, 16
  br i1 %76, label %77, label %79

77:                                               ; preds = %74
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %78, ptr noundef @.str.57)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %79

79:                                               ; preds = %77, %74, %71, %68, %65, %62
  %80 = load i32, ptr %13, align 4, !tbaa !9
  %81 = icmp slt i32 %80, 0
  br i1 %81, label %91, label %82

82:                                               ; preds = %79
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = icmp eq i32 %83, 1
  br i1 %84, label %91, label %85

85:                                               ; preds = %82
  %86 = load i32, ptr %13, align 4, !tbaa !9
  %87 = icmp eq i32 %86, 5
  br i1 %87, label %91, label %88

88:                                               ; preds = %85
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = icmp sgt i32 %89, 6
  br i1 %90, label %91, label %93

91:                                               ; preds = %88, %85, %82, %79
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %92, ptr noundef @.str.58)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %91, %88
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = icmp eq i32 %94, 3
  br i1 %95, label %96, label %99

96:                                               ; preds = %93
  %97 = load i32, ptr %12, align 4, !tbaa !9
  %98 = icmp sgt i32 %97, 8
  br i1 %98, label %111, label %99

99:                                               ; preds = %96, %93
  %100 = load i32, ptr %13, align 4, !tbaa !9
  %101 = icmp eq i32 %100, 2
  br i1 %101, label %108, label %102

102:                                              ; preds = %99
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = icmp eq i32 %103, 4
  br i1 %104, label %108, label %105

105:                                              ; preds = %102
  %106 = load i32, ptr %13, align 4, !tbaa !9
  %107 = icmp eq i32 %106, 6
  br i1 %107, label %108, label %113

108:                                              ; preds = %105, %102, %99
  %109 = load i32, ptr %12, align 4, !tbaa !9
  %110 = icmp slt i32 %109, 8
  br i1 %110, label %111, label %113

111:                                              ; preds = %108, %96
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %112, ptr noundef @.str.59)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %111, %108, %105
  %114 = load i32, ptr %14, align 4, !tbaa !9
  %115 = icmp sge i32 %114, 2
  br i1 %115, label %116, label %118

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

118:                                              ; preds = %116, %113
  %119 = load i32, ptr %15, align 4, !tbaa !9
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %123

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

123:                                              ; preds = %121, %118
  %124 = load ptr, ptr %9, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.png_struct_def, ptr %124, i32 0, i32 15
  %126 = load i32, ptr %125, align 4, !tbaa !23
  %127 = and i32 %126, 4096
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %136

129:                                              ; preds = %123
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 122
  %132 = load i32, ptr %131, align 8, !tbaa !24
  %133 = icmp ne i32 %132, 0
  br i1 %133, label %134, label %136

134:                                              ; preds = %129
  %135 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %135, ptr noundef @.str.62)
  br label %136

136:                                              ; preds = %134, %129, %123
  %137 = load i32, ptr %16, align 4, !tbaa !9
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %171

139:                                              ; preds = %136
  %140 = load ptr, ptr %9, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.png_struct_def, ptr %140, i32 0, i32 122
  %142 = load i32, ptr %141, align 8, !tbaa !24
  %143 = and i32 %142, 4
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %160

145:                                              ; preds = %139
  %146 = load i32, ptr %16, align 4, !tbaa !9
  %147 = icmp eq i32 %146, 64
  br i1 %147, label %148, label %160

148:                                              ; preds = %145
  %149 = load ptr, ptr %9, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.png_struct_def, ptr %149, i32 0, i32 15
  %151 = load i32, ptr %150, align 4, !tbaa !23
  %152 = and i32 %151, 4096
  %153 = icmp eq i32 %152, 0
  br i1 %153, label %154, label %160

154:                                              ; preds = %148
  %155 = load i32, ptr %13, align 4, !tbaa !9
  %156 = icmp eq i32 %155, 2
  br i1 %156, label %162, label %157

157:                                              ; preds = %154
  %158 = load i32, ptr %13, align 4, !tbaa !9
  %159 = icmp eq i32 %158, 6
  br i1 %159, label %162, label %160

160:                                              ; preds = %157, %148, %145, %139
  %161 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %161, ptr noundef @.str.63)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %162

162:                                              ; preds = %160, %157, %154
  %163 = load ptr, ptr %9, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.png_struct_def, ptr %163, i32 0, i32 15
  %165 = load i32, ptr %164, align 4, !tbaa !23
  %166 = and i32 %165, 4096
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %170

168:                                              ; preds = %162
  %169 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %169, ptr noundef @.str.64)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %170

170:                                              ; preds = %168, %162
  br label %171

171:                                              ; preds = %170, %136
  %172 = load i32, ptr %17, align 4, !tbaa !9
  %173 = icmp eq i32 %172, 1
  br i1 %173, label %174, label %176

174:                                              ; preds = %171
  %175 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_error(ptr noundef %175, ptr noundef @.str.65) #5
  unreachable

176:                                              ; preds = %171
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i32 @png_gt(i64 noundef, i64 noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { noreturn "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 = { "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 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 #4 = { nounwind }
attributes #5 = { noreturn }

!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 1052}
!12 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !13, 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, !10, i64 300, !10, i64 304, !10, i64 308, !10, i64 312, !14, i64 320, !6, i64 432, !10, i64 440, !10, i64 444, !10, i64 448, !10, i64 452, !10, i64 456, !10, i64 460, !10, i64 464, !10, i64 468, !10, i64 472, !10, i64 476, !10, i64 480, !10, i64 484, !10, i64 488, !10, i64 492, !10, i64 496, !10, i64 500, !10, i64 504, !10, i64 508, !10, i64 512, !10, i64 516, !13, i64 520, !10, i64 528, !10, i64 532, !10, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !13, i64 576, !10, i64 584, !10, i64 588, !6, i64 592, !15, i64 600, !10, i64 604, !15, 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, !15, i64 626, !7, i64 628, !10, i64 632, !16, i64 636, !16, i64 646, !6, i64 656, !10, i64 664, !10, i64 668, !10, i64 672, !10, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !17, i64 728, !17, i64 733, !6, i64 744, !16, 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, !10, i64 840, !10, i64 844, !13, i64 848, !13, i64 856, !13, i64 864, !13, i64 872, !10, i64 880, !10, i64 884, !6, i64 888, !6, i64 896, !10, i64 904, !7, i64 908, !10, i64 940, !6, i64 944, !6, i64 952, !10, i64 960, !10, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !15, i64 978, !15, i64 980, !10, 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, !10, i64 1052, !10, i64 1056, !10, i64 1060, !13, i64 1064, !18, i64 1072, !13, i64 1104, !6, i64 1112, !13, i64 1120, !10, i64 1128, !10, i64 1132, !6, i64 1136, !7, i64 1144, !19, i64 1176}
!13 = !{!"long", !7, i64 0}
!14 = !{!"z_stream_s", !6, i64 0, !10, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !10, i64 88, !13, i64 96, !13, i64 104}
!15 = !{!"short", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, 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, !6, i64 8, !13, i64 16, !7, i64 24}
!19 = !{!"png_colorspace", !10, i64 0, !20, i64 4, !21, i64 36, !15, i64 72, !15, i64 74}
!20 = !{!"png_xy", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28}
!21 = !{!"png_XYZ", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32}
!22 = !{!12, !10, i64 1056}
!23 = !{!12, !10, i64 300}
!24 = !{!12, !10, i64 984}


; 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.50 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: noreturn
declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @png_check_IHDR(ptr noalias 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 #2 {
  %9 = icmp eq i32 %1, 0
  br i1 %9, label %.sink.split, label %10

10:                                               ; preds = %8
  %11 = icmp slt i32 %1, 0
  br i1 %11, label %.sink.split, label %12

.sink.split:                                      ; preds = %10, %8
  %.str.50.sink = phi ptr [ @.str.50, %8 ], [ @.str.51, %10 ]
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull %.str.50.sink) #3
  br label %12

12:                                               ; preds = %.sink.split, %10
  %.1 = phi i32 [ 0, %10 ], [ 1, %.sink.split ]
  %13 = add i32 %1, 7
  %14 = and i32 %13, -8
  %15 = zext i32 %14 to i64
  %16 = tail call i32 @png_gt(i64 noundef %15, i64 noundef 2305843009213693944)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %18, label %17

17:                                               ; preds = %12
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.52) #3
  br label %18

18:                                               ; preds = %17, %12
  %.2 = phi i32 [ 1, %17 ], [ %.1, %12 ]
  %19 = getelementptr inbounds i8, ptr %0, i64 1052
  %20 = load i32, ptr %19, align 4, !tbaa !5
  %21 = icmp ult i32 %20, %1
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.53) #3
  br label %23

23:                                               ; preds = %22, %18
  %.3 = phi i32 [ 1, %22 ], [ %.2, %18 ]
  %24 = icmp eq i32 %2, 0
  br i1 %24, label %.sink.split93, label %25

25:                                               ; preds = %23
  %26 = icmp slt i32 %2, 0
  br i1 %26, label %.sink.split93, label %27

.sink.split93:                                    ; preds = %25, %23
  %.str.54.sink = phi ptr [ @.str.54, %23 ], [ @.str.55, %25 ]
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull %.str.54.sink) #3
  br label %27

27:                                               ; preds = %.sink.split93, %25
  %.5 = phi i32 [ %.3, %25 ], [ 1, %.sink.split93 ]
  %28 = getelementptr inbounds i8, ptr %0, i64 1056
  %29 = load i32, ptr %28, align 8, !tbaa !20
  %30 = icmp ult i32 %29, %2
  br i1 %30, label %31, label %32

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

32:                                               ; preds = %31, %27
  %.6 = phi i32 [ 1, %31 ], [ %.5, %27 ]
  switch i32 %3, label %33 [
    i32 16, label %34
    i32 8, label %34
    i32 4, label %34
    i32 2, label %34
    i32 1, label %34
  ]

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

34:                                               ; preds = %32, %32, %32, %32, %32, %33
  %.7 = phi i32 [ 1, %33 ], [ %.6, %32 ], [ %.6, %32 ], [ %.6, %32 ], [ %.6, %32 ], [ %.6, %32 ]
  %35 = and i32 %4, -5
  %36 = icmp eq i32 %35, 1
  %37 = icmp ugt i32 %4, 6
  %or.cond13 = or i1 %37, %36
  br i1 %or.cond13, label %38, label %39

38:                                               ; preds = %34
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.58) #3
  br label %39

39:                                               ; preds = %34, %38
  %.8 = phi i32 [ 1, %38 ], [ %.7, %34 ]
  %40 = icmp eq i32 %4, 3
  %41 = icmp sgt i32 %3, 8
  %or.cond15 = and i1 %41, %40
  br i1 %or.cond15, label %46, label %42

42:                                               ; preds = %39
  %43 = icmp eq i32 %4, 4
  %44 = icmp eq i32 %35, 2
  %or.cond19 = or i1 %43, %44
  %45 = icmp slt i32 %3, 8
  %or.cond21 = and i1 %45, %or.cond19
  br i1 %or.cond21, label %46, label %47

46:                                               ; preds = %42, %39
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.59) #3
  br label %47

47:                                               ; preds = %42, %46
  %.9 = phi i32 [ 1, %46 ], [ %.8, %42 ]
  %48 = icmp sgt i32 %5, 1
  br i1 %48, label %49, label %50

49:                                               ; preds = %47
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.60) #3
  br label %50

50:                                               ; preds = %49, %47
  %.10 = phi i32 [ 1, %49 ], [ %.9, %47 ]
  %.not77 = icmp eq i32 %6, 0
  br i1 %.not77, label %52, label %51

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

52:                                               ; preds = %51, %50
  %.11 = phi i32 [ 1, %51 ], [ %.10, %50 ]
  %53 = getelementptr inbounds i8, ptr %0, i64 300
  %54 = load i32, ptr %53, align 4, !tbaa !21
  %55 = and i32 %54, 4096
  %.not78 = icmp eq i32 %55, 0
  br i1 %.not78, label %60, label %56

56:                                               ; preds = %52
  %57 = getelementptr inbounds i8, ptr %0, i64 984
  %58 = load i32, ptr %57, align 8, !tbaa !22
  %.not79 = icmp eq i32 %58, 0
  br i1 %.not79, label %60, label %59

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

60:                                               ; preds = %59, %56, %52
  %.not80 = icmp eq i32 %7, 0
  br i1 %.not80, label %.thread88, label %61

61:                                               ; preds = %60
  %62 = getelementptr inbounds i8, ptr %0, i64 984
  %63 = load i32, ptr %62, align 8, !tbaa !22
  %64 = and i32 %63, 4
  %65 = icmp ne i32 %64, 0
  %66 = icmp eq i32 %7, 64
  %or.cond23 = and i1 %66, %65
  br i1 %or.cond23, label %67, label %71

67:                                               ; preds = %61
  %68 = load i32, ptr %53, align 4, !tbaa !21
  %69 = and i32 %68, 4096
  %70 = icmp eq i32 %69, 0
  %or.cond25 = icmp eq i32 %35, 2
  %or.cond = and i1 %or.cond25, %70
  br i1 %or.cond, label %.thread88, label %71

71:                                               ; preds = %61, %67
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.63) #3
  %.pre = load i32, ptr %53, align 4, !tbaa !21
  %.pre87 = and i32 %.pre, 4096
  %72 = icmp eq i32 %.pre87, 0
  br i1 %72, label %.thread91, label %.thread85

.thread85:                                        ; preds = %71
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.64) #3
  br label %.thread91

.thread88:                                        ; preds = %67, %60
  %73 = icmp eq i32 %.11, 1
  br i1 %73, label %.thread91, label %74

.thread91:                                        ; preds = %71, %.thread85, %.thread88
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.65) #4
  unreachable

74:                                               ; preds = %.thread88
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden i32 @png_gt(i64 noundef, i64 noundef) local_unnamed_addr #2

attributes #0 = { noreturn "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 = { "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 }
attributes #4 = { noreturn 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, !11, i64 1052}
!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 1056}
!21 = !{!6, !11, i64 300}
!22 = !{!6, !11, i64 984}


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