; 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.48 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [34 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

; Function Attrs: nounwind uwtable
define dso_local void @png_colorspace_set_rgb_coefficients(ptr noalias noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.png_struct_def, ptr %8, i32 0, i32 119
  %10 = load i8, ptr %9, align 1, !tbaa !9
  %11 = zext i8 %10 to i32
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %13, label %165

13:                                               ; preds = %1
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.png_struct_def, ptr %14, i32 0, i32 144
  %16 = getelementptr inbounds %struct.png_colorspace, ptr %15, i32 0, i32 4
  %17 = load i16, ptr %16, align 2, !tbaa !21
  %18 = zext i16 %17 to i32
  %19 = and i32 %18, 2
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %165

21:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.png_struct_def, ptr %22, i32 0, i32 144
  %24 = getelementptr inbounds %struct.png_colorspace, ptr %23, i32 0, i32 2
  %25 = getelementptr inbounds %struct.png_XYZ, ptr %24, i32 0, i32 1
  %26 = load i32, ptr %25, align 4, !tbaa !22
  store i32 %26, ptr %3, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.png_struct_def, ptr %27, i32 0, i32 144
  %29 = getelementptr inbounds %struct.png_colorspace, ptr %28, i32 0, i32 2
  %30 = getelementptr inbounds %struct.png_XYZ, ptr %29, i32 0, i32 4
  %31 = load i32, ptr %30, align 4, !tbaa !24
  store i32 %31, ptr %4, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.png_struct_def, ptr %32, i32 0, i32 144
  %34 = getelementptr inbounds %struct.png_colorspace, ptr %33, i32 0, i32 2
  %35 = getelementptr inbounds %struct.png_XYZ, ptr %34, i32 0, i32 7
  %36 = load i32, ptr %35, align 4, !tbaa !25
  store i32 %36, ptr %5, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %37 = load i32, ptr %3, align 4, !tbaa !23
  %38 = load i32, ptr %4, align 4, !tbaa !23
  %39 = add nsw i32 %37, %38
  %40 = load i32, ptr %5, align 4, !tbaa !23
  %41 = add nsw i32 %39, %40
  store i32 %41, ptr %6, align 4, !tbaa !23
  %42 = load i32, ptr %6, align 4, !tbaa !23
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %162

44:                                               ; preds = %21
  %45 = load i32, ptr %3, align 4, !tbaa !23
  %46 = icmp sge i32 %45, 0
  br i1 %46, label %47, label %162

47:                                               ; preds = %44
  %48 = load i32, ptr %3, align 4, !tbaa !23
  %49 = load i32, ptr %6, align 4, !tbaa !23
  %50 = call i32 @png_muldiv(ptr noundef %3, i32 noundef %48, i32 noundef 32768, i32 noundef %49)
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %162

52:                                               ; preds = %47
  %53 = load i32, ptr %3, align 4, !tbaa !23
  %54 = icmp sge i32 %53, 0
  br i1 %54, label %55, label %162

55:                                               ; preds = %52
  %56 = load i32, ptr %3, align 4, !tbaa !23
  %57 = icmp sle i32 %56, 32768
  br i1 %57, label %58, label %162

58:                                               ; preds = %55
  %59 = load i32, ptr %4, align 4, !tbaa !23
  %60 = icmp sge i32 %59, 0
  br i1 %60, label %61, label %162

61:                                               ; preds = %58
  %62 = load i32, ptr %4, align 4, !tbaa !23
  %63 = load i32, ptr %6, align 4, !tbaa !23
  %64 = call i32 @png_muldiv(ptr noundef %4, i32 noundef %62, i32 noundef 32768, i32 noundef %63)
  %65 = icmp ne i32 %64, 0
  br i1 %65, label %66, label %162

66:                                               ; preds = %61
  %67 = load i32, ptr %4, align 4, !tbaa !23
  %68 = icmp sge i32 %67, 0
  br i1 %68, label %69, label %162

69:                                               ; preds = %66
  %70 = load i32, ptr %4, align 4, !tbaa !23
  %71 = icmp sle i32 %70, 32768
  br i1 %71, label %72, label %162

72:                                               ; preds = %69
  %73 = load i32, ptr %5, align 4, !tbaa !23
  %74 = icmp sge i32 %73, 0
  br i1 %74, label %75, label %162

75:                                               ; preds = %72
  %76 = load i32, ptr %5, align 4, !tbaa !23
  %77 = load i32, ptr %6, align 4, !tbaa !23
  %78 = call i32 @png_muldiv(ptr noundef %5, i32 noundef %76, i32 noundef 32768, i32 noundef %77)
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %162

80:                                               ; preds = %75
  %81 = load i32, ptr %5, align 4, !tbaa !23
  %82 = icmp sge i32 %81, 0
  br i1 %82, label %83, label %162

83:                                               ; preds = %80
  %84 = load i32, ptr %5, align 4, !tbaa !23
  %85 = icmp sle i32 %84, 32768
  br i1 %85, label %86, label %162

86:                                               ; preds = %83
  %87 = load i32, ptr %3, align 4, !tbaa !23
  %88 = load i32, ptr %4, align 4, !tbaa !23
  %89 = add nsw i32 %87, %88
  %90 = load i32, ptr %5, align 4, !tbaa !23
  %91 = add nsw i32 %89, %90
  %92 = icmp sle i32 %91, 32769
  br i1 %92, label %93, label %162

93:                                               ; preds = %86
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  store i32 0, ptr %7, align 4, !tbaa !23
  %94 = load i32, ptr %3, align 4, !tbaa !23
  %95 = load i32, ptr %4, align 4, !tbaa !23
  %96 = add nsw i32 %94, %95
  %97 = load i32, ptr %5, align 4, !tbaa !23
  %98 = add nsw i32 %96, %97
  %99 = icmp sgt i32 %98, 32768
  br i1 %99, label %100, label %101

100:                                              ; preds = %93
  store i32 -1, ptr %7, align 4, !tbaa !23
  br label %110

101:                                              ; preds = %93
  %102 = load i32, ptr %3, align 4, !tbaa !23
  %103 = load i32, ptr %4, align 4, !tbaa !23
  %104 = add nsw i32 %102, %103
  %105 = load i32, ptr %5, align 4, !tbaa !23
  %106 = add nsw i32 %104, %105
  %107 = icmp slt i32 %106, 32768
  br i1 %107, label %108, label %109

108:                                              ; preds = %101
  store i32 1, ptr %7, align 4, !tbaa !23
  br label %109

109:                                              ; preds = %108, %101
  br label %110

110:                                              ; preds = %109, %100
  %111 = load i32, ptr %7, align 4, !tbaa !23
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %143

113:                                              ; preds = %110
  %114 = load i32, ptr %4, align 4, !tbaa !23
  %115 = load i32, ptr %3, align 4, !tbaa !23
  %116 = icmp sge i32 %114, %115
  br i1 %116, label %117, label %125

117:                                              ; preds = %113
  %118 = load i32, ptr %4, align 4, !tbaa !23
  %119 = load i32, ptr %5, align 4, !tbaa !23
  %120 = icmp sge i32 %118, %119
  br i1 %120, label %121, label %125

121:                                              ; preds = %117
  %122 = load i32, ptr %7, align 4, !tbaa !23
  %123 = load i32, ptr %4, align 4, !tbaa !23
  %124 = add nsw i32 %123, %122
  store i32 %124, ptr %4, align 4, !tbaa !23
  br label %142

125:                                              ; preds = %117, %113
  %126 = load i32, ptr %3, align 4, !tbaa !23
  %127 = load i32, ptr %4, align 4, !tbaa !23
  %128 = icmp sge i32 %126, %127
  br i1 %128, label %129, label %137

129:                                              ; preds = %125
  %130 = load i32, ptr %3, align 4, !tbaa !23
  %131 = load i32, ptr %5, align 4, !tbaa !23
  %132 = icmp sge i32 %130, %131
  br i1 %132, label %133, label %137

133:                                              ; preds = %129
  %134 = load i32, ptr %7, align 4, !tbaa !23
  %135 = load i32, ptr %3, align 4, !tbaa !23
  %136 = add nsw i32 %135, %134
  store i32 %136, ptr %3, align 4, !tbaa !23
  br label %141

137:                                              ; preds = %129, %125
  %138 = load i32, ptr %7, align 4, !tbaa !23
  %139 = load i32, ptr %5, align 4, !tbaa !23
  %140 = add nsw i32 %139, %138
  store i32 %140, ptr %5, align 4, !tbaa !23
  br label %141

141:                                              ; preds = %137, %133
  br label %142

142:                                              ; preds = %141, %121
  br label %143

143:                                              ; preds = %142, %110
  %144 = load i32, ptr %3, align 4, !tbaa !23
  %145 = load i32, ptr %4, align 4, !tbaa !23
  %146 = add nsw i32 %144, %145
  %147 = load i32, ptr %5, align 4, !tbaa !23
  %148 = add nsw i32 %146, %147
  %149 = icmp ne i32 %148, 32768
  br i1 %149, label %150, label %152

150:                                              ; preds = %143
  %151 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %151, ptr noundef @.str.48) #4
  unreachable

152:                                              ; preds = %143
  %153 = load i32, ptr %3, align 4, !tbaa !23
  %154 = trunc i32 %153 to i16
  %155 = load ptr, ptr %2, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_struct_def, ptr %155, i32 0, i32 120
  store i16 %154, ptr %156, align 2, !tbaa !26
  %157 = load i32, ptr %4, align 4, !tbaa !23
  %158 = trunc i32 %157 to i16
  %159 = load ptr, ptr %2, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.png_struct_def, ptr %159, i32 0, i32 121
  store i16 %158, ptr %160, align 4, !tbaa !27
  br label %161

161:                                              ; preds = %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %164

162:                                              ; preds = %86, %83, %80, %75, %72, %69, %66, %61, %58, %55, %52, %47, %44, %21
  %163 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %163, ptr noundef @.str.49) #4
  unreachable

164:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %165

165:                                              ; preds = %164, %13, %1
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_muldiv(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #2

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 = { 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 }

!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, !7, i64 977}
!10 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !11, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !12, i64 300, !12, i64 304, !12, i64 308, !12, i64 312, !13, i64 320, !6, i64 432, !12, i64 440, !12, i64 444, !12, i64 448, !12, i64 452, !12, i64 456, !12, i64 460, !12, i64 464, !12, i64 468, !12, i64 472, !12, i64 476, !12, i64 480, !12, i64 484, !12, i64 488, !12, i64 492, !12, i64 496, !12, i64 500, !12, i64 504, !12, i64 508, !12, i64 512, !12, i64 516, !11, i64 520, !12, i64 528, !12, i64 532, !12, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !11, i64 576, !12, i64 584, !12, i64 588, !6, i64 592, !14, i64 600, !12, i64 604, !14, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !14, i64 626, !7, i64 628, !12, i64 632, !15, i64 636, !15, i64 646, !6, i64 656, !12, i64 664, !12, i64 668, !12, i64 672, !12, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !16, i64 728, !16, i64 733, !6, i64 744, !15, i64 752, !6, i64 768, !6, i64 776, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !12, i64 840, !12, i64 844, !11, i64 848, !11, i64 856, !11, i64 864, !11, i64 872, !12, i64 880, !12, i64 884, !6, i64 888, !6, i64 896, !12, i64 904, !7, i64 908, !12, i64 940, !6, i64 944, !6, i64 952, !12, i64 960, !12, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !14, i64 978, !14, i64 980, !12, i64 984, !7, i64 988, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !6, i64 1040, !7, i64 1048, !12, i64 1052, !12, i64 1056, !12, i64 1060, !11, i64 1064, !17, i64 1072, !11, i64 1104, !6, i64 1112, !11, i64 1120, !12, i64 1128, !12, i64 1132, !6, i64 1136, !7, i64 1144, !18, i64 1176}
!11 = !{!"long", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"z_stream_s", !6, i64 0, !12, i64 8, !11, i64 16, !6, i64 24, !12, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !11, i64 96, !11, i64 104}
!14 = !{!"short", !7, i64 0}
!15 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!16 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!17 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !11, i64 16, !7, i64 24}
!18 = !{!"png_colorspace", !12, i64 0, !19, i64 4, !20, i64 36, !14, i64 72, !14, i64 74}
!19 = !{!"png_xy", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28}
!20 = !{!"png_XYZ", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32}
!21 = !{!10, !14, i64 1250}
!22 = !{!10, !12, i64 1216}
!23 = !{!12, !12, i64 0}
!24 = !{!10, !12, i64 1228}
!25 = !{!10, !12, i64 1240}
!26 = !{!10, !14, i64 978}
!27 = !{!10, !14, i64 980}


; 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.48 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: mustprogress 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) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_colorspace_set_rgb_coefficients(ptr noalias noundef %0) local_unnamed_addr #2 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = getelementptr inbounds i8, ptr %0, i64 977
  %6 = load i8, ptr %5, align 1, !tbaa !5
  %7 = icmp eq i8 %6, 0
  br i1 %7, label %8, label %70

8:                                                ; preds = %1
  %9 = getelementptr inbounds i8, ptr %0, i64 1250
  %10 = load i16, ptr %9, align 2, !tbaa !20
  %11 = and i16 %10, 2
  %.not = icmp eq i16 %11, 0
  br i1 %.not, label %70, label %12

12:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  %13 = getelementptr inbounds i8, ptr %0, i64 1216
  %14 = load i32, ptr %13, align 4, !tbaa !21
  store i32 %14, ptr %2, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %15 = getelementptr inbounds i8, ptr %0, i64 1228
  %16 = load i32, ptr %15, align 4, !tbaa !23
  store i32 %16, ptr %3, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %17 = getelementptr inbounds i8, ptr %0, i64 1240
  %18 = load i32, ptr %17, align 4, !tbaa !24
  store i32 %18, ptr %4, align 4, !tbaa !22
  %19 = add nsw i32 %16, %14
  %20 = add nsw i32 %19, %18
  %21 = icmp sgt i32 %20, 0
  %22 = icmp sgt i32 %14, -1
  %or.cond = and i1 %22, %21
  br i1 %or.cond, label %23, label %69

23:                                               ; preds = %12
  %24 = call i32 @png_muldiv(ptr noundef nonnull %2, i32 noundef %14, i32 noundef 32768, i32 noundef %20)
  %25 = icmp ne i32 %24, 0
  %26 = load i32, ptr %2, align 4
  %27 = icmp ult i32 %26, 32769
  %or.cond5 = select i1 %25, i1 %27, i1 false
  %28 = icmp sgt i32 %16, -1
  %or.cond7 = and i1 %or.cond5, %28
  br i1 %or.cond7, label %29, label %69

29:                                               ; preds = %23
  %30 = call i32 @png_muldiv(ptr noundef nonnull %3, i32 noundef %16, i32 noundef 32768, i32 noundef %20)
  %31 = icmp ne i32 %30, 0
  %32 = load i32, ptr %3, align 4
  %33 = icmp ult i32 %32, 32769
  %or.cond11 = select i1 %31, i1 %33, i1 false
  %34 = icmp sgt i32 %18, -1
  %or.cond13 = and i1 %or.cond11, %34
  br i1 %or.cond13, label %35, label %69

35:                                               ; preds = %29
  %36 = call i32 @png_muldiv(ptr noundef nonnull %4, i32 noundef %18, i32 noundef 32768, i32 noundef %20)
  %37 = icmp ne i32 %36, 0
  %38 = load i32, ptr %4, align 4
  %39 = icmp ult i32 %38, 32769
  %or.cond17 = select i1 %37, i1 %39, i1 false
  br i1 %or.cond17, label %40, label %69

40:                                               ; preds = %35
  %41 = load i32, ptr %2, align 4, !tbaa !22
  %42 = load i32, ptr %3, align 4, !tbaa !22
  %43 = add i32 %41, %38
  %44 = add i32 %43, %42
  %45 = icmp slt i32 %44, 32770
  br i1 %45, label %46, label %69

46:                                               ; preds = %40
  %47 = icmp eq i32 %44, 32769
  br i1 %47, label %.thread, label %48

48:                                               ; preds = %46
  %49 = icmp slt i32 %44, 32768
  br i1 %49, label %.thread, label %57

.thread:                                          ; preds = %46, %48
  %.052 = phi i32 [ 1, %48 ], [ -1, %46 ]
  %.not42 = icmp slt i32 %42, %41
  %.not43 = icmp slt i32 %42, %38
  %or.cond48 = select i1 %.not42, i1 true, i1 %.not43
  br i1 %or.cond48, label %52, label %50

50:                                               ; preds = %.thread
  %51 = add nsw i32 %.052, %42
  store i32 %51, ptr %3, align 4, !tbaa !22
  br label %57

52:                                               ; preds = %.thread
  %.not44 = icmp slt i32 %41, %42
  %.not45 = icmp slt i32 %41, %38
  %or.cond49 = select i1 %.not44, i1 true, i1 %.not45
  br i1 %or.cond49, label %55, label %53

53:                                               ; preds = %52
  %54 = add nsw i32 %.052, %41
  store i32 %54, ptr %2, align 4, !tbaa !22
  br label %57

55:                                               ; preds = %52
  %56 = add nsw i32 %.052, %38
  store i32 %56, ptr %4, align 4, !tbaa !22
  br label %57

57:                                               ; preds = %50, %55, %53, %48
  %58 = phi i32 [ %38, %50 ], [ %56, %55 ], [ %38, %53 ], [ %38, %48 ]
  %59 = phi i32 [ %51, %50 ], [ %42, %55 ], [ %42, %53 ], [ %42, %48 ]
  %60 = phi i32 [ %41, %50 ], [ %41, %55 ], [ %54, %53 ], [ %41, %48 ]
  %61 = add nsw i32 %59, %60
  %62 = add nsw i32 %61, %58
  %.not46 = icmp eq i32 %62, 32768
  br i1 %.not46, label %64, label %63

63:                                               ; preds = %57
  call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.48) #4
  unreachable

64:                                               ; preds = %57
  %65 = trunc i32 %60 to i16
  %66 = getelementptr inbounds i8, ptr %0, i64 978
  store i16 %65, ptr %66, align 2, !tbaa !25
  %67 = trunc i32 %59 to i16
  %68 = getelementptr inbounds i8, ptr %0, i64 980
  store i16 %67, ptr %68, align 4, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br label %70

69:                                               ; preds = %40, %35, %29, %23, %12
  call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.49) #4
  unreachable

70:                                               ; preds = %64, %8, %1
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @png_muldiv(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { mustprogress 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 = { 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, !7, i64 977}
!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, !13, i64 1250}
!21 = !{!6, !11, i64 1216}
!22 = !{!11, !11, i64 0}
!23 = !{!6, !11, i64 1228}
!24 = !{!6, !11, i64 1240}
!25 = !{!6, !13, i64 978}
!26 = !{!6, !13, i64 980}


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