; 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.compression_state = type { ptr, i64, i32, [1024 x i8] }
%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.13 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [22 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_chunk_header(ptr noalias noundef, i32 noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @png_write_chunk_data(ptr noalias noundef, ptr noundef, i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @png_write_chunk_end(ptr noalias noundef) #1

; Function Attrs: noreturn
declare void @png_error(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @png_write_iCCP(ptr noalias noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca [81 x i8], align 16
  %10 = alloca %struct.compression_state, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 81, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 1048, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %17

15:                                               ; preds = %3
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %16, ptr noundef @.str.13) #5
  unreachable

17:                                               ; preds = %3
  %18 = load ptr, ptr %6, align 8, !tbaa !5
  %19 = load i8, ptr %18, align 1, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = shl i32 %20, 24
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 1
  %24 = load i8, ptr %23, align 1, !tbaa !9
  %25 = zext i8 %24 to i32
  %26 = shl i32 %25, 16
  %27 = add i32 %21, %26
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 2
  %30 = load i8, ptr %29, align 1, !tbaa !9
  %31 = zext i8 %30 to i32
  %32 = shl i32 %31, 8
  %33 = add i32 %27, %32
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 3
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = add i32 %33, %37
  store i32 %38, ptr %8, align 4, !tbaa !10
  %39 = load i32, ptr %8, align 4, !tbaa !10
  %40 = icmp ult i32 %39, 132
  br i1 %40, label %41, label %43

41:                                               ; preds = %17
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %42, ptr noundef @.str.14) #5
  unreachable

43:                                               ; preds = %17
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load i8, ptr %45, align 1, !tbaa !9
  %47 = zext i8 %46 to i32
  store i32 %47, ptr %11, align 4, !tbaa !10
  %48 = load i32, ptr %11, align 4, !tbaa !10
  %49 = icmp ugt i32 %48, 3
  br i1 %49, label %50, label %56

50:                                               ; preds = %43
  %51 = load i32, ptr %8, align 4, !tbaa !10
  %52 = and i32 %51, 3
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %56

54:                                               ; preds = %50
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %55, ptr noundef @.str.15) #5
  unreachable

56:                                               ; preds = %50, %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load i8, ptr %57, align 1, !tbaa !9
  %59 = zext i8 %58 to i32
  %60 = shl i32 %59, 24
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 1
  %63 = load i8, ptr %62, align 1, !tbaa !9
  %64 = zext i8 %63 to i32
  %65 = shl i32 %64, 16
  %66 = add i32 %60, %65
  %67 = load ptr, ptr %6, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 2
  %69 = load i8, ptr %68, align 1, !tbaa !9
  %70 = zext i8 %69 to i32
  %71 = shl i32 %70, 8
  %72 = add i32 %66, %71
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = getelementptr inbounds i8, ptr %73, i64 3
  %75 = load i8, ptr %74, align 1, !tbaa !9
  %76 = zext i8 %75 to i32
  %77 = add i32 %72, %76
  store i32 %77, ptr %12, align 4, !tbaa !10
  %78 = load i32, ptr %8, align 4, !tbaa !10
  %79 = load i32, ptr %12, align 4, !tbaa !10
  %80 = icmp ne i32 %78, %79
  br i1 %80, label %81, label %83

81:                                               ; preds = %56
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %82, ptr noundef @.str.16) #5
  unreachable

83:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds [81 x i8], ptr %9, i64 0, i64 0
  %87 = call i32 @png_check_keyword(ptr noundef %84, ptr noundef %85, ptr noundef %86)
  store i32 %87, ptr %7, align 4, !tbaa !10
  %88 = load i32, ptr %7, align 4, !tbaa !10
  %89 = icmp eq i32 %88, 0
  br i1 %89, label %90, label %92

90:                                               ; preds = %83
  %91 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_error(ptr noundef %91, ptr noundef @.str.17) #5
  unreachable

92:                                               ; preds = %83
  %93 = load i32, ptr %7, align 4, !tbaa !10
  %94 = add i32 %93, 1
  store i32 %94, ptr %7, align 4, !tbaa !10
  %95 = zext i32 %94 to i64
  %96 = getelementptr inbounds [81 x i8], ptr %9, i64 0, i64 %95
  store i8 0, ptr %96, align 1, !tbaa !9
  %97 = load i32, ptr %7, align 4, !tbaa !10
  %98 = add i32 %97, 1
  store i32 %98, ptr %7, align 4, !tbaa !10
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = load i32, ptr %8, align 4, !tbaa !10
  %101 = zext i32 %100 to i64
  call void @png_text_compress_init(ptr noundef %10, ptr noundef %99, i64 noundef %101)
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = load i32, ptr %7, align 4, !tbaa !10
  %104 = call i32 @png_text_compress(ptr noundef %102, i32 noundef 1766015824, ptr noundef %10, i32 noundef %103)
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %112

106:                                              ; preds = %92
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load ptr, ptr %4, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.png_struct_def, ptr %108, i32 0, i32 19
  %110 = getelementptr inbounds %struct.z_stream_s, ptr %109, i32 0, i32 6
  %111 = load ptr, ptr %110, align 8, !tbaa !12
  call void @png_error(ptr noundef %107, ptr noundef %111) #5
  unreachable

112:                                              ; preds = %92
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = load i32, ptr %7, align 4, !tbaa !10
  %115 = getelementptr inbounds %struct.compression_state, ptr %10, i32 0, i32 2
  %116 = load i32, ptr %115, align 8, !tbaa !23
  %117 = add i32 %114, %116
  call void @png_write_chunk_header(ptr noundef %113, i32 noundef 1766015824, i32 noundef %117)
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds [81 x i8], ptr %9, i64 0, i64 0
  %120 = load i32, ptr %7, align 4, !tbaa !10
  %121 = zext i32 %120 to i64
  call void @png_write_chunk_data(ptr noundef %118, ptr noundef %119, i64 noundef %121)
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_write_compressed_data_out(ptr noundef %122, ptr noundef %10)
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  call void @png_write_chunk_end(ptr noundef %123)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 1048, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 81, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void
}

declare i32 @png_check_keyword(ptr noundef, ptr noundef, ptr noundef) #3

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

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

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

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 = { 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 #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 }
attributes #5 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 368}
!13 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !14, 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, !11, i64 300, !11, i64 304, !11, i64 308, !11, i64 312, !15, i64 320, !6, 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, !14, i64 520, !11, i64 528, !11, i64 532, !11, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !14, i64 576, !11, i64 584, !11, i64 588, !6, i64 592, !16, i64 600, !11, i64 604, !16, 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, !16, i64 626, !7, i64 628, !11, i64 632, !17, i64 636, !17, i64 646, !6, i64 656, !11, i64 664, !11, i64 668, !11, i64 672, !11, i64 676, !6, i64 680, !6, i64 688, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !18, i64 728, !18, i64 733, !6, i64 744, !17, 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, !11, i64 840, !11, i64 844, !14, i64 848, !14, i64 856, !14, i64 864, !14, i64 872, !11, i64 880, !11, i64 884, !6, i64 888, !6, i64 896, !11, i64 904, !7, i64 908, !11, i64 940, !6, i64 944, !6, i64 952, !11, i64 960, !11, i64 964, !6, i64 968, !7, i64 976, !7, i64 977, !16, i64 978, !16, i64 980, !11, 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, !11, i64 1052, !11, i64 1056, !11, i64 1060, !14, i64 1064, !19, i64 1072, !14, i64 1104, !6, i64 1112, !14, i64 1120, !11, i64 1128, !11, i64 1132, !6, i64 1136, !7, i64 1144, !20, i64 1176}
!14 = !{!"long", !7, i64 0}
!15 = !{!"z_stream_s", !6, i64 0, !11, i64 8, !14, i64 16, !6, i64 24, !11, i64 32, !14, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !11, i64 88, !14, i64 96, !14, i64 104}
!16 = !{!"short", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !16, i64 8}
!18 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!19 = !{!"png_unknown_chunk_t", !7, i64 0, !6, i64 8, !14, i64 16, !7, i64 24}
!20 = !{!"png_colorspace", !11, i64 0, !21, i64 4, !22, i64 36, !16, i64 72, !16, i64 74}
!21 = !{!"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}
!22 = !{!"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}
!23 = !{!24, !11, i64 16}
!24 = !{!"", !6, i64 0, !14, i64 8, !11, i64 16, !7, i64 20}


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

%struct.compression_state = type { ptr, i64, i32, [1024 x i8] }

@.str.13 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [22 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_chunk_header(ptr noalias noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @png_write_chunk_data(ptr noalias noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @png_write_chunk_end(ptr noalias noundef) local_unnamed_addr #1

; Function Attrs: noreturn
declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @png_write_iCCP(ptr noalias noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #1 {
  %4 = alloca [81 x i8], align 16
  %5 = alloca %struct.compression_state, align 8
  call void @llvm.lifetime.start.p0(i64 81, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 1048, ptr nonnull %5) #4
  %6 = icmp eq ptr %2, null
  br i1 %6, label %7, label %8

7:                                                ; preds = %3
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.13) #5
  unreachable

8:                                                ; preds = %3
  %9 = load i8, ptr %2, align 1, !tbaa !5
  %10 = zext i8 %9 to i32
  %11 = shl nuw i32 %10, 24
  %12 = getelementptr inbounds i8, ptr %2, i64 1
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %14 = zext i8 %13 to i32
  %15 = shl nuw nsw i32 %14, 16
  %16 = or disjoint i32 %15, %11
  %17 = getelementptr inbounds i8, ptr %2, i64 2
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %19 = zext i8 %18 to i32
  %20 = shl nuw nsw i32 %19, 8
  %21 = or disjoint i32 %16, %20
  %22 = getelementptr inbounds i8, ptr %2, i64 3
  %23 = load i8, ptr %22, align 1, !tbaa !5
  %24 = zext i8 %23 to i32
  %25 = or disjoint i32 %21, %24
  %26 = icmp ult i32 %25, 132
  br i1 %26, label %27, label %28

27:                                               ; preds = %8
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.14) #5
  unreachable

28:                                               ; preds = %8
  %29 = getelementptr inbounds i8, ptr %2, i64 8
  %30 = load i8, ptr %29, align 1, !tbaa !5
  %31 = icmp ult i8 %30, 4
  %32 = and i32 %24, 3
  %.not = icmp eq i32 %32, 0
  %or.cond = or i1 %.not, %31
  br i1 %or.cond, label %34, label %33

33:                                               ; preds = %28
  tail call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.15) #5
  unreachable

34:                                               ; preds = %28
  %35 = call i32 @png_check_keyword(ptr noundef %0, ptr noundef %1, ptr noundef nonnull %4) #4
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  call void @png_error(ptr noundef %0, ptr noundef nonnull @.str.17) #5
  unreachable

38:                                               ; preds = %34
  %39 = add i32 %35, 1
  %40 = zext i32 %39 to i64
  %41 = getelementptr inbounds [81 x i8], ptr %4, i64 0, i64 %40
  store i8 0, ptr %41, align 1, !tbaa !5
  %42 = add i32 %35, 2
  %43 = zext i32 %25 to i64
  call void @png_text_compress_init(ptr noundef nonnull %5, ptr noundef nonnull %2, i64 noundef %43)
  %44 = call i32 @png_text_compress(ptr noundef %0, i32 noundef 1766015824, ptr noundef nonnull %5, i32 noundef %42)
  %.not39 = icmp eq i32 %44, 0
  br i1 %.not39, label %48, label %45

45:                                               ; preds = %38
  %46 = getelementptr inbounds i8, ptr %0, i64 368
  %47 = load ptr, ptr %46, align 8, !tbaa !8
  call void @png_error(ptr noundef %0, ptr noundef %47) #5
  unreachable

48:                                               ; preds = %38
  %49 = getelementptr inbounds i8, ptr %5, i64 16
  %50 = load i32, ptr %49, align 8, !tbaa !21
  %51 = add i32 %50, %42
  call void @png_write_chunk_header(ptr noundef %0, i32 noundef 1766015824, i32 noundef %51)
  %52 = zext i32 %42 to i64
  call void @png_write_chunk_data(ptr noundef %0, ptr noundef nonnull %4, i64 noundef %52)
  call void @png_write_compressed_data_out(ptr noundef %0, ptr noundef nonnull %5)
  call void @png_write_chunk_end(ptr noundef %0)
  call void @llvm.lifetime.end.p0(i64 1048, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 81, ptr nonnull %4) #4
  ret void
}

declare i32 @png_check_keyword(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

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 = { 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 #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 }
attributes #5 = { 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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 368}
!9 = !{!"png_struct_def", !6, i64 0, !10, i64 200, !10, i64 208, !11, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !6, i64 296, !6, i64 297, !12, i64 300, !12, i64 304, !12, i64 308, !12, i64 312, !13, i64 320, !10, 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, !10, i64 544, !10, i64 552, !10, i64 560, !10, i64 568, !11, i64 576, !12, i64 584, !12, i64 588, !10, i64 592, !14, i64 600, !12, i64 604, !14, i64 608, !6, i64 610, !6, i64 611, !6, i64 612, !6, i64 613, !6, i64 614, !6, i64 615, !6, i64 616, !6, i64 617, !6, i64 618, !6, i64 619, !6, i64 620, !6, i64 621, !6, i64 622, !6, i64 623, !6, i64 624, !14, i64 626, !6, i64 628, !12, i64 632, !15, i64 636, !15, i64 646, !10, i64 656, !12, i64 664, !12, i64 668, !12, i64 672, !12, i64 676, !10, i64 680, !10, i64 688, !10, i64 696, !10, i64 704, !10, i64 712, !10, i64 720, !16, i64 728, !16, i64 733, !10, i64 744, !15, i64 752, !10, i64 768, !10, i64 776, !10, i64 784, !10, i64 792, !10, i64 800, !10, i64 808, !10, i64 816, !10, i64 824, !10, 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, !10, i64 888, !10, i64 896, !12, i64 904, !6, i64 908, !12, i64 940, !10, i64 944, !10, i64 952, !12, i64 960, !12, i64 964, !10, i64 968, !6, i64 976, !6, i64 977, !14, i64 978, !14, i64 980, !12, i64 984, !6, i64 988, !10, i64 992, !10, i64 1000, !10, i64 1008, !10, i64 1016, !10, i64 1024, !10, i64 1032, !10, i64 1040, !6, i64 1048, !12, i64 1052, !12, i64 1056, !12, i64 1060, !11, i64 1064, !17, i64 1072, !11, i64 1104, !10, i64 1112, !11, i64 1120, !12, i64 1128, !12, i64 1132, !10, i64 1136, !6, i64 1144, !18, i64 1176}
!10 = !{!"any pointer", !6, i64 0}
!11 = !{!"long", !6, i64 0}
!12 = !{!"int", !6, i64 0}
!13 = !{!"z_stream_s", !10, i64 0, !12, i64 8, !11, i64 16, !10, i64 24, !12, i64 32, !11, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !12, i64 88, !11, i64 96, !11, i64 104}
!14 = !{!"short", !6, i64 0}
!15 = !{!"png_color_16_struct", !6, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!16 = !{!"png_color_8_struct", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !6, i64 4}
!17 = !{!"png_unknown_chunk_t", !6, i64 0, !10, i64 8, !11, i64 16, !6, 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 = !{!22, !12, i64 16}
!22 = !{!"", !10, i64 0, !11, i64 8, !12, i64 16, !6, i64 20}


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