; LLVM IR from modlfo/AudioEngine :: AudioEngine/JuceLibraryCode/modules/juce_graphics/image_formats/pnglib (finish)

; 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, ptr, ptr, i64, i32, i32, ptr, i16, i32, i16, 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, i8, i8, ptr, ptr, ptr, ptr, ptr, i8, [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 }

; Function Attrs: nounwind uwtable
declare dso_local void @png_push_save_buffer(ptr noalias 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
define dso_local void @png_push_crc_finish(ptr noalias noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.png_struct_def, ptr %7, i32 0, i32 102
  %9 = load i32, ptr %8, align 4, !tbaa !9
  %10 = icmp ne i32 %9, 0
  br i1 %10, label %11, label %59

11:                                               ; preds = %1
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.png_struct_def, ptr %12, i32 0, i32 103
  %14 = load i64, ptr %13, align 8, !tbaa !21
  %15 = icmp ne i64 %14, 0
  br i1 %15, label %16, label %59

16:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.png_struct_def, ptr %17, i32 0, i32 103
  %19 = load i64, ptr %18, align 8, !tbaa !21
  store i64 %19, ptr %3, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.png_struct_def, ptr %20, i32 0, i32 102
  %22 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %22, ptr %4, align 4, !tbaa !23
  %23 = load i32, ptr %4, align 4, !tbaa !23
  %24 = zext i32 %23 to i64
  %25 = load i64, ptr %3, align 8, !tbaa !22
  %26 = icmp ult i64 %24, %25
  br i1 %26, label %27, label %30

27:                                               ; preds = %16
  %28 = load i32, ptr %4, align 4, !tbaa !23
  %29 = zext i32 %28 to i64
  store i64 %29, ptr %3, align 8, !tbaa !22
  br label %33

30:                                               ; preds = %16
  %31 = load i64, ptr %3, align 8, !tbaa !22
  %32 = trunc i64 %31 to i32
  store i32 %32, ptr %4, align 4, !tbaa !23
  br label %33

33:                                               ; preds = %30, %27
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.png_struct_def, ptr %35, i32 0, i32 97
  %37 = load ptr, ptr %36, align 8, !tbaa !24
  %38 = load i64, ptr %3, align 8, !tbaa !22
  call void @png_calculate_crc(ptr noundef %34, ptr noundef %37, i64 noundef %38)
  %39 = load i32, ptr %4, align 4, !tbaa !23
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.png_struct_def, ptr %40, i32 0, i32 102
  %42 = load i32, ptr %41, align 4, !tbaa !9
  %43 = sub i32 %42, %39
  store i32 %43, ptr %41, align 4, !tbaa !9
  %44 = load i64, ptr %3, align 8, !tbaa !22
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.png_struct_def, ptr %45, i32 0, i32 105
  %47 = load i64, ptr %46, align 8, !tbaa !25
  %48 = sub i64 %47, %44
  store i64 %48, ptr %46, align 8, !tbaa !25
  %49 = load i64, ptr %3, align 8, !tbaa !22
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.png_struct_def, ptr %50, i32 0, i32 103
  %52 = load i64, ptr %51, align 8, !tbaa !21
  %53 = sub i64 %52, %49
  store i64 %53, ptr %51, align 8, !tbaa !21
  %54 = load i64, ptr %3, align 8, !tbaa !22
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.png_struct_def, ptr %55, i32 0, i32 97
  %57 = load ptr, ptr %56, align 8, !tbaa !24
  %58 = getelementptr inbounds i8, ptr %57, i64 %54
  store ptr %58, ptr %56, align 8, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  br label %59

59:                                               ; preds = %33, %11, %1
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.png_struct_def, ptr %60, i32 0, i32 102
  %62 = load i32, ptr %61, align 4, !tbaa !9
  %63 = icmp ne i32 %62, 0
  br i1 %63, label %64, label %112

64:                                               ; preds = %59
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.png_struct_def, ptr %65, i32 0, i32 106
  %67 = load i64, ptr %66, align 8, !tbaa !26
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %112

69:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %70 = load ptr, ptr %2, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.png_struct_def, ptr %70, i32 0, i32 106
  %72 = load i64, ptr %71, align 8, !tbaa !26
  store i64 %72, ptr %5, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.png_struct_def, ptr %73, i32 0, i32 102
  %75 = load i32, ptr %74, align 4, !tbaa !9
  store i32 %75, ptr %6, align 4, !tbaa !23
  %76 = load i32, ptr %6, align 4, !tbaa !23
  %77 = zext i32 %76 to i64
  %78 = load i64, ptr %5, align 8, !tbaa !22
  %79 = icmp ult i64 %77, %78
  br i1 %79, label %80, label %83

80:                                               ; preds = %69
  %81 = load i32, ptr %6, align 4, !tbaa !23
  %82 = zext i32 %81 to i64
  store i64 %82, ptr %5, align 8, !tbaa !22
  br label %86

83:                                               ; preds = %69
  %84 = load i64, ptr %5, align 8, !tbaa !22
  %85 = trunc i64 %84 to i32
  store i32 %85, ptr %6, align 4, !tbaa !23
  br label %86

86:                                               ; preds = %83, %80
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.png_struct_def, ptr %88, i32 0, i32 99
  %90 = load ptr, ptr %89, align 8, !tbaa !27
  %91 = load i64, ptr %5, align 8, !tbaa !22
  call void @png_calculate_crc(ptr noundef %87, ptr noundef %90, i64 noundef %91)
  %92 = load i32, ptr %6, align 4, !tbaa !23
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.png_struct_def, ptr %93, i32 0, i32 102
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = sub i32 %95, %92
  store i32 %96, ptr %94, align 4, !tbaa !9
  %97 = load i64, ptr %5, align 8, !tbaa !22
  %98 = load ptr, ptr %2, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.png_struct_def, ptr %98, i32 0, i32 105
  %100 = load i64, ptr %99, align 8, !tbaa !25
  %101 = sub i64 %100, %97
  store i64 %101, ptr %99, align 8, !tbaa !25
  %102 = load i64, ptr %5, align 8, !tbaa !22
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.png_struct_def, ptr %103, i32 0, i32 106
  %105 = load i64, ptr %104, align 8, !tbaa !26
  %106 = sub i64 %105, %102
  store i64 %106, ptr %104, align 8, !tbaa !26
  %107 = load i64, ptr %5, align 8, !tbaa !22
  %108 = load ptr, ptr %2, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.png_struct_def, ptr %108, i32 0, i32 99
  %110 = load ptr, ptr %109, align 8, !tbaa !27
  %111 = getelementptr inbounds i8, ptr %110, i64 %107
  store ptr %111, ptr %109, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #3
  br label %112

112:                                              ; preds = %86, %64, %59
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.png_struct_def, ptr %113, i32 0, i32 102
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %129, label %117

117:                                              ; preds = %112
  %118 = load ptr, ptr %2, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.png_struct_def, ptr %118, i32 0, i32 105
  %120 = load i64, ptr %119, align 8, !tbaa !25
  %121 = icmp ult i64 %120, 4
  br i1 %121, label %122, label %124

122:                                              ; preds = %117
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_push_save_buffer(ptr noundef %123)
  br label %129

124:                                              ; preds = %117
  %125 = load ptr, ptr %2, align 8, !tbaa !5
  %126 = call i32 @png_crc_finish(ptr noundef %125, i32 noundef 0)
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.png_struct_def, ptr %127, i32 0, i32 107
  store i32 1, ptr %128, align 8, !tbaa !28
  br label %129

129:                                              ; preds = %124, %122, %112
  ret void
}

declare void @png_calculate_crc(ptr noundef, ptr noundef, i64 noundef) #2

declare i32 @png_crc_finish(ptr noundef, i32 noundef) #2

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 = { "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, !12, i64 860}
!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, !6, i64 576, !6, i64 584, !11, i64 592, !12, i64 600, !12, i64 604, !6, i64 608, !14, i64 616, !12, i64 620, !14, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !14, i64 640, !7, i64 642, !12, i64 644, !15, i64 648, !15, i64 658, !6, i64 672, !12, i64 680, !12, i64 684, !12, i64 688, !12, i64 692, !6, i64 696, !6, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !16, i64 744, !16, i64 749, !6, i64 760, !15, i64 768, !6, i64 784, !6, i64 792, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !12, i64 856, !12, i64 860, !11, i64 864, !11, i64 872, !11, i64 880, !11, i64 888, !12, i64 896, !12, i64 900, !6, i64 904, !6, i64 912, !7, i64 920, !7, i64 921, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !7, i64 968, !7, i64 969, !12, i64 1000, !6, i64 1008, !6, i64 1016, !12, i64 1024, !12, i64 1028, !6, i64 1032, !7, i64 1040, !7, i64 1041, !14, i64 1042, !14, i64 1044, !12, i64 1048, !7, i64 1052, !6, i64 1056, !6, i64 1064, !6, i64 1072, !6, i64 1080, !6, i64 1088, !6, i64 1096, !6, i64 1104, !7, i64 1112, !12, i64 1116, !12, i64 1120, !12, i64 1124, !11, i64 1128, !17, i64 1136, !11, i64 1168, !6, i64 1176, !11, i64 1184, !12, i64 1192, !12, i64 1196, !6, i64 1200, !7, i64 1208, !18, i64 1240}
!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, !11, i64 864}
!22 = !{!11, !11, i64 0}
!23 = !{!12, !12, i64 0}
!24 = !{!10, !6, i64 824}
!25 = !{!10, !11, i64 880}
!26 = !{!10, !11, i64 888}
!27 = !{!10, !6, i64 840}
!28 = !{!10, !12, i64 896}


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

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

; Function Attrs: nounwind uwtable
define dso_local void @png_push_crc_finish(ptr noalias noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 860
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %.thread58, label %4

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 864
  %6 = load i64, ptr %5, align 8, !tbaa !20
  %.not51 = icmp eq i64 %6, 0
  br i1 %.not51, label %.thread, label %7

7:                                                ; preds = %4
  %8 = zext i32 %3 to i64
  %9 = icmp ugt i64 %6, %8
  %10 = trunc nuw i64 %6 to i32
  %.044 = tail call i64 @llvm.umin.i64(i64 %6, i64 %8)
  %.043 = select i1 %9, i32 %3, i32 %10
  %11 = getelementptr inbounds i8, ptr %0, i64 824
  %12 = load ptr, ptr %11, align 8, !tbaa !21
  tail call void @png_calculate_crc(ptr noundef nonnull %0, ptr noundef %12, i64 noundef %.044) #3
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %14 = sub i32 %13, %.043
  store i32 %14, ptr %2, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 880
  %16 = load i64, ptr %15, align 8, !tbaa !22
  %17 = sub i64 %16, %.044
  store i64 %17, ptr %15, align 8, !tbaa !22
  %18 = load i64, ptr %5, align 8, !tbaa !20
  %19 = sub i64 %18, %.044
  store i64 %19, ptr %5, align 8, !tbaa !20
  %20 = load ptr, ptr %11, align 8, !tbaa !21
  %21 = getelementptr inbounds i8, ptr %20, i64 %.044
  store ptr %21, ptr %11, align 8, !tbaa !21
  %.not52 = icmp eq i32 %14, 0
  br i1 %.not52, label %.thread58, label %.thread

.thread:                                          ; preds = %4, %7
  %.pr64 = phi i32 [ %14, %7 ], [ %3, %4 ]
  %22 = getelementptr inbounds i8, ptr %0, i64 888
  %23 = load i64, ptr %22, align 8, !tbaa !23
  %.not53 = icmp eq i64 %23, 0
  br i1 %.not53, label %.thread65, label %24

24:                                               ; preds = %.thread
  %25 = zext i32 %.pr64 to i64
  %26 = icmp ugt i64 %23, %25
  %27 = trunc nuw i64 %23 to i32
  %.042 = tail call i64 @llvm.umin.i64(i64 %23, i64 %25)
  %.0 = select i1 %26, i32 %.pr64, i32 %27
  %28 = getelementptr inbounds i8, ptr %0, i64 840
  %29 = load ptr, ptr %28, align 8, !tbaa !24
  tail call void @png_calculate_crc(ptr noundef nonnull %0, ptr noundef %29, i64 noundef %.042) #3
  %30 = load i32, ptr %2, align 4, !tbaa !5
  %31 = sub i32 %30, %.0
  store i32 %31, ptr %2, align 4, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %0, i64 880
  %33 = load <2 x i64>, ptr %32, align 8, !tbaa !25
  %34 = insertelement <2 x i64> poison, i64 %.042, i64 0
  %35 = shufflevector <2 x i64> %34, <2 x i64> poison, <2 x i32> zeroinitializer
  %36 = sub <2 x i64> %33, %35
  store <2 x i64> %36, ptr %32, align 8, !tbaa !25
  %37 = load ptr, ptr %28, align 8, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %37, i64 %.042
  store ptr %38, ptr %28, align 8, !tbaa !24
  %39 = icmp eq i32 %30, %.0
  br i1 %39, label %.thread58, label %.thread65

.thread58:                                        ; preds = %1, %7, %24
  %40 = getelementptr inbounds i8, ptr %0, i64 880
  %41 = load i64, ptr %40, align 8, !tbaa !22
  %42 = icmp ult i64 %41, 4
  br i1 %42, label %43, label %44

43:                                               ; preds = %.thread58
  tail call void @png_push_save_buffer(ptr noundef nonnull %0)
  br label %.thread65

44:                                               ; preds = %.thread58
  %45 = tail call i32 @png_crc_finish(ptr noundef nonnull %0, i32 noundef 0) #3
  %46 = getelementptr inbounds i8, ptr %0, i64 896
  store i32 1, ptr %46, align 8, !tbaa !26
  br label %.thread65

.thread65:                                        ; preds = %.thread, %44, %43, %24
  ret void
}

declare void @png_calculate_crc(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

declare i32 @png_crc_finish(ptr noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umin.i64(i64, i64) #2

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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !11, i64 860}
!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, !9, i64 576, !9, i64 584, !10, i64 592, !11, i64 600, !11, i64 604, !9, i64 608, !13, i64 616, !11, i64 620, !13, i64 624, !7, i64 626, !7, i64 627, !7, i64 628, !7, i64 629, !7, i64 630, !7, i64 631, !7, i64 632, !7, i64 633, !7, i64 634, !7, i64 635, !7, i64 636, !7, i64 637, !7, i64 638, !7, i64 639, !13, i64 640, !7, i64 642, !11, i64 644, !14, i64 648, !14, i64 658, !9, i64 672, !11, i64 680, !11, i64 684, !11, i64 688, !11, i64 692, !9, i64 696, !9, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !15, i64 744, !15, i64 749, !9, i64 760, !14, i64 768, !9, i64 784, !9, i64 792, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !11, i64 856, !11, i64 860, !10, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !11, i64 896, !11, i64 900, !9, i64 904, !9, i64 912, !7, i64 920, !7, i64 921, !9, i64 928, !9, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !7, i64 968, !7, i64 969, !11, i64 1000, !9, i64 1008, !9, i64 1016, !11, i64 1024, !11, i64 1028, !9, i64 1032, !7, i64 1040, !7, i64 1041, !13, i64 1042, !13, i64 1044, !11, i64 1048, !7, i64 1052, !9, i64 1056, !9, i64 1064, !9, i64 1072, !9, i64 1080, !9, i64 1088, !9, i64 1096, !9, i64 1104, !7, i64 1112, !11, i64 1116, !11, i64 1120, !11, i64 1124, !10, i64 1128, !16, i64 1136, !10, i64 1168, !9, i64 1176, !10, i64 1184, !11, i64 1192, !11, i64 1196, !9, i64 1200, !7, i64 1208, !17, i64 1240}
!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, !10, i64 864}
!21 = !{!6, !9, i64 824}
!22 = !{!6, !10, i64 880}
!23 = !{!6, !10, i64 888}
!24 = !{!6, !9, i64 840}
!25 = !{!10, !10, i64 0}
!26 = !{!6, !11, i64 896}


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