; LLVM IR from corentinartaud/graphics :: ThirdParty/FreeImage-3170/Source/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, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, 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, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, [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: noreturn
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) #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 %45

22:                                               ; preds = %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 %44

27:                                               ; preds = %22
  %28 = load i32, ptr %10, align 4, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = call i32 @png_gt(i64 noundef %29, i64 noundef 2305843009213693838)
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %34

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

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

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

42:                                               ; preds = %40, %34
  br label %43

43:                                               ; preds = %42, %32
  br label %44

44:                                               ; preds = %43, %25
  br label %45

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

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

50:                                               ; preds = %45
  %51 = load i32, ptr %11, align 4, !tbaa !9
  %52 = icmp ugt i32 %51, 2147483647
  br i1 %52, label %53, label %55

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

55:                                               ; preds = %50
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_struct_def, ptr %57, i32 0, i32 141
  %59 = load i32, ptr %58, align 8, !tbaa !22
  %60 = icmp ugt i32 %56, %59
  br i1 %60, label %61, label %63

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

63:                                               ; preds = %61, %55
  br label %64

64:                                               ; preds = %63, %53
  br label %65

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

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

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

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

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

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

82:                                               ; preds = %80, %77, %74, %71, %68, %65
  %83 = load i32, ptr %13, align 4, !tbaa !9
  %84 = icmp slt i32 %83, 0
  br i1 %84, label %94, label %85

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

139:                                              ; preds = %137, %132, %126
  %140 = load i32, ptr %16, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %174

142:                                              ; preds = %139
  %143 = load ptr, ptr %9, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.png_struct_def, ptr %143, i32 0, i32 130
  %145 = load i32, ptr %144, align 8, !tbaa !24
  %146 = and i32 %145, 4
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %163

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

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

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

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

163:                                              ; preds = %160, %151, %148, %142
  %164 = load ptr, ptr %9, align 8, !tbaa !5
  call void @png_warning(ptr noundef %164, ptr noundef @.str.63)
  store i32 1, ptr %17, align 4, !tbaa !9
  br label %165

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

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

173:                                              ; preds = %171, %165
  br label %174

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

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

179:                                              ; preds = %174
  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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 1116}
!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, !6, i64 576, !6, i64 584, !13, i64 592, !10, i64 600, !10, i64 604, !6, i64 608, !15, i64 616, !10, i64 620, !15, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !15, i64 640, !7, i64 642, !10, i64 644, !16, i64 648, !16, i64 658, !6, i64 672, !10, i64 680, !10, i64 684, !10, i64 688, !10, i64 692, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !17, i64 744, !17, i64 749, !6, i64 760, !16, i64 768, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !10, i64 856, !10, i64 860, !13, i64 864, !13, i64 872, !13, i64 880, !13, i64 888, !10, i64 896, !10, i64 900, !6, i64 904, !6, i64 912, !7, i64 920, !7, i64 921, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !7, i64 968, !7, i64 969, !10, i64 1000, !6, i64 1008, !6, i64 1016, !10, i64 1024, !10, i64 1028, !6, i64 1032, !7, i64 1040, !7, i64 1041, !15, i64 1042, !15, i64 1044, !10, i64 1048, !7, i64 1052, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !6, i64 1104, !7, i64 1112, !10, i64 1116, !10, i64 1120, !10, i64 1124, !13, i64 1128, !18, i64 1136, !13, i64 1168, !6, i64 1176, !13, i64 1184, !10, i64 1192, !10, i64 1196, !6, i64 1200, !7, i64 1208, !19, i64 1240}
!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 1120}
!23 = !{!12, !10, i64 300}
!24 = !{!12, !10, i64 1048}


; 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 %10, label %11

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

11:                                               ; preds = %8
  %12 = icmp slt i32 %1, 0
  br i1 %12, label %13, label %14

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

14:                                               ; preds = %11
  %15 = zext nneg i32 %1 to i64
  %16 = tail call i32 @png_gt(i64 noundef %15, i64 noundef 2305843009213693838)
  %.not = icmp eq i32 %16, 0
  br i1 %.not, label %18, label %17

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

18:                                               ; preds = %14
  %19 = getelementptr inbounds i8, ptr %0, i64 1116
  %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 = %13, %18, %22, %17, %10
  %.0 = phi i32 [ 1, %10 ], [ 1, %13 ], [ 1, %17 ], [ 1, %22 ], [ 0, %18 ]
  %24 = icmp eq i32 %2, 0
  br i1 %24, label %25, label %26

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

26:                                               ; preds = %23
  %27 = icmp slt i32 %2, 0
  br i1 %27, label %28, label %29

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

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %0, i64 1120
  %31 = load i32, ptr %30, align 8, !tbaa !20
  %32 = icmp ult i32 %31, %2
  br i1 %32, label %33, label %34

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

34:                                               ; preds = %28, %33, %29, %25
  %.1 = phi i32 [ 1, %25 ], [ 1, %28 ], [ 1, %33 ], [ %.0, %29 ]
  switch i32 %3, label %35 [
    i32 16, label %36
    i32 8, label %36
    i32 4, label %36
    i32 2, label %36
    i32 1, label %36
  ]

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

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

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

41:                                               ; preds = %36, %40
  %.3 = phi i32 [ 1, %40 ], [ %.2, %36 ]
  %42 = icmp eq i32 %4, 3
  %43 = icmp sgt i32 %3, 8
  %or.cond15 = and i1 %43, %42
  br i1 %or.cond15, label %48, label %44

44:                                               ; preds = %41
  %45 = icmp eq i32 %4, 4
  %46 = icmp eq i32 %37, 2
  %or.cond19 = or i1 %45, %46
  %47 = icmp slt i32 %3, 8
  %or.cond21 = and i1 %47, %or.cond19
  br i1 %or.cond21, label %48, label %49

48:                                               ; preds = %44, %41
  tail call void @png_warning(ptr noundef %0, ptr noundef nonnull @.str.59) #3
  br label %49

49:                                               ; preds = %44, %48
  %.4 = phi i32 [ 1, %48 ], [ %.3, %44 ]
  %50 = icmp sgt i32 %5, 1
  br i1 %50, label %51, label %52

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

52:                                               ; preds = %51, %49
  %.5 = phi i32 [ 1, %51 ], [ %.4, %49 ]
  %.not79 = icmp eq i32 %6, 0
  br i1 %.not79, label %54, label %53

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

54:                                               ; preds = %53, %52
  %.6 = phi i32 [ 1, %53 ], [ %.5, %52 ]
  %55 = getelementptr inbounds i8, ptr %0, i64 300
  %56 = load i32, ptr %55, align 4, !tbaa !21
  %57 = and i32 %56, 4096
  %.not80 = icmp eq i32 %57, 0
  br i1 %.not80, label %62, label %58

58:                                               ; preds = %54
  %59 = getelementptr inbounds i8, ptr %0, i64 1048
  %60 = load i32, ptr %59, align 8, !tbaa !22
  %.not81 = icmp eq i32 %60, 0
  br i1 %.not81, label %62, label %61

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

62:                                               ; preds = %61, %58, %54
  %.not82 = icmp eq i32 %7, 0
  br i1 %.not82, label %.thread86, label %63

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

69:                                               ; preds = %63
  %70 = load i32, ptr %55, align 4, !tbaa !21
  %71 = and i32 %70, 4096
  %72 = icmp eq i32 %71, 0
  %or.cond25 = icmp eq i32 %37, 2
  %or.cond = and i1 %or.cond25, %72
  br i1 %or.cond, label %.thread86, label %73

73:                                               ; preds = %63, %69
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.63) #3
  %.pre = load i32, ptr %55, align 4, !tbaa !21
  %.pre85 = and i32 %.pre, 4096
  %74 = icmp eq i32 %.pre85, 0
  br i1 %74, label %.thread89, label %.thread

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

.thread86:                                        ; preds = %69, %62
  %75 = icmp eq i32 %.6, 1
  br i1 %75, label %.thread89, label %76

.thread89:                                        ; preds = %73, %.thread, %.thread86
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.65) #4
  unreachable

76:                                               ; preds = %.thread86
  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 1116}
!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, !9, i64 576, !9, i64 584, !10, i64 592, !11, i64 600, !11, i64 604, !9, i64 608, !13, i64 616, !11, i64 620, !13, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !13, i64 640, !7, i64 642, !11, i64 644, !14, i64 648, !14, i64 658, !9, i64 672, !11, i64 680, !11, i64 684, !11, i64 688, !11, i64 692, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !15, i64 744, !15, i64 749, !9, i64 760, !14, i64 768, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !11, i64 856, !11, i64 860, !10, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !11, i64 896, !11, i64 900, !9, i64 904, !9, i64 912, !7, i64 920, !7, i64 921, !9, i64 928, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !7, i64 968, !7, i64 969, !11, i64 1000, !9, i64 1008, !9, i64 1016, !11, i64 1024, !11, i64 1028, !9, i64 1032, !7, i64 1040, !7, i64 1041, !13, i64 1042, !13, i64 1044, !11, i64 1048, !7, i64 1052, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !9, i64 1104, !7, i64 1112, !11, i64 1116, !11, i64 1120, !11, i64 1124, !10, i64 1128, !16, i64 1136, !10, i64 1168, !9, i64 1176, !10, i64 1184, !11, i64 1192, !11, i64 1196, !9, i64 1200, !7, i64 1208, !17, i64 1240}
!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 1120}
!21 = !{!6, !11, i64 300}
!22 = !{!6, !11, i64 1048}


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