; LLVM IR from rdguez-mariano/fast_imas_IPOL :: io_png/libs/png (pngpread)

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

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

@.str.6 = external hidden unnamed_addr constant [34 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

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

; 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
define dso_local void @png_push_save_buffer(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.png_struct_def, ptr %9, i32 0, i32 88
  %11 = load i64, ptr %10, align 8, !tbaa !9
  %12 = icmp ne i64 %11, 0
  br i1 %12, label %13, label %48

13:                                               ; preds = %1
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.png_struct_def, ptr %14, i32 0, i32 82
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.png_struct_def, ptr %17, i32 0, i32 83
  %19 = load ptr, ptr %18, align 8, !tbaa !21
  %20 = icmp ne ptr %16, %19
  br i1 %20, label %21, label %47

21:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.png_struct_def, ptr %22, i32 0, i32 88
  %24 = load i64, ptr %23, align 8, !tbaa !9
  store i64 %24, ptr %4, align 8, !tbaa !22
  store i64 0, ptr %3, align 8, !tbaa !22
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.png_struct_def, ptr %25, i32 0, i32 82
  %27 = load ptr, ptr %26, align 8, !tbaa !20
  store ptr %27, ptr %5, align 8, !tbaa !5
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.png_struct_def, ptr %28, i32 0, i32 83
  %30 = load ptr, ptr %29, align 8, !tbaa !21
  store ptr %30, ptr %6, align 8, !tbaa !5
  br label %31

31:                                               ; preds = %39, %21
  %32 = load i64, ptr %3, align 8, !tbaa !22
  %33 = load i64, ptr %4, align 8, !tbaa !22
  %34 = icmp ult i64 %32, %33
  br i1 %34, label %35, label %46

35:                                               ; preds = %31
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = load i8, ptr %36, align 1, !tbaa !23
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  store i8 %37, ptr %38, align 1, !tbaa !23
  br label %39

39:                                               ; preds = %35
  %40 = load i64, ptr %3, align 8, !tbaa !22
  %41 = add i64 %40, 1
  store i64 %41, ptr %3, align 8, !tbaa !22
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i32 1
  store ptr %43, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i32 1
  store ptr %45, ptr %6, align 8, !tbaa !5
  br label %31, !llvm.loop !24

46:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  br label %47

47:                                               ; preds = %46, %13
  br label %48

48:                                               ; preds = %47, %1
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.png_struct_def, ptr %49, i32 0, i32 88
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.png_struct_def, ptr %52, i32 0, i32 91
  %54 = load i64, ptr %53, align 8, !tbaa !26
  %55 = add i64 %51, %54
  %56 = load ptr, ptr %2, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.png_struct_def, ptr %56, i32 0, i32 89
  %58 = load i64, ptr %57, align 8, !tbaa !27
  %59 = icmp ugt i64 %55, %58
  br i1 %59, label %60, label %101

60:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.png_struct_def, ptr %61, i32 0, i32 88
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.png_struct_def, ptr %64, i32 0, i32 91
  %66 = load i64, ptr %65, align 8, !tbaa !26
  %67 = add i64 %66, 256
  %68 = sub i64 -1, %67
  %69 = icmp ugt i64 %63, %68
  br i1 %69, label %70, label %72

70:                                               ; preds = %60
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  call void @png_error(ptr noundef %71, ptr noundef @.str.6)
  br label %72

72:                                               ; preds = %70, %60
  %73 = load ptr, ptr %2, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.png_struct_def, ptr %73, i32 0, i32 88
  %75 = load i64, ptr %74, align 8, !tbaa !9
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.png_struct_def, ptr %76, i32 0, i32 91
  %78 = load i64, ptr %77, align 8, !tbaa !26
  %79 = add i64 %75, %78
  %80 = add i64 %79, 256
  store i64 %80, ptr %7, align 8, !tbaa !22
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.png_struct_def, ptr %81, i32 0, i32 83
  %83 = load ptr, ptr %82, align 8, !tbaa !21
  store ptr %83, ptr %8, align 8, !tbaa !5
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = load i64, ptr %7, align 8, !tbaa !22
  %86 = call ptr @png_malloc(ptr noundef %84, i64 noundef %85)
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.png_struct_def, ptr %87, i32 0, i32 83
  store ptr %86, ptr %88, align 8, !tbaa !21
  %89 = load ptr, ptr %2, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.png_struct_def, ptr %89, i32 0, i32 83
  %91 = load ptr, ptr %90, align 8, !tbaa !21
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.png_struct_def, ptr %93, i32 0, i32 88
  %95 = load i64, ptr %94, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %91, ptr align 1 %92, i64 %95, i1 false)
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  call void @png_free(ptr noundef %96, ptr noundef %97)
  %98 = load i64, ptr %7, align 8, !tbaa !22
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.png_struct_def, ptr %99, i32 0, i32 89
  store i64 %98, ptr %100, align 8, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  br label %101

101:                                              ; preds = %72, %48
  %102 = load ptr, ptr %2, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.png_struct_def, ptr %102, i32 0, i32 91
  %104 = load i64, ptr %103, align 8, !tbaa !26
  %105 = icmp ne i64 %104, 0
  br i1 %105, label %106, label %129

106:                                              ; preds = %101
  %107 = load ptr, ptr %2, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.png_struct_def, ptr %107, i32 0, i32 83
  %109 = load ptr, ptr %108, align 8, !tbaa !21
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.png_struct_def, ptr %110, i32 0, i32 88
  %112 = load i64, ptr %111, align 8, !tbaa !9
  %113 = getelementptr inbounds i8, ptr %109, i64 %112
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.png_struct_def, ptr %114, i32 0, i32 84
  %116 = load ptr, ptr %115, align 8, !tbaa !28
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.png_struct_def, ptr %117, i32 0, i32 91
  %119 = load i64, ptr %118, align 8, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %113, ptr align 1 %116, i64 %119, i1 false)
  %120 = load ptr, ptr %2, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.png_struct_def, ptr %120, i32 0, i32 91
  %122 = load i64, ptr %121, align 8, !tbaa !26
  %123 = load ptr, ptr %2, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.png_struct_def, ptr %123, i32 0, i32 88
  %125 = load i64, ptr %124, align 8, !tbaa !9
  %126 = add i64 %125, %122
  store i64 %126, ptr %124, align 8, !tbaa !9
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.png_struct_def, ptr %127, i32 0, i32 91
  store i64 0, ptr %128, align 8, !tbaa !26
  br label %129

129:                                              ; preds = %106, %101
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.png_struct_def, ptr %130, i32 0, i32 83
  %132 = load ptr, ptr %131, align 8, !tbaa !21
  %133 = load ptr, ptr %2, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.png_struct_def, ptr %133, i32 0, i32 82
  store ptr %132, ptr %134, align 8, !tbaa !20
  %135 = load ptr, ptr %2, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.png_struct_def, ptr %135, i32 0, i32 90
  store i64 0, ptr %136, align 8, !tbaa !29
  ret void
}

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

declare ptr @png_malloc(ptr noundef, i64 noundef) #1

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 888}
!10 = !{!"png_struct_def", !7, i64 0, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !7, i64 272, !7, i64 273, !11, i64 280, !11, i64 288, !11, i64 296, !12, i64 304, !6, i64 416, !11, i64 424, !13, i64 432, !13, i64 436, !13, i64 440, !13, i64 444, !13, i64 448, !11, i64 456, !11, i64 464, !11, i64 472, !11, i64 480, !11, i64 488, !11, i64 496, !11, i64 504, !11, i64 512, !6, i64 520, !6, i64 528, !6, i64 536, !6, i64 544, !6, i64 552, !6, i64 560, !14, i64 568, !11, i64 592, !11, i64 600, !6, i64 608, !15, i64 616, !15, i64 618, !7, i64 620, !7, i64 625, !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, !15, i64 638, !7, i64 640, !16, i64 644, !17, i64 648, !17, i64 658, !6, i64 672, !11, i64 680, !11, i64 688, !13, i64 696, !16, i64 700, !16, i64 704, !6, i64 712, !6, i64 720, !6, i64 728, !6, i64 736, !6, i64 744, !6, i64 752, !18, i64 760, !18, i64 765, !6, i64 776, !17, i64 784, !6, i64 800, !6, i64 808, !6, i64 816, !6, i64 824, !6, i64 832, !6, i64 840, !6, i64 848, !6, i64 856, !6, i64 864, !11, i64 872, !11, i64 880, !11, i64 888, !11, i64 896, !11, i64 904, !11, i64 912, !13, i64 920, !13, i64 924, !11, i64 928, !11, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !6, i64 976, !7, i64 984, !7, i64 985, !6, i64 992, !6, i64 1000, !6, i64 1008, !6, i64 1016, !6, i64 1024, !6, i64 1032, !11, i64 1040, !6, i64 1048, !6, i64 1056, !13, i64 1064, !6, i64 1072, !7, i64 1080, !15, i64 1082, !15, i64 1084, !15, i64 1086, !11, i64 1088, !11, i64 1096, !7, i64 1104, !7, i64 1105, !11, i64 1112, !11, i64 1120, !6, i64 1128, !6, i64 1136, !6, i64 1144, !6, i64 1152, !6, i64 1160, !6, i64 1168, !6, i64 1176, !7, i64 1184, !11, i64 1192, !11, i64 1200, !19, i64 1208, !11, i64 1240, !11, i64 1248, !6, i64 1256}
!11 = !{!"long", !7, i64 0}
!12 = !{!"z_stream_s", !6, i64 0, !13, i64 8, !11, i64 16, !6, i64 24, !13, i64 32, !11, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !13, i64 88, !11, i64 96, !11, i64 104}
!13 = !{!"int", !7, i64 0}
!14 = !{!"png_row_info_struct", !11, i64 0, !11, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!15 = !{!"short", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"png_color_16_struct", !7, i64 0, !15, i64 2, !15, i64 4, !15, i64 6, !15, 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, !11, i64 16, !7, i64 24}
!20 = !{!10, !6, i64 840}
!21 = !{!10, !6, i64 848}
!22 = !{!11, !11, i64 0}
!23 = !{!7, !7, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!10, !11, i64 912}
!27 = !{!10, !11, i64 896}
!28 = !{!10, !6, i64 856}
!29 = !{!10, !11, i64 904}


; 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.6 = external hidden unnamed_addr constant [34 x i8], align 1

declare void @png_error(ptr noundef, ptr noundef) local_unnamed_addr #0

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

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 840
  %6 = load ptr, ptr %5, align 8, !tbaa !19
  %7 = getelementptr inbounds i8, ptr %0, i64 848
  %8 = load ptr, ptr %7, align 8, !tbaa !20
  %.not48 = icmp eq ptr %6, %8
  br i1 %.not48, label %.loopexit, label %iter.check

iter.check:                                       ; preds = %4
  %9 = ptrtoint ptr %8 to i64
  %10 = ptrtoint ptr %6 to i64
  %min.iters.check = icmp ult i64 %3, 8
  %11 = sub i64 %9, %10
  %diff.check = icmp ult i64 %11, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.preheader.preheader, label %vector.main.loop.iter.check

vector.main.loop.iter.check:                      ; preds = %iter.check
  %min.iters.check55 = icmp ult i64 %3, 32
  br i1 %min.iters.check55, label %vec.epilog.ph, label %vector.ph

vector.ph:                                        ; preds = %vector.main.loop.iter.check
  %n.vec = and i64 %3, -32
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %next.gep = getelementptr i8, ptr %6, i64 %index
  %next.gep57 = getelementptr i8, ptr %8, i64 %index
  %12 = getelementptr i8, ptr %next.gep, i64 16
  %wide.load = load <16 x i8>, ptr %next.gep, align 1, !tbaa !21
  %wide.load59 = load <16 x i8>, ptr %12, align 1, !tbaa !21
  %13 = getelementptr i8, ptr %next.gep57, i64 16
  store <16 x i8> %wide.load, ptr %next.gep57, align 1, !tbaa !21
  store <16 x i8> %wide.load59, ptr %13, align 1, !tbaa !21
  %index.next = add nuw i64 %index, 32
  %14 = icmp eq i64 %index.next, %n.vec
  br i1 %14, label %middle.block, label %vector.body, !llvm.loop !22

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %3, %n.vec
  br i1 %cmp.n, label %.loopexit.loopexit, label %vec.epilog.iter.check

vec.epilog.iter.check:                            ; preds = %middle.block
  %ind.end65 = getelementptr i8, ptr %8, i64 %n.vec
  %ind.end62 = getelementptr i8, ptr %6, i64 %n.vec
  %n.vec.remaining = and i64 %3, 24
  %min.epilog.iters.check = icmp eq i64 %n.vec.remaining, 0
  br i1 %min.epilog.iters.check, label %.preheader.preheader, label %vec.epilog.ph

vec.epilog.ph:                                    ; preds = %vector.main.loop.iter.check, %vec.epilog.iter.check
  %vec.epilog.resume.val = phi i64 [ %n.vec, %vec.epilog.iter.check ], [ 0, %vector.main.loop.iter.check ]
  %n.vec61 = and i64 %3, -8
  %ind.end = getelementptr i8, ptr %6, i64 %n.vec61
  %ind.end64 = getelementptr i8, ptr %8, i64 %n.vec61
  br label %vec.epilog.vector.body

vec.epilog.vector.body:                           ; preds = %vec.epilog.vector.body, %vec.epilog.ph
  %index67 = phi i64 [ %vec.epilog.resume.val, %vec.epilog.ph ], [ %index.next71, %vec.epilog.vector.body ]
  %next.gep68 = getelementptr i8, ptr %6, i64 %index67
  %next.gep69 = getelementptr i8, ptr %8, i64 %index67
  %wide.load70 = load <8 x i8>, ptr %next.gep68, align 1, !tbaa !21
  store <8 x i8> %wide.load70, ptr %next.gep69, align 1, !tbaa !21
  %index.next71 = add nuw i64 %index67, 8
  %15 = icmp eq i64 %index.next71, %n.vec61
  br i1 %15, label %vec.epilog.middle.block, label %vec.epilog.vector.body, !llvm.loop !26

vec.epilog.middle.block:                          ; preds = %vec.epilog.vector.body
  %cmp.n72 = icmp eq i64 %3, %n.vec61
  br i1 %cmp.n72, label %.loopexit.loopexit, label %.preheader.preheader

.preheader.preheader:                             ; preds = %vec.epilog.middle.block, %iter.check, %vec.epilog.iter.check
  %.052.ph = phi i64 [ 0, %iter.check ], [ %n.vec, %vec.epilog.iter.check ], [ %n.vec61, %vec.epilog.middle.block ]
  %.04251.ph = phi ptr [ %6, %iter.check ], [ %ind.end62, %vec.epilog.iter.check ], [ %ind.end, %vec.epilog.middle.block ]
  %.04350.ph = phi ptr [ %8, %iter.check ], [ %ind.end65, %vec.epilog.iter.check ], [ %ind.end64, %vec.epilog.middle.block ]
  %xtraiter = and i64 %3, 7
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader.prol.loopexit, label %.preheader.prol

.preheader.prol:                                  ; preds = %.preheader.preheader, %.preheader.prol
  %.052.prol = phi i64 [ %17, %.preheader.prol ], [ %.052.ph, %.preheader.preheader ]
  %.04251.prol = phi ptr [ %18, %.preheader.prol ], [ %.04251.ph, %.preheader.preheader ]
  %.04350.prol = phi ptr [ %19, %.preheader.prol ], [ %.04350.ph, %.preheader.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.preheader.prol ], [ 0, %.preheader.preheader ]
  %16 = load i8, ptr %.04251.prol, align 1, !tbaa !21
  store i8 %16, ptr %.04350.prol, align 1, !tbaa !21
  %17 = add nuw i64 %.052.prol, 1
  %18 = getelementptr inbounds i8, ptr %.04251.prol, i64 1
  %19 = getelementptr inbounds i8, ptr %.04350.prol, i64 1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.preheader.prol.loopexit, label %.preheader.prol, !llvm.loop !27

.preheader.prol.loopexit:                         ; preds = %.preheader.prol, %.preheader.preheader
  %.052.unr = phi i64 [ %.052.ph, %.preheader.preheader ], [ %17, %.preheader.prol ]
  %.04251.unr = phi ptr [ %.04251.ph, %.preheader.preheader ], [ %18, %.preheader.prol ]
  %.04350.unr = phi ptr [ %.04350.ph, %.preheader.preheader ], [ %19, %.preheader.prol ]
  %20 = sub i64 %.052.ph, %3
  %21 = icmp ugt i64 %20, -8
  br i1 %21, label %.loopexit.loopexit, label %.preheader

.preheader:                                       ; preds = %.preheader.prol.loopexit, %.preheader
  %.052 = phi i64 [ %44, %.preheader ], [ %.052.unr, %.preheader.prol.loopexit ]
  %.04251 = phi ptr [ %45, %.preheader ], [ %.04251.unr, %.preheader.prol.loopexit ]
  %.04350 = phi ptr [ %46, %.preheader ], [ %.04350.unr, %.preheader.prol.loopexit ]
  %22 = load i8, ptr %.04251, align 1, !tbaa !21
  store i8 %22, ptr %.04350, align 1, !tbaa !21
  %23 = getelementptr inbounds i8, ptr %.04251, i64 1
  %24 = getelementptr inbounds i8, ptr %.04350, i64 1
  %25 = load i8, ptr %23, align 1, !tbaa !21
  store i8 %25, ptr %24, align 1, !tbaa !21
  %26 = getelementptr inbounds i8, ptr %.04251, i64 2
  %27 = getelementptr inbounds i8, ptr %.04350, i64 2
  %28 = load i8, ptr %26, align 1, !tbaa !21
  store i8 %28, ptr %27, align 1, !tbaa !21
  %29 = getelementptr inbounds i8, ptr %.04251, i64 3
  %30 = getelementptr inbounds i8, ptr %.04350, i64 3
  %31 = load i8, ptr %29, align 1, !tbaa !21
  store i8 %31, ptr %30, align 1, !tbaa !21
  %32 = getelementptr inbounds i8, ptr %.04251, i64 4
  %33 = getelementptr inbounds i8, ptr %.04350, i64 4
  %34 = load i8, ptr %32, align 1, !tbaa !21
  store i8 %34, ptr %33, align 1, !tbaa !21
  %35 = getelementptr inbounds i8, ptr %.04251, i64 5
  %36 = getelementptr inbounds i8, ptr %.04350, i64 5
  %37 = load i8, ptr %35, align 1, !tbaa !21
  store i8 %37, ptr %36, align 1, !tbaa !21
  %38 = getelementptr inbounds i8, ptr %.04251, i64 6
  %39 = getelementptr inbounds i8, ptr %.04350, i64 6
  %40 = load i8, ptr %38, align 1, !tbaa !21
  store i8 %40, ptr %39, align 1, !tbaa !21
  %41 = getelementptr inbounds i8, ptr %.04251, i64 7
  %42 = getelementptr inbounds i8, ptr %.04350, i64 7
  %43 = load i8, ptr %41, align 1, !tbaa !21
  store i8 %43, ptr %42, align 1, !tbaa !21
  %44 = add nuw i64 %.052, 8
  %45 = getelementptr inbounds i8, ptr %.04251, i64 8
  %46 = getelementptr inbounds i8, ptr %.04350, i64 8
  %exitcond.not.7 = icmp eq i64 %44, %3
  br i1 %exitcond.not.7, label %.loopexit.loopexit, label %.preheader, !llvm.loop !29

.loopexit.loopexit:                               ; preds = %.preheader.prol.loopexit, %.preheader, %vec.epilog.middle.block, %middle.block
  %.pre = load i64, ptr %2, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %4, %1
  %47 = phi i64 [ %.pre, %.loopexit.loopexit ], [ %3, %4 ], [ 0, %1 ]
  %48 = getelementptr inbounds i8, ptr %0, i64 912
  %49 = load i64, ptr %48, align 8, !tbaa !30
  %50 = add i64 %49, %47
  %51 = getelementptr inbounds i8, ptr %0, i64 896
  %52 = load i64, ptr %51, align 8, !tbaa !31
  %53 = icmp ugt i64 %50, %52
  br i1 %53, label %54, label %67

54:                                               ; preds = %.loopexit
  %55 = sub i64 -257, %49
  %56 = icmp ugt i64 %47, %55
  br i1 %56, label %57, label %58

57:                                               ; preds = %54
  tail call void @png_error(ptr noundef nonnull %0, ptr noundef nonnull @.str.6) #3
  %.pre53 = load i64, ptr %2, align 8, !tbaa !5
  %.pre54 = load i64, ptr %48, align 8, !tbaa !30
  br label %58

58:                                               ; preds = %57, %54
  %59 = phi i64 [ %.pre54, %57 ], [ %49, %54 ]
  %60 = phi i64 [ %.pre53, %57 ], [ %47, %54 ]
  %61 = add i64 %60, 256
  %62 = add i64 %61, %59
  %63 = getelementptr inbounds i8, ptr %0, i64 848
  %64 = load ptr, ptr %63, align 8, !tbaa !20
  %65 = tail call ptr @png_malloc(ptr noundef nonnull %0, i64 noundef %62) #3
  store ptr %65, ptr %63, align 8, !tbaa !20
  %66 = load i64, ptr %2, align 8, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %65, ptr align 1 %64, i64 %66, i1 false)
  tail call void @png_free(ptr noundef nonnull %0, ptr noundef %64) #3
  store i64 %62, ptr %51, align 8, !tbaa !31
  %.pr = load i64, ptr %48, align 8, !tbaa !30
  br label %67

67:                                               ; preds = %58, %.loopexit
  %68 = phi i64 [ %.pr, %58 ], [ %49, %.loopexit ]
  %.not49 = icmp eq i64 %68, 0
  br i1 %.not49, label %79, label %69

69:                                               ; preds = %67
  %70 = getelementptr inbounds i8, ptr %0, i64 848
  %71 = load ptr, ptr %70, align 8, !tbaa !20
  %72 = load i64, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %71, i64 %72
  %74 = getelementptr inbounds i8, ptr %0, i64 856
  %75 = load ptr, ptr %74, align 8, !tbaa !32
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %73, ptr align 1 %75, i64 %68, i1 false)
  %76 = load i64, ptr %48, align 8, !tbaa !30
  %77 = load i64, ptr %2, align 8, !tbaa !5
  %78 = add i64 %77, %76
  store i64 %78, ptr %2, align 8, !tbaa !5
  store i64 0, ptr %48, align 8, !tbaa !30
  br label %79

79:                                               ; preds = %69, %67
  %80 = getelementptr inbounds i8, ptr %0, i64 848
  %81 = load ptr, ptr %80, align 8, !tbaa !20
  %82 = getelementptr inbounds i8, ptr %0, i64 840
  store ptr %81, ptr %82, align 8, !tbaa !19
  %83 = getelementptr inbounds i8, ptr %0, i64 904
  store i64 0, ptr %83, align 8, !tbaa !33
  ret void
}

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

declare ptr @png_malloc(ptr noundef, i64 noundef) local_unnamed_addr #0

declare void @png_free(ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #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 = { 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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, !10, i64 888}
!6 = !{!"png_struct_def", !7, i64 0, !9, i64 200, !9, i64 208, !9, i64 216, !9, i64 224, !9, i64 232, !9, i64 240, !9, i64 248, !9, i64 256, !9, i64 264, !7, i64 272, !7, i64 273, !10, i64 280, !10, i64 288, !10, i64 296, !11, i64 304, !9, i64 416, !10, i64 424, !12, i64 432, !12, i64 436, !12, i64 440, !12, i64 444, !12, i64 448, !10, i64 456, !10, i64 464, !10, i64 472, !10, i64 480, !10, i64 488, !10, i64 496, !10, i64 504, !10, i64 512, !9, i64 520, !9, i64 528, !9, i64 536, !9, i64 544, !9, i64 552, !9, i64 560, !13, i64 568, !10, i64 592, !10, i64 600, !9, i64 608, !14, i64 616, !14, i64 618, !7, i64 620, !7, i64 625, !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, !14, i64 638, !7, i64 640, !15, i64 644, !16, i64 648, !16, i64 658, !9, i64 672, !10, i64 680, !10, i64 688, !12, i64 696, !15, i64 700, !15, i64 704, !9, i64 712, !9, i64 720, !9, i64 728, !9, i64 736, !9, i64 744, !9, i64 752, !17, i64 760, !17, i64 765, !9, i64 776, !16, i64 784, !9, i64 800, !9, i64 808, !9, i64 816, !9, i64 824, !9, i64 832, !9, i64 840, !9, i64 848, !9, i64 856, !9, i64 864, !10, i64 872, !10, i64 880, !10, i64 888, !10, i64 896, !10, i64 904, !10, i64 912, !12, i64 920, !12, i64 924, !10, i64 928, !10, i64 936, !9, i64 944, !9, i64 952, !9, i64 960, !9, i64 968, !9, i64 976, !7, i64 984, !7, i64 985, !9, i64 992, !9, i64 1000, !9, i64 1008, !9, i64 1016, !9, i64 1024, !9, i64 1032, !10, i64 1040, !9, i64 1048, !9, i64 1056, !12, i64 1064, !9, i64 1072, !7, i64 1080, !14, i64 1082, !14, i64 1084, !14, i64 1086, !10, i64 1088, !10, i64 1096, !7, i64 1104, !7, i64 1105, !10, i64 1112, !10, i64 1120, !9, i64 1128, !9, i64 1136, !9, i64 1144, !9, i64 1152, !9, i64 1160, !9, i64 1168, !9, i64 1176, !7, i64 1184, !10, i64 1192, !10, i64 1200, !18, i64 1208, !10, i64 1240, !10, i64 1248, !9, i64 1256}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!"z_stream_s", !9, i64 0, !12, i64 8, !10, i64 16, !9, i64 24, !12, i64 32, !10, i64 40, !9, i64 48, !9, i64 56, !9, i64 64, !9, i64 72, !9, i64 80, !12, i64 88, !10, i64 96, !10, i64 104}
!12 = !{!"int", !7, i64 0}
!13 = !{!"png_row_info_struct", !10, i64 0, !10, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19}
!14 = !{!"short", !7, i64 0}
!15 = !{!"float", !7, i64 0}
!16 = !{!"png_color_16_struct", !7, i64 0, !14, i64 2, !14, i64 4, !14, i64 6, !14, i64 8}
!17 = !{!"png_color_8_struct", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4}
!18 = !{!"png_unknown_chunk_t", !7, i64 0, !9, i64 8, !10, i64 16, !7, i64 24}
!19 = !{!6, !9, i64 840}
!20 = !{!6, !9, i64 848}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23, !24, !25}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!"llvm.loop.isvectorized", i32 1}
!25 = !{!"llvm.loop.unroll.runtime.disable"}
!26 = distinct !{!26, !23, !24, !25}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.unroll.disable"}
!29 = distinct !{!29, !23, !24}
!30 = !{!6, !10, i64 912}
!31 = !{!6, !10, i64 896}
!32 = !{!6, !9, i64 856}
!33 = !{!6, !10, i64 904}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass