; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (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, 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.19 = external hidden unnamed_addr constant [29 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare hidden void @png_write_complete_chunk(ptr noalias noundef, i32 noundef, ptr noundef, i64 noundef) #1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_sBIT(ptr noalias noundef %0, ptr noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca [4 x i8], align 1
  %8 = alloca i64, align 8
  %9 = alloca i8, align 1
  %10 = 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 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %11 = load i32, ptr %6, align 4, !tbaa !9
  %12 = and i32 %11, 2
  %13 = icmp ne i32 %12, 0
  br i1 %13, label %14, label %85

14:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #3
  %15 = load i32, ptr %6, align 4, !tbaa !9
  %16 = icmp eq i32 %15, 3
  br i1 %16, label %17, label %18

17:                                               ; preds = %14
  br label %23

18:                                               ; preds = %14
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.png_struct_def, ptr %19, i32 0, i32 63
  %21 = load i8, ptr %20, align 1, !tbaa !11
  %22 = zext i8 %21 to i32
  br label %23

23:                                               ; preds = %18, %17
  %24 = phi i32 [ 8, %17 ], [ %22, %18 ]
  %25 = trunc i32 %24 to i8
  store i8 %25, ptr %9, align 1, !tbaa !22
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.png_color_8_struct, ptr %26, i32 0, i32 0
  %28 = load i8, ptr %27, align 1, !tbaa !23
  %29 = zext i8 %28 to i32
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %67, label %31

31:                                               ; preds = %23
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.png_color_8_struct, ptr %32, i32 0, i32 0
  %34 = load i8, ptr %33, align 1, !tbaa !23
  %35 = zext i8 %34 to i32
  %36 = load i8, ptr %9, align 1, !tbaa !22
  %37 = zext i8 %36 to i32
  %38 = icmp sgt i32 %35, %37
  br i1 %38, label %67, label %39

39:                                               ; preds = %31
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.png_color_8_struct, ptr %40, i32 0, i32 1
  %42 = load i8, ptr %41, align 1, !tbaa !24
  %43 = zext i8 %42 to i32
  %44 = icmp eq i32 %43, 0
  br i1 %44, label %67, label %45

45:                                               ; preds = %39
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.png_color_8_struct, ptr %46, i32 0, i32 1
  %48 = load i8, ptr %47, align 1, !tbaa !24
  %49 = zext i8 %48 to i32
  %50 = load i8, ptr %9, align 1, !tbaa !22
  %51 = zext i8 %50 to i32
  %52 = icmp sgt i32 %49, %51
  br i1 %52, label %67, label %53

53:                                               ; preds = %45
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.png_color_8_struct, ptr %54, i32 0, i32 2
  %56 = load i8, ptr %55, align 1, !tbaa !25
  %57 = zext i8 %56 to i32
  %58 = icmp eq i32 %57, 0
  br i1 %58, label %67, label %59

59:                                               ; preds = %53
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.png_color_8_struct, ptr %60, i32 0, i32 2
  %62 = load i8, ptr %61, align 1, !tbaa !25
  %63 = zext i8 %62 to i32
  %64 = load i8, ptr %9, align 1, !tbaa !22
  %65 = zext i8 %64 to i32
  %66 = icmp sgt i32 %63, %65
  br i1 %66, label %67, label %69

67:                                               ; preds = %59, %53, %45, %39, %31, %23
  %68 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %68, ptr noundef @.str.19)
  store i32 1, ptr %10, align 4
  br label %82

69:                                               ; preds = %59
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.png_color_8_struct, ptr %70, i32 0, i32 0
  %72 = load i8, ptr %71, align 1, !tbaa !23
  %73 = getelementptr inbounds [4 x i8], ptr %7, i64 0, i64 0
  store i8 %72, ptr %73, align 1, !tbaa !22
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.png_color_8_struct, ptr %74, i32 0, i32 1
  %76 = load i8, ptr %75, align 1, !tbaa !24
  %77 = getelementptr inbounds [4 x i8], ptr %7, i64 0, i64 1
  store i8 %76, ptr %77, align 1, !tbaa !22
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.png_color_8_struct, ptr %78, i32 0, i32 2
  %80 = load i8, ptr %79, align 1, !tbaa !25
  %81 = getelementptr inbounds [4 x i8], ptr %7, i64 0, i64 2
  store i8 %80, ptr %81, align 1, !tbaa !22
  store i64 3, ptr %8, align 8, !tbaa !26
  store i32 0, ptr %10, align 4
  br label %82

82:                                               ; preds = %69, %67
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #3
  %83 = load i32, ptr %10, align 4
  switch i32 %83, label %141 [
    i32 0, label %84
  ]

84:                                               ; preds = %82
  br label %108

85:                                               ; preds = %3
  %86 = load ptr, ptr %5, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.png_color_8_struct, ptr %86, i32 0, i32 3
  %88 = load i8, ptr %87, align 1, !tbaa !27
  %89 = zext i8 %88 to i32
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %101, label %91

91:                                               ; preds = %85
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.png_color_8_struct, ptr %92, i32 0, i32 3
  %94 = load i8, ptr %93, align 1, !tbaa !27
  %95 = zext i8 %94 to i32
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.png_struct_def, ptr %96, i32 0, i32 63
  %98 = load i8, ptr %97, align 1, !tbaa !11
  %99 = zext i8 %98 to i32
  %100 = icmp sgt i32 %95, %99
  br i1 %100, label %101, label %103

101:                                              ; preds = %91, %85
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %102, ptr noundef @.str.19)
  store i32 1, ptr %10, align 4
  br label %141

103:                                              ; preds = %91
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.png_color_8_struct, ptr %104, i32 0, i32 3
  %106 = load i8, ptr %105, align 1, !tbaa !27
  %107 = getelementptr inbounds [4 x i8], ptr %7, i64 0, i64 0
  store i8 %106, ptr %107, align 1, !tbaa !22
  store i64 1, ptr %8, align 8, !tbaa !26
  br label %108

108:                                              ; preds = %103, %84
  %109 = load i32, ptr %6, align 4, !tbaa !9
  %110 = and i32 %109, 4
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %137

112:                                              ; preds = %108
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.png_color_8_struct, ptr %113, i32 0, i32 4
  %115 = load i8, ptr %114, align 1, !tbaa !28
  %116 = zext i8 %115 to i32
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %128, label %118

118:                                              ; preds = %112
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_color_8_struct, ptr %119, i32 0, i32 4
  %121 = load i8, ptr %120, align 1, !tbaa !28
  %122 = zext i8 %121 to i32
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 63
  %125 = load i8, ptr %124, align 1, !tbaa !11
  %126 = zext i8 %125 to i32
  %127 = icmp sgt i32 %122, %126
  br i1 %127, label %128, label %130

128:                                              ; preds = %118, %112
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_warning(ptr noundef %129, ptr noundef @.str.19)
  store i32 1, ptr %10, align 4
  br label %141

130:                                              ; preds = %118
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.png_color_8_struct, ptr %131, i32 0, i32 4
  %133 = load i8, ptr %132, align 1, !tbaa !28
  %134 = load i64, ptr %8, align 8, !tbaa !26
  %135 = add i64 %134, 1
  store i64 %135, ptr %8, align 8, !tbaa !26
  %136 = getelementptr inbounds [4 x i8], ptr %7, i64 0, i64 %134
  store i8 %133, ptr %136, align 1, !tbaa !22
  br label %137

137:                                              ; preds = %130, %108
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = getelementptr inbounds [4 x i8], ptr %7, i64 0, i64 0
  %140 = load i64, ptr %8, align 8, !tbaa !26
  call void @png_write_complete_chunk(ptr noundef %138, i32 noundef 1933723988, ptr noundef %139, i64 noundef %140)
  store i32 0, ptr %10, align 4
  br label %141

141:                                              ; preds = %137, %128, %101, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  %142 = load i32, ptr %10, align 4
  switch i32 %142, label %144 [
    i32 0, label %143
    i32 1, label %143
  ]

143:                                              ; preds = %141, %141
  ret void

144:                                              ; preds = %141
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !7, i64 617}
!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 = !{!7, !7, i64 0}
!23 = !{!17, !7, i64 0}
!24 = !{!17, !7, i64 1}
!25 = !{!17, !7, i64 2}
!26 = !{!13, !13, i64 0}
!27 = !{!17, !7, i64 3}
!28 = !{!17, !7, i64 4}


; 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.19 = external hidden unnamed_addr constant [29 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare hidden void @png_write_complete_chunk(ptr noalias noundef, i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_sBIT(ptr noalias noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #1 {
  %4 = alloca [4 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %5 = and i32 %2, 2
  %.not = icmp eq i32 %5, 0
  %.1.sroa.gep = getelementptr inbounds i8, ptr %4, i64 3
  %.1.sroa.gep43 = getelementptr inbounds i8, ptr %4, i64 1
  br i1 %.not, label %32, label %6

6:                                                ; preds = %3
  %7 = icmp eq i32 %2, 3
  br i1 %7, label %12, label %8

8:                                                ; preds = %6
  %9 = getelementptr inbounds i8, ptr %0, i64 617
  %10 = load i8, ptr %9, align 1, !tbaa !5
  %11 = zext i8 %10 to i32
  br label %12

12:                                               ; preds = %6, %8
  %13 = phi i32 [ %11, %8 ], [ 8, %6 ]
  %14 = load i8, ptr %1, align 1, !tbaa !20
  %15 = icmp eq i8 %14, 0
  %16 = zext i8 %14 to i32
  %17 = icmp ult i32 %13, %16
  %or.cond = select i1 %15, i1 true, i1 %17
  br i1 %or.cond, label %.critedge, label %18

18:                                               ; preds = %12
  %19 = getelementptr inbounds i8, ptr %1, i64 1
  %20 = load i8, ptr %19, align 1, !tbaa !21
  %21 = icmp eq i8 %20, 0
  %22 = zext i8 %20 to i32
  %23 = icmp ult i32 %13, %22
  %or.cond40 = select i1 %21, i1 true, i1 %23
  br i1 %or.cond40, label %.critedge, label %24

24:                                               ; preds = %18
  %25 = getelementptr inbounds i8, ptr %1, i64 2
  %26 = load i8, ptr %25, align 1, !tbaa !22
  %27 = icmp eq i8 %26, 0
  %28 = zext i8 %26 to i32
  %29 = icmp ult i32 %13, %28
  %or.cond42 = select i1 %27, i1 true, i1 %29
  br i1 %or.cond42, label %.critedge, label %30

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

30:                                               ; preds = %24
  store i8 %14, ptr %4, align 1, !tbaa !23
  store i8 %20, ptr %.1.sroa.gep43, align 1, !tbaa !23
  %31 = getelementptr inbounds i8, ptr %4, i64 2
  store i8 %26, ptr %31, align 1, !tbaa !23
  br label %42

32:                                               ; preds = %3
  %33 = getelementptr inbounds i8, ptr %1, i64 3
  %34 = load i8, ptr %33, align 1, !tbaa !24
  %35 = icmp eq i8 %34, 0
  br i1 %35, label %40, label %36

36:                                               ; preds = %32
  %37 = getelementptr inbounds i8, ptr %0, i64 617
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %39 = icmp ugt i8 %34, %38
  br i1 %39, label %40, label %41

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

41:                                               ; preds = %36
  store i8 %34, ptr %4, align 1, !tbaa !23
  br label %42

42:                                               ; preds = %30, %41
  %.1.sroa.phi = phi ptr [ %.1.sroa.gep, %30 ], [ %.1.sroa.gep43, %41 ]
  %.1 = phi i64 [ 3, %30 ], [ 1, %41 ]
  %43 = and i32 %2, 4
  %.not37 = icmp eq i32 %43, 0
  br i1 %.not37, label %55, label %44

44:                                               ; preds = %42
  %45 = getelementptr inbounds i8, ptr %1, i64 4
  %46 = load i8, ptr %45, align 1, !tbaa !25
  %47 = icmp eq i8 %46, 0
  br i1 %47, label %52, label %48

48:                                               ; preds = %44
  %49 = getelementptr inbounds i8, ptr %0, i64 617
  %50 = load i8, ptr %49, align 1, !tbaa !5
  %51 = icmp ugt i8 %46, %50
  br i1 %51, label %52, label %53

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

53:                                               ; preds = %48
  %54 = add nuw nsw i64 %.1, 1
  store i8 %46, ptr %.1.sroa.phi, align 1, !tbaa !23
  br label %55

55:                                               ; preds = %53, %42
  %.2 = phi i64 [ %54, %53 ], [ %.1, %42 ]
  call void @png_write_complete_chunk(ptr noundef %0, i32 noundef 1933723988, ptr noundef nonnull %4, i64 noundef %.2)
  br label %56

56:                                               ; preds = %.critedge, %55, %52, %40
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 617}
!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 = !{!15, !7, i64 0}
!21 = !{!15, !7, i64 1}
!22 = !{!15, !7, i64 2}
!23 = !{!7, !7, i64 0}
!24 = !{!15, !7, i64 3}
!25 = !{!15, !7, i64 4}


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