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

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

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

@__const.png_write_bKGD.png_bKGD = external hidden unnamed_addr constant [5 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [64 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @png_save_uint_16(ptr noundef, i32 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_write_chunk(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #0

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_bKGD(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [5 x i8], align 1
  %8 = alloca [6 x i8], align 1
  %9 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 5, ptr %7) #4
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %7, ptr align 1 @__const.png_write_bKGD.png_bKGD, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 6, ptr %8) #4
  %10 = load i32, ptr %6, align 4, !tbaa !9
  %11 = icmp eq i32 %10, 3
  br i1 %11, label %12, label %44

12:                                               ; preds = %3
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.png_struct_def, ptr %13, i32 0, i32 42
  %15 = load i16, ptr %14, align 8, !tbaa !11
  %16 = zext i16 %15 to i32
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %24, label %18

18:                                               ; preds = %12
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.png_struct_def, ptr %19, i32 0, i32 119
  %21 = load i32, ptr %20, align 8, !tbaa !21
  %22 = and i32 %21, 1
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %36, label %24

24:                                               ; preds = %18, %12
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.png_color_16_struct, ptr %25, i32 0, i32 0
  %27 = load i8, ptr %26, align 2, !tbaa !22
  %28 = zext i8 %27 to i32
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.png_struct_def, ptr %29, i32 0, i32 42
  %31 = load i16, ptr %30, align 8, !tbaa !11
  %32 = zext i16 %31 to i32
  %33 = icmp sge i32 %28, %32
  br i1 %33, label %34, label %36

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

36:                                               ; preds = %24, %18
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.png_color_16_struct, ptr %37, i32 0, i32 0
  %39 = load i8, ptr %38, align 2, !tbaa !22
  %40 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  store i8 %39, ptr %40, align 1, !tbaa !23
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds [5 x i8], ptr %7, i64 0, i64 0
  %43 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  call void @png_write_chunk(ptr noundef %41, ptr noundef %42, ptr noundef %43, i64 noundef 1)
  br label %113

44:                                               ; preds = %3
  %45 = load i32, ptr %6, align 4, !tbaa !9
  %46 = and i32 %45, 2
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %90

48:                                               ; preds = %44
  %49 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.png_color_16_struct, ptr %50, i32 0, i32 1
  %52 = load i16, ptr %51, align 2, !tbaa !24
  %53 = zext i16 %52 to i32
  call void @png_save_uint_16(ptr noundef %49, i32 noundef %53)
  %54 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %55 = getelementptr inbounds i8, ptr %54, i64 2
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.png_color_16_struct, ptr %56, i32 0, i32 2
  %58 = load i16, ptr %57, align 2, !tbaa !25
  %59 = zext i16 %58 to i32
  call void @png_save_uint_16(ptr noundef %55, i32 noundef %59)
  %60 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %61 = getelementptr inbounds i8, ptr %60, i64 4
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.png_color_16_struct, ptr %62, i32 0, i32 3
  %64 = load i16, ptr %63, align 2, !tbaa !26
  %65 = zext i16 %64 to i32
  call void @png_save_uint_16(ptr noundef %61, i32 noundef %65)
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.png_struct_def, ptr %66, i32 0, i32 51
  %68 = load i8, ptr %67, align 1, !tbaa !27
  %69 = zext i8 %68 to i32
  %70 = icmp eq i32 %69, 8
  br i1 %70, label %71, label %86

71:                                               ; preds = %48
  %72 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %73 = load i8, ptr %72, align 1, !tbaa !23
  %74 = zext i8 %73 to i32
  %75 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 2
  %76 = load i8, ptr %75, align 1, !tbaa !23
  %77 = zext i8 %76 to i32
  %78 = or i32 %74, %77
  %79 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 4
  %80 = load i8, ptr %79, align 1, !tbaa !23
  %81 = zext i8 %80 to i32
  %82 = or i32 %78, %81
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %71
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %85, ptr noundef @.str.28)
  store i32 1, ptr %9, align 4
  br label %114

86:                                               ; preds = %71, %48
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = getelementptr inbounds [5 x i8], ptr %7, i64 0, i64 0
  %89 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  call void @png_write_chunk(ptr noundef %87, ptr noundef %88, ptr noundef %89, i64 noundef 6)
  br label %112

90:                                               ; preds = %44
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.png_color_16_struct, ptr %91, i32 0, i32 4
  %93 = load i16, ptr %92, align 2, !tbaa !28
  %94 = zext i16 %93 to i32
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.png_struct_def, ptr %95, i32 0, i32 51
  %97 = load i8, ptr %96, align 1, !tbaa !27
  %98 = zext i8 %97 to i32
  %99 = shl i32 1, %98
  %100 = icmp sge i32 %94, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %90
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %102, ptr noundef @.str.29)
  store i32 1, ptr %9, align 4
  br label %114

103:                                              ; preds = %90
  %104 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.png_color_16_struct, ptr %105, i32 0, i32 4
  %107 = load i16, ptr %106, align 2, !tbaa !28
  %108 = zext i16 %107 to i32
  call void @png_save_uint_16(ptr noundef %104, i32 noundef %108)
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds [5 x i8], ptr %7, i64 0, i64 0
  %111 = getelementptr inbounds [6 x i8], ptr %8, i64 0, i64 0
  call void @png_write_chunk(ptr noundef %109, ptr noundef %110, ptr noundef %111, i64 noundef 2)
  br label %112

112:                                              ; preds = %103, %86
  br label %113

113:                                              ; preds = %112, %36
  store i32 0, ptr %9, align 4
  br label %114

114:                                              ; preds = %113, %101, %84, %34
  call void @llvm.lifetime.end.p0(i64 6, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr %7) #4
  %115 = load i32, ptr %9, align 4
  switch i32 %115, label %117 [
    i32 0, label %116
    i32 1, label %116
  ]

116:                                              ; preds = %114, %114
  ret void

117:                                              ; preds = %114
  unreachable
}

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

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


; 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"

@__const.png_write_bKGD.png_bKGD = external hidden unnamed_addr constant [5 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [64 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @png_save_uint_16(ptr noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: nounwind uwtable
declare dso_local void @png_write_chunk(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_bKGD(ptr noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca [5 x i8], align 1
  %5 = alloca [6 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %4) #4
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 1 dereferenceable(5) %4, ptr noundef nonnull align 1 dereferenceable(5) @__const.png_write_bKGD.png_bKGD, i64 5, i1 false)
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %5) #4
  %6 = icmp eq i32 %2, 3
  br i1 %6, label %7, label %20

7:                                                ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 576
  %9 = load i16, ptr %8, align 8, !tbaa !5
  %.not22 = icmp eq i16 %9, 0
  br i1 %.not22, label %10, label %14

10:                                               ; preds = %7
  %11 = getelementptr inbounds i8, ptr %0, i64 1032
  %12 = load i32, ptr %11, align 8, !tbaa !19
  %13 = and i32 %12, 1
  %.not23 = icmp eq i32 %13, 0
  br i1 %.not23, label %14, label %._crit_edge

._crit_edge:                                      ; preds = %10
  %.pre = load i8, ptr %1, align 2, !tbaa !20
  br label %18

14:                                               ; preds = %10, %7
  %15 = load i8, ptr %1, align 2, !tbaa !20
  %16 = zext i8 %15 to i16
  %.not24 = icmp ugt i16 %9, %16
  br i1 %.not24, label %18, label %17

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

18:                                               ; preds = %._crit_edge, %14
  %19 = phi i8 [ %.pre, %._crit_edge ], [ %15, %14 ]
  store i8 %19, ptr %5, align 1, !tbaa !21
  call void @png_write_chunk(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef nonnull %5, i64 noundef 1)
  br label %55

20:                                               ; preds = %3
  %21 = and i32 %2, 2
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %45, label %22

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %1, i64 2
  %24 = load i16, ptr %23, align 2, !tbaa !22
  %25 = zext i16 %24 to i32
  call void @png_save_uint_16(ptr noundef nonnull %5, i32 noundef %25)
  %26 = getelementptr inbounds i8, ptr %5, i64 2
  %27 = getelementptr inbounds i8, ptr %1, i64 4
  %28 = load i16, ptr %27, align 2, !tbaa !23
  %29 = zext i16 %28 to i32
  call void @png_save_uint_16(ptr noundef nonnull %26, i32 noundef %29)
  %30 = getelementptr inbounds i8, ptr %5, i64 4
  %31 = getelementptr inbounds i8, ptr %1, i64 6
  %32 = load i16, ptr %31, align 2, !tbaa !24
  %33 = zext i16 %32 to i32
  call void @png_save_uint_16(ptr noundef nonnull %30, i32 noundef %33)
  %34 = getelementptr inbounds i8, ptr %0, i64 591
  %35 = load i8, ptr %34, align 1, !tbaa !25
  %36 = icmp eq i8 %35, 8
  br i1 %36, label %37, label %44

37:                                               ; preds = %22
  %38 = load i8, ptr %5, align 1, !tbaa !21
  %39 = load i8, ptr %26, align 1, !tbaa !21
  %40 = or i8 %39, %38
  %41 = load i8, ptr %30, align 1, !tbaa !21
  %42 = or i8 %40, %41
  %.not21 = icmp eq i8 %42, 0
  br i1 %.not21, label %44, label %43

43:                                               ; preds = %37
  call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str.28) #4
  br label %55

44:                                               ; preds = %37, %22
  call void @png_write_chunk(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef nonnull %5, i64 noundef 6)
  br label %55

45:                                               ; preds = %20
  %46 = getelementptr inbounds i8, ptr %1, i64 8
  %47 = load i16, ptr %46, align 2, !tbaa !26
  %48 = zext i16 %47 to i32
  %49 = getelementptr inbounds i8, ptr %0, i64 591
  %50 = load i8, ptr %49, align 1, !tbaa !25
  %51 = zext nneg i8 %50 to i32
  %52 = shl nuw i32 1, %51
  %.not20 = icmp sgt i32 %52, %48
  br i1 %.not20, label %54, label %53

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

54:                                               ; preds = %45
  call void @png_save_uint_16(ptr noundef nonnull %5, i32 noundef %48)
  call void @png_write_chunk(ptr noundef nonnull %0, ptr noundef nonnull %4, ptr noundef nonnull %5, i64 noundef 2)
  br label %55

55:                                               ; preds = %18, %54, %44, %53, %43, %17
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %4) #4
  ret void
}

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

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


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