; LLVM IR from Try/Tempest :: Engine/thirdparty/libpng (pngwrite)

; 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 }
%struct.png_info_def = type { i32, i32, i32, i64, ptr, i16, i16, i8, i8, i8, i8, i8, i8, i8, i8, [8 x i8], %struct.png_colorspace, ptr, ptr, i32, i32, i32, ptr, %struct.png_time_struct, %struct.png_color_8_struct, ptr, %struct.png_color_16_struct, %struct.png_color_16_struct, i32, i32, i8, i32, i32, i8, i32, ptr, ptr, ptr, ptr, i32, i32, ptr, ptr, i8, i8, i32, ptr, i32, ptr, i32, i8, ptr, ptr, ptr }
%struct.png_time_struct = type { i16, i8, i8, i8, i8, i8 }

@.str = external hidden unnamed_addr constant [49 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @png_write_info_before_PLTE(ptr noalias noundef %0, ptr noalias noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = icmp eq ptr %5, null
  br i1 %6, label %10, label %7

7:                                                ; preds = %2
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %7, %2
  br label %188

11:                                               ; preds = %7
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.png_struct_def, ptr %12, i32 0, i32 15
  %14 = load i32, ptr %13, align 4, !tbaa !9
  %15 = and i32 %14, 1024
  %16 = icmp eq i32 %15, 0
  br i1 %16, label %17, label %188

17:                                               ; preds = %11
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_write_sig(ptr noundef %18)
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.png_struct_def, ptr %19, i32 0, i32 15
  %21 = load i32, ptr %20, align 4, !tbaa !9
  %22 = and i32 %21, 4096
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %33

24:                                               ; preds = %17
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.png_struct_def, ptr %25, i32 0, i32 122
  %27 = load i32, ptr %26, align 8, !tbaa !21
  %28 = icmp ne i32 %27, 0
  br i1 %28, label %29, label %33

29:                                               ; preds = %24
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_warning(ptr noundef %30, ptr noundef @.str)
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.png_struct_def, ptr %31, i32 0, i32 122
  store i32 0, ptr %32, align 8, !tbaa !21
  br label %33

33:                                               ; preds = %29, %24, %17
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = load ptr, ptr %4, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_info_def, ptr %35, i32 0, i32 0
  %37 = load i32, ptr %36, align 8, !tbaa !22
  %38 = load ptr, ptr %4, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.png_info_def, ptr %38, i32 0, i32 1
  %40 = load i32, ptr %39, align 4, !tbaa !25
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.png_info_def, ptr %41, i32 0, i32 7
  %43 = load i8, ptr %42, align 4, !tbaa !26
  %44 = zext i8 %43 to i32
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.png_info_def, ptr %45, i32 0, i32 8
  %47 = load i8, ptr %46, align 1, !tbaa !27
  %48 = zext i8 %47 to i32
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_info_def, ptr %49, i32 0, i32 9
  %51 = load i8, ptr %50, align 2, !tbaa !28
  %52 = zext i8 %51 to i32
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.png_info_def, ptr %53, i32 0, i32 10
  %55 = load i8, ptr %54, align 1, !tbaa !29
  %56 = zext i8 %55 to i32
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.png_info_def, ptr %57, i32 0, i32 11
  %59 = load i8, ptr %58, align 8, !tbaa !30
  %60 = zext i8 %59 to i32
  call void @png_write_IHDR(ptr noundef %34, i32 noundef %37, i32 noundef %40, i32 noundef %44, i32 noundef %48, i32 noundef %52, i32 noundef %56, i32 noundef %60)
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.png_info_def, ptr %61, i32 0, i32 16
  %63 = getelementptr inbounds %struct.png_colorspace, ptr %62, i32 0, i32 4
  %64 = load i16, ptr %63, align 2, !tbaa !31
  %65 = zext i16 %64 to i32
  %66 = and i32 %65, 32768
  %67 = icmp eq i32 %66, 0
  br i1 %67, label %68, label %88

68:                                               ; preds = %33
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.png_info_def, ptr %69, i32 0, i32 16
  %71 = getelementptr inbounds %struct.png_colorspace, ptr %70, i32 0, i32 4
  %72 = load i16, ptr %71, align 2, !tbaa !31
  %73 = zext i16 %72 to i32
  %74 = and i32 %73, 8
  %75 = icmp ne i32 %74, 0
  br i1 %75, label %76, label %88

76:                                               ; preds = %68
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.png_info_def, ptr %77, i32 0, i32 2
  %79 = load i32, ptr %78, align 8, !tbaa !32
  %80 = and i32 %79, 1
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %88

82:                                               ; preds = %76
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.png_info_def, ptr %84, i32 0, i32 16
  %86 = getelementptr inbounds %struct.png_colorspace, ptr %85, i32 0, i32 0
  %87 = load i32, ptr %86, align 4, !tbaa !33
  call void @png_write_gAMA_fixed(ptr noundef %83, i32 noundef %87)
  br label %88

88:                                               ; preds = %82, %76, %68, %33
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_info_def, ptr %89, i32 0, i32 16
  %91 = getelementptr inbounds %struct.png_colorspace, ptr %90, i32 0, i32 4
  %92 = load i16, ptr %91, align 2, !tbaa !31
  %93 = zext i16 %92 to i32
  %94 = and i32 %93, 32768
  %95 = icmp eq i32 %94, 0
  br i1 %95, label %96, label %118

96:                                               ; preds = %88
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.png_info_def, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 8, !tbaa !32
  %100 = and i32 %99, 4096
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %102, label %118

102:                                              ; preds = %96
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_info_def, ptr %103, i32 0, i32 2
  %105 = load i32, ptr %104, align 8, !tbaa !32
  %106 = and i32 %105, 2048
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %102
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  call void @png_app_warning(ptr noundef %109, ptr noundef @.str.1)
  br label %110

110:                                              ; preds = %108, %102
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.png_info_def, ptr %112, i32 0, i32 17
  %114 = load ptr, ptr %113, align 8, !tbaa !34
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.png_info_def, ptr %115, i32 0, i32 18
  %117 = load ptr, ptr %116, align 8, !tbaa !35
  call void @png_write_iCCP(ptr noundef %111, ptr noundef %114, ptr noundef %117)
  br label %140

118:                                              ; preds = %96, %88
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.png_info_def, ptr %119, i32 0, i32 16
  %121 = getelementptr inbounds %struct.png_colorspace, ptr %120, i32 0, i32 4
  %122 = load i16, ptr %121, align 2, !tbaa !31
  %123 = zext i16 %122 to i32
  %124 = and i32 %123, 32768
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %139

126:                                              ; preds = %118
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.png_info_def, ptr %127, i32 0, i32 2
  %129 = load i32, ptr %128, align 8, !tbaa !32
  %130 = and i32 %129, 2048
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %139

132:                                              ; preds = %126
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.png_info_def, ptr %134, i32 0, i32 16
  %136 = getelementptr inbounds %struct.png_colorspace, ptr %135, i32 0, i32 3
  %137 = load i16, ptr %136, align 4, !tbaa !36
  %138 = zext i16 %137 to i32
  call void @png_write_sRGB(ptr noundef %133, i32 noundef %138)
  br label %139

139:                                              ; preds = %132, %126, %118
  br label %140

140:                                              ; preds = %139, %110
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.png_info_def, ptr %141, i32 0, i32 2
  %143 = load i32, ptr %142, align 8, !tbaa !32
  %144 = and i32 %143, 2
  %145 = icmp ne i32 %144, 0
  br i1 %145, label %146, label %154

146:                                              ; preds = %140
  %147 = load ptr, ptr %3, align 8, !tbaa !5
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.png_info_def, ptr %148, i32 0, i32 24
  %150 = load ptr, ptr %4, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.png_info_def, ptr %150, i32 0, i32 8
  %152 = load i8, ptr %151, align 1, !tbaa !27
  %153 = zext i8 %152 to i32
  call void @png_write_sBIT(ptr noundef %147, ptr noundef %149, i32 noundef %153)
  br label %154

154:                                              ; preds = %146, %140
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.png_info_def, ptr %155, i32 0, i32 16
  %157 = getelementptr inbounds %struct.png_colorspace, ptr %156, i32 0, i32 4
  %158 = load i16, ptr %157, align 2, !tbaa !31
  %159 = zext i16 %158 to i32
  %160 = and i32 %159, 32768
  %161 = icmp eq i32 %160, 0
  br i1 %161, label %162, label %181

162:                                              ; preds = %154
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.png_info_def, ptr %163, i32 0, i32 16
  %165 = getelementptr inbounds %struct.png_colorspace, ptr %164, i32 0, i32 4
  %166 = load i16, ptr %165, align 2, !tbaa !31
  %167 = zext i16 %166 to i32
  %168 = and i32 %167, 16
  %169 = icmp ne i32 %168, 0
  br i1 %169, label %170, label %181

170:                                              ; preds = %162
  %171 = load ptr, ptr %4, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.png_info_def, ptr %171, i32 0, i32 2
  %173 = load i32, ptr %172, align 8, !tbaa !32
  %174 = and i32 %173, 4
  %175 = icmp ne i32 %174, 0
  br i1 %175, label %176, label %181

176:                                              ; preds = %170
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = load ptr, ptr %4, align 8, !tbaa !5
  %179 = getelementptr inbounds %struct.png_info_def, ptr %178, i32 0, i32 16
  %180 = getelementptr inbounds %struct.png_colorspace, ptr %179, i32 0, i32 1
  call void @png_write_cHRM_fixed(ptr noundef %177, ptr noundef %180)
  br label %181

181:                                              ; preds = %176, %170, %162, %154
  %182 = load ptr, ptr %3, align 8, !tbaa !5
  %183 = load ptr, ptr %4, align 8, !tbaa !5
  call void @write_unknown_chunks(ptr noundef %182, ptr noundef %183, i32 noundef 1)
  %184 = load ptr, ptr %3, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.png_struct_def, ptr %184, i32 0, i32 15
  %186 = load i32, ptr %185, align 4, !tbaa !9
  %187 = or i32 %186, 1024
  store i32 %187, ptr %185, align 4, !tbaa !9
  br label %188

188:                                              ; preds = %181, %11, %10
  ret void
}

declare void @png_write_sig(ptr noundef) #1

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

declare void @png_write_IHDR(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

declare void @png_write_gAMA_fixed(ptr noundef, i32 noundef) #1

declare void @png_app_warning(ptr noundef, ptr noundef) #1

declare void @png_write_iCCP(ptr noundef, ptr noundef, ptr noundef) #1

declare void @png_write_sRGB(ptr noundef, i32 noundef) #1

declare void @png_write_sBIT(ptr noundef, ptr noundef, i32 noundef) #1

declare void @png_write_cHRM_fixed(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
declare hidden void @write_unknown_chunks(ptr noalias noundef, ptr noalias noundef, i32 noundef) #0

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

!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, !12, i64 300}
!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, !12, i64 984}
!22 = !{!23, !12, i64 0}
!23 = !{!"png_info_def", !12, i64 0, !12, i64 4, !12, i64 8, !11, i64 16, !6, i64 24, !14, i64 32, !14, i64 34, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !18, i64 52, !6, i64 128, !6, i64 136, !12, i64 144, !12, i64 148, !12, i64 152, !6, i64 160, !24, i64 168, !16, i64 176, !6, i64 184, !15, i64 192, !15, i64 202, !12, i64 212, !12, i64 216, !7, i64 220, !12, i64 224, !12, i64 228, !7, i64 232, !12, i64 236, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !12, i64 272, !12, i64 276, !6, i64 280, !6, i64 288, !7, i64 296, !7, i64 297, !12, i64 300, !6, i64 304, !12, i64 312, !6, i64 320, !12, i64 328, !7, i64 332, !6, i64 336, !6, i64 344, !6, i64 352}
!24 = !{!"png_time_struct", !14, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!25 = !{!23, !12, i64 4}
!26 = !{!23, !7, i64 36}
!27 = !{!23, !7, i64 37}
!28 = !{!23, !7, i64 38}
!29 = !{!23, !7, i64 39}
!30 = !{!23, !7, i64 40}
!31 = !{!23, !14, i64 126}
!32 = !{!23, !12, i64 8}
!33 = !{!23, !12, i64 52}
!34 = !{!23, !6, i64 128}
!35 = !{!23, !6, i64 136}
!36 = !{!23, !14, i64 124}


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

; Function Attrs: nounwind uwtable
define dso_local void @png_write_info_before_PLTE(ptr noalias noundef %0, ptr noalias noundef %1) local_unnamed_addr #0 {
  %3 = icmp eq ptr %0, null
  %4 = icmp eq ptr %1, null
  %or.cond = or i1 %3, %4
  br i1 %or.cond, label %83, label %5

5:                                                ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 300
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %8 = and i32 %7, 1024
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %10, label %83

10:                                               ; preds = %5
  tail call void @png_write_sig(ptr noundef nonnull %0) #2
  %11 = load i32, ptr %6, align 4, !tbaa !5
  %12 = and i32 %11, 4096
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %17, label %13

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %0, i64 984
  %15 = load i32, ptr %14, align 8, !tbaa !20
  %.not46 = icmp eq i32 %15, 0
  br i1 %.not46, label %17, label %16

16:                                               ; preds = %13
  tail call void @png_warning(ptr noundef nonnull %0, ptr noundef nonnull @.str) #2
  store i32 0, ptr %14, align 8, !tbaa !20
  br label %17

17:                                               ; preds = %16, %13, %10
  %18 = load i32, ptr %1, align 8, !tbaa !21
  %19 = getelementptr inbounds i8, ptr %1, i64 4
  %20 = load i32, ptr %19, align 4, !tbaa !24
  %21 = getelementptr inbounds i8, ptr %1, i64 36
  %22 = load i8, ptr %21, align 4, !tbaa !25
  %23 = zext i8 %22 to i32
  %24 = getelementptr inbounds i8, ptr %1, i64 37
  %25 = load i8, ptr %24, align 1, !tbaa !26
  %26 = zext i8 %25 to i32
  %27 = getelementptr inbounds i8, ptr %1, i64 38
  %28 = load i8, ptr %27, align 2, !tbaa !27
  %29 = zext i8 %28 to i32
  %30 = getelementptr inbounds i8, ptr %1, i64 39
  %31 = load i8, ptr %30, align 1, !tbaa !28
  %32 = zext i8 %31 to i32
  %33 = getelementptr inbounds i8, ptr %1, i64 40
  %34 = load i8, ptr %33, align 8, !tbaa !29
  %35 = zext i8 %34 to i32
  tail call void @png_write_IHDR(ptr noundef nonnull %0, i32 noundef %18, i32 noundef %20, i32 noundef %23, i32 noundef %26, i32 noundef %29, i32 noundef %32, i32 noundef %35) #2
  %36 = getelementptr inbounds i8, ptr %1, i64 52
  %37 = getelementptr inbounds i8, ptr %1, i64 126
  %38 = load i16, ptr %37, align 2, !tbaa !30
  %39 = and i16 %38, -32760
  %or.cond55.not = icmp eq i16 %39, 8
  br i1 %or.cond55.not, label %40, label %thread-pre-split

40:                                               ; preds = %17
  %41 = getelementptr inbounds i8, ptr %1, i64 8
  %42 = load i32, ptr %41, align 8, !tbaa !31
  %43 = and i32 %42, 1
  %.not48 = icmp eq i32 %43, 0
  br i1 %.not48, label %thread-pre-split.thread, label %44

44:                                               ; preds = %40
  %45 = load i32, ptr %36, align 4, !tbaa !32
  tail call void @png_write_gAMA_fixed(ptr noundef nonnull %0, i32 noundef %45) #2
  %.pr.pre = load i16, ptr %37, align 2, !tbaa !30
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %44, %17
  %46 = phi i16 [ %38, %17 ], [ %.pr.pre, %44 ]
  %47 = icmp sgt i16 %46, -1
  br i1 %47, label %thread-pre-split.thread, label %64

thread-pre-split.thread:                          ; preds = %40, %thread-pre-split
  %48 = getelementptr inbounds i8, ptr %1, i64 8
  %49 = load i32, ptr %48, align 8, !tbaa !31
  %50 = and i32 %49, 4096
  %.not49 = icmp eq i32 %50, 0
  %51 = and i32 %49, 2048
  %.not50 = icmp eq i32 %51, 0
  br i1 %.not49, label %59, label %52

52:                                               ; preds = %thread-pre-split.thread
  br i1 %.not50, label %54, label %53

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

54:                                               ; preds = %53, %52
  %55 = getelementptr inbounds i8, ptr %1, i64 128
  %56 = load ptr, ptr %55, align 8, !tbaa !33
  %57 = getelementptr inbounds i8, ptr %1, i64 136
  %58 = load ptr, ptr %57, align 8, !tbaa !34
  tail call void @png_write_iCCP(ptr noundef nonnull %0, ptr noundef %56, ptr noundef %58) #2
  br label %64

59:                                               ; preds = %thread-pre-split.thread
  br i1 %.not50, label %64, label %60

60:                                               ; preds = %59
  %61 = getelementptr inbounds i8, ptr %1, i64 124
  %62 = load i16, ptr %61, align 4, !tbaa !35
  %63 = zext i16 %62 to i32
  tail call void @png_write_sRGB(ptr noundef nonnull %0, i32 noundef %63) #2
  br label %64

64:                                               ; preds = %thread-pre-split, %59, %60, %54
  %65 = getelementptr inbounds i8, ptr %1, i64 8
  %66 = load i32, ptr %65, align 8, !tbaa !31
  %67 = and i32 %66, 2
  %.not52 = icmp eq i32 %67, 0
  br i1 %.not52, label %72, label %68

68:                                               ; preds = %64
  %69 = getelementptr inbounds i8, ptr %1, i64 176
  %70 = load i8, ptr %24, align 1, !tbaa !26
  %71 = zext i8 %70 to i32
  tail call void @png_write_sBIT(ptr noundef nonnull %0, ptr noundef nonnull %69, i32 noundef %71) #2
  br label %72

72:                                               ; preds = %68, %64
  %73 = load i16, ptr %37, align 2, !tbaa !30
  %74 = and i16 %73, -32752
  %or.cond56.not = icmp eq i16 %74, 16
  br i1 %or.cond56.not, label %75, label %80

75:                                               ; preds = %72
  %76 = load i32, ptr %65, align 8, !tbaa !31
  %77 = and i32 %76, 4
  %.not54 = icmp eq i32 %77, 0
  br i1 %.not54, label %80, label %78

78:                                               ; preds = %75
  %79 = getelementptr inbounds i8, ptr %1, i64 56
  tail call void @png_write_cHRM_fixed(ptr noundef nonnull %0, ptr noundef nonnull %79) #2
  br label %80

80:                                               ; preds = %78, %75, %72
  tail call void @write_unknown_chunks(ptr noundef nonnull %0, ptr noundef nonnull %1, i32 noundef 1)
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = or i32 %81, 1024
  store i32 %82, ptr %6, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %2, %80, %5
  ret void
}

declare void @png_write_sig(ptr noundef) local_unnamed_addr #1

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

declare void @png_write_IHDR(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

declare void @png_write_gAMA_fixed(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

declare void @png_write_sRGB(ptr noundef, i32 noundef) local_unnamed_addr #1

declare void @png_write_sBIT(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare hidden void @write_unknown_chunks(ptr noalias noundef, ptr noalias noundef, i32 noundef) local_unnamed_addr #0

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

!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 300}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !10, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !9, i64 272, !9, i64 280, !9, i64 288, !7, i64 296, !7, i64 297, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !12, i64 320, !9, i64 432, !11, i64 440, !11, i64 444, !11, i64 448, !11, i64 452, !11, i64 456, !11, i64 460, !11, i64 464, !11, i64 468, !11, i64 472, !11, i64 476, !11, i64 480, !11, i64 484, !11, i64 488, !11, i64 492, !11, i64 496, !11, i64 500, !11, i64 504, !11, i64 508, !11, i64 512, !11, i64 516, !10, i64 520, !11, i64 528, !11, i64 532, !11, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !9, i64 568, !10, i64 576, !11, i64 584, !11, i64 588, !9, i64 592, !13, i64 600, !11, i64 604, !13, i64 608, !7, i64 610, !7, i64 611, !7, i64 612, !7, i64 613, !7, i64 614, !7, i64 615, !7, i64 616, !7, i64 617, !7, i64 618, !7, i64 619, !7, i64 620, !7, i64 621, !7, i64 622, !7, i64 623, !7, i64 624, !13, i64 626, !7, i64 628, !11, i64 632, !14, i64 636, !14, i64 646, !9, i64 656, !11, i64 664, !11, i64 668, !11, i64 672, !11, i64 676, !9, i64 680, !9, i64 688, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !15, i64 728, !15, i64 733, !9, i64 744, !14, i64 752, !9, i64 768, !9, i64 776, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !11, i64 840, !11, i64 844, !10, i64 848, !10, i64 856, !10, i64 864, !10, i64 872, !11, i64 880, !11, i64 884, !9, i64 888, !9, i64 896, !11, i64 904, !7, i64 908, !11, i64 940, !9, i64 944, !9, i64 952, !11, i64 960, !11, i64 964, !9, i64 968, !7, i64 976, !7, i64 977, !13, i64 978, !13, i64 980, !11, i64 984, !7, i64 988, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !9, i64 1040, !7, i64 1048, !11, i64 1052, !11, i64 1056, !11, i64 1060, !10, i64 1064, !16, i64 1072, !10, i64 1104, !9, i64 1112, !10, i64 1120, !11, i64 1128, !11, i64 1132, !9, i64 1136, !7, i64 1144, !17, i64 1176}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!"z_stream_s", !9, i64 0, !11, i64 8, !10, i64 16, !9, i64 24, !11, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !11, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!"short", !7, i64 0}
!14 = !{!"png_color_16_struct", !7, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !13, i64 8}
!15 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!16 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!17 = !{!"png_colorspace", !11, i64 0, !18, i64 4, !19, i64 36, !13, i64 72, !13, i64 74}
!18 = !{!"png_xy", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28}
!19 = !{!"png_XYZ", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32}
!20 = !{!6, !11, i64 984}
!21 = !{!22, !11, i64 0}
!22 = !{!"png_info_def", !11, i64 0, !11, i64 4, !11, i64 8, !10, i64 16, !9, i64 24, !13, i64 32, !13, i64 34, !7, i64 36, !7, i64 37, !7, i64 38, !7, i64 39, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !7, i64 44, !17, i64 52, !9, i64 128, !9, i64 136, !11, i64 144, !11, i64 148, !11, i64 152, !9, i64 160, !23, i64 168, !15, i64 176, !9, i64 184, !14, i64 192, !14, i64 202, !11, i64 212, !11, i64 216, !7, i64 220, !11, i64 224, !11, i64 228, !7, i64 232, !11, i64 236, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !11, i64 272, !11, i64 276, !9, i64 280, !9, i64 288, !7, i64 296, !7, i64 297, !11, i64 300, !9, i64 304, !11, i64 312, !9, i64 320, !11, i64 328, !7, i64 332, !9, i64 336, !9, i64 344, !9, i64 352}
!23 = !{!"png_time_struct", !13, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6}
!24 = !{!22, !11, i64 4}
!25 = !{!22, !7, i64 36}
!26 = !{!22, !7, i64 37}
!27 = !{!22, !7, i64 38}
!28 = !{!22, !7, i64 39}
!29 = !{!22, !7, i64 40}
!30 = !{!22, !13, i64 126}
!31 = !{!22, !11, i64 8}
!32 = !{!22, !11, i64 52}
!33 = !{!22, !9, i64 128}
!34 = !{!22, !9, i64 136}
!35 = !{!22, !13, i64 124}


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