; LLVM IR from ermig1979/Simd :: src/Simd/SimdBaseImageLoadPng.ll (ZN4Simd4Base14ImagePngLoader16MergedDataStreamEv)

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

%"class.Simd::InputMemoryStream" = type { ptr, i64, i64, i64, i64 }
%"class.Simd::Base::ImagePngLoader" = type { %"class.Simd::ImageLoader", [7 x ptr], ptr, ptr, i8, i8, i8, i32, i32, i32, i32, [3 x i16], i8, i8, i8, i8, [3 x i8], %"struct.Simd::Array", %"struct.Simd::Array", %"struct.Simd::Array", %"class.std::vector" }
%"class.Simd::ImageLoader" = type { ptr, %"struct.Simd::ImageLoaderParam", %"class.Simd::InputMemoryStream", %"struct.Simd::View" }
%"struct.Simd::ImageLoaderParam" = type { ptr, i64, i32, i32 }
%"struct.Simd::View" = type <{ i64, i64, i64, i32, [4 x i8], ptr, i8, [7 x i8] }>
%"struct.Simd::Array" = type { ptr, i64 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl" }
%"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl" = type { %"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Simd::Base::ImagePngLoader::Chunk, std::allocator<Simd::Base::ImagePngLoader::Chunk>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.Simd::Base::ImagePngLoader::Chunk" = type { i32, i32, i32 }

; 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: mustprogress uwtable
define dso_local void @_ZN4Simd4Base14ImagePngLoader16MergedDataStreamEv(ptr dead_on_unwind noalias writable sret(%"class.Simd::InputMemoryStream") align 8 %0, ptr noundef nonnull align 8 dereferenceable(304) %1) #1 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  store ptr %1, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8
  %9 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %10 = call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #6
  %11 = icmp eq i64 %10, 1
  br i1 %11, label %12, label %26

12:                                               ; preds = %2
  %13 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 2
  %14 = call noundef ptr @_ZNK4Simd17InputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(40) %13)
  %15 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %16 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef 0) #6
  %17 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %16, i32 0, i32 2
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = zext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr %14, i64 %19
  %21 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %22 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %21, i64 noundef 0) #6
  %23 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %22, i32 0, i32 0
  %24 = load i32, ptr %23, align 4, !tbaa !12
  %25 = zext i32 %24 to i64
  call void @_ZN4Simd17InputMemoryStreamC2EPKhm(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %20, i64 noundef %25)
  br label %93

26:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  store i64 0, ptr %4, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store i64 0, ptr %5, align 8, !tbaa !13
  br label %27

27:                                               ; preds = %42, %26
  %28 = load i64, ptr %5, align 8, !tbaa !13
  %29 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %30 = call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %29) #6
  %31 = icmp ult i64 %28, %30
  br i1 %31, label %33, label %32

32:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %45

33:                                               ; preds = %27
  %34 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %35 = load i64, ptr %5, align 8, !tbaa !13
  %36 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %34, i64 noundef %35) #6
  %37 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 4, !tbaa !12
  %39 = zext i32 %38 to i64
  %40 = load i64, ptr %4, align 8, !tbaa !13
  %41 = add i64 %40, %39
  store i64 %41, ptr %4, align 8, !tbaa !13
  br label %42

42:                                               ; preds = %33
  %43 = load i64, ptr %5, align 8, !tbaa !13
  %44 = add i64 %43, 1
  store i64 %44, ptr %5, align 8, !tbaa !13
  br label %27, !llvm.loop !15

45:                                               ; preds = %32
  %46 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 18
  %47 = load i64, ptr %4, align 8, !tbaa !13
  call void @_ZN4Simd5ArrayIhE6ResizeEmbm(ptr noundef nonnull align 8 dereferenceable(16) %46, i64 noundef %47, i1 noundef zeroext false, i64 noundef 8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store i64 0, ptr %6, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  store i64 0, ptr %7, align 8, !tbaa !13
  br label %48

48:                                               ; preds = %83, %45
  %49 = load i64, ptr %6, align 8, !tbaa !13
  %50 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %51 = call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %50) #6
  %52 = icmp ult i64 %49, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %86

54:                                               ; preds = %48
  %55 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 18
  %56 = getelementptr inbounds %"struct.Simd::Array", ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8, !tbaa !17
  %58 = load i64, ptr %7, align 8, !tbaa !13
  %59 = getelementptr inbounds i8, ptr %57, i64 %58
  %60 = getelementptr inbounds %"class.Simd::ImageLoader", ptr %8, i32 0, i32 2
  %61 = call noundef ptr @_ZNK4Simd17InputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(40) %60)
  %62 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %63 = load i64, ptr %6, align 8, !tbaa !13
  %64 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %62, i64 noundef %63) #6
  %65 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %64, i32 0, i32 2
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds i8, ptr %61, i64 %67
  %69 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %70 = load i64, ptr %6, align 8, !tbaa !13
  %71 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %69, i64 noundef %70) #6
  %72 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %71, i32 0, i32 0
  %73 = load i32, ptr %72, align 4, !tbaa !12
  %74 = zext i32 %73 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %59, ptr align 1 %68, i64 %74, i1 false)
  %75 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 20
  %76 = load i64, ptr %6, align 8, !tbaa !13
  %77 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %75, i64 noundef %76) #6
  %78 = getelementptr inbounds %"struct.Simd::Base::ImagePngLoader::Chunk", ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 4, !tbaa !12
  %80 = zext i32 %79 to i64
  %81 = load i64, ptr %7, align 8, !tbaa !13
  %82 = add i64 %81, %80
  store i64 %82, ptr %7, align 8, !tbaa !13
  br label %83

83:                                               ; preds = %54
  %84 = load i64, ptr %6, align 8, !tbaa !13
  %85 = add i64 %84, 1
  store i64 %85, ptr %6, align 8, !tbaa !13
  br label %48, !llvm.loop !32

86:                                               ; preds = %53
  %87 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 18
  %88 = getelementptr inbounds %"struct.Simd::Array", ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !17
  %90 = getelementptr inbounds %"class.Simd::Base::ImagePngLoader", ptr %8, i32 0, i32 18
  %91 = getelementptr inbounds %"struct.Simd::Array", ptr %90, i32 0, i32 1
  %92 = load i64, ptr %91, align 8, !tbaa !33
  call void @_ZN4Simd17InputMemoryStreamC2EPKhm(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %89, i64 noundef %92)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %93

93:                                               ; preds = %86, %12
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #2 align 2

; 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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhE6ResizeEmbm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext, i64 noundef) #4 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4Simd17InputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(40)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd17InputMemoryStreamC2EPKhm(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i64 noundef) unnamed_addr #4 align 2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 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 = { alwaysinline mustprogress 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 #5 = { alwaysinline mustprogress 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 #6 = { 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++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"_ZTSN4Simd4Base14ImagePngLoader5ChunkE", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !6, i64 248}
!18 = !{!"_ZTSN4Simd4Base14ImagePngLoaderE", !19, i64 0, !7, i64 120, !6, i64 176, !6, i64 184, !26, i64 192, !26, i64 193, !26, i64 194, !11, i64 196, !11, i64 200, !11, i64 204, !11, i64 208, !7, i64 212, !7, i64 218, !7, i64 219, !7, i64 220, !7, i64 221, !7, i64 222, !27, i64 232, !27, i64 248, !27, i64 264, !28, i64 280}
!19 = !{!"_ZTSN4Simd11ImageLoaderE", !20, i64 8, !23, i64 32, !24, i64 72}
!20 = !{!"_ZTSN4Simd16ImageLoaderParamE", !6, i64 0, !14, i64 8, !21, i64 16, !22, i64 20}
!21 = !{!"_ZTS17SimdImageFileType", !7, i64 0}
!22 = !{!"_ZTS19SimdPixelFormatType", !7, i64 0}
!23 = !{!"_ZTSN4Simd17InputMemoryStreamE", !6, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32}
!24 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !14, i64 0, !14, i64 8, !14, i64 16, !25, i64 24, !6, i64 32, !26, i64 40}
!25 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !7, i64 0}
!26 = !{!"bool", !7, i64 0}
!27 = !{!"_ZTSN4Simd5ArrayIhEE", !6, i64 0, !14, i64 8}
!28 = !{!"_ZTSSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !29, i64 0}
!29 = !{!"_ZTSSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !30, i64 0}
!30 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE12_Vector_implE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!32 = distinct !{!32, !16}
!33 = !{!18, !14, i64 256}


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

%"class.Simd::InputMemoryStream" = type { ptr, i64, i64, i64, i64 }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4Simd4Base14ImagePngLoader16MergedDataStreamEv(ptr dead_on_unwind noalias writable sret(%"class.Simd::InputMemoryStream") align 8 %0, ptr noundef nonnull align 8 dereferenceable(304) %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 280
  %4 = tail call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %5 = icmp eq i64 %4, 1
  br i1 %5, label %7, label %.preheader

.preheader:                                       ; preds = %2
  %6 = tail call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %.not = icmp eq i64 %6, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %1, i64 32
  %9 = tail call noundef ptr @_ZNK4Simd17InputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(40) %8)
  %10 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #5
  %11 = getelementptr inbounds i8, ptr %10, i64 8
  %12 = load i32, ptr %11, align 4, !tbaa !5
  %13 = zext i32 %12 to i64
  %14 = getelementptr inbounds i8, ptr %9, i64 %13
  %15 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef 0) #5
  %16 = load i32, ptr %15, align 4, !tbaa !10
  %17 = zext i32 %16 to i64
  tail call void @_ZN4Simd17InputMemoryStreamC2EPKhm(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %14, i64 noundef %17)
  br label %50

._crit_edge:                                      ; preds = %.lr.ph, %.preheader
  %.014.lcssa = phi i64 [ 0, %.preheader ], [ %24, %.lr.ph ]
  %18 = getelementptr inbounds i8, ptr %1, i64 248
  tail call void @_ZN4Simd5ArrayIhE6ResizeEmbm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %.014.lcssa, i1 noundef zeroext false, i64 noundef 8)
  %19 = tail call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %.not22 = icmp eq i64 %19, 0
  br i1 %.not22, label %._crit_edge21, label %.lr.ph20

.lr.ph20:                                         ; preds = %._crit_edge
  %20 = getelementptr inbounds i8, ptr %1, i64 32
  br label %31

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %.01316 = phi i64 [ %25, %.lr.ph ], [ 0, %.preheader ]
  %.01415 = phi i64 [ %24, %.lr.ph ], [ 0, %.preheader ]
  %21 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.01316) #5
  %22 = load i32, ptr %21, align 4, !tbaa !10
  %23 = zext i32 %22 to i64
  %24 = add i64 %.01415, %23
  %25 = add nuw i64 %.01316, 1
  %26 = tail call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %27 = icmp ult i64 %25, %26
  br i1 %27, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge21:                                    ; preds = %31, %._crit_edge
  %28 = load ptr, ptr %18, align 8, !tbaa !13
  %29 = getelementptr inbounds i8, ptr %1, i64 256
  %30 = load i64, ptr %29, align 8, !tbaa !30
  tail call void @_ZN4Simd17InputMemoryStreamC2EPKhm(ptr noundef nonnull align 8 dereferenceable(40) %0, ptr noundef %28, i64 noundef %30)
  br label %50

31:                                               ; preds = %.lr.ph20, %31
  %.018 = phi i64 [ 0, %.lr.ph20 ], [ %46, %31 ]
  %.01217 = phi i64 [ 0, %.lr.ph20 ], [ %47, %31 ]
  %32 = load ptr, ptr %18, align 8, !tbaa !13
  %33 = getelementptr inbounds i8, ptr %32, i64 %.018
  %34 = tail call noundef ptr @_ZNK4Simd17InputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(40) %20)
  %35 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.01217) #5
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = zext i32 %37 to i64
  %39 = getelementptr inbounds i8, ptr %34, i64 %38
  %40 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.01217) #5
  %41 = load i32, ptr %40, align 4, !tbaa !10
  %42 = zext i32 %41 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %33, ptr align 1 %39, i64 %42, i1 false)
  %43 = tail call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.01217) #5
  %44 = load i32, ptr %43, align 4, !tbaa !10
  %45 = zext i32 %44 to i64
  %46 = add i64 %.018, %45
  %47 = add nuw i64 %.01217, 1
  %48 = tail call noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #5
  %49 = icmp ult i64 %47, %48
  br i1 %49, label %31, label %._crit_edge21, !llvm.loop !31

50:                                               ; preds = %._crit_edge21, %7
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #1 align 2

; 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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd5ArrayIhE6ResizeEmbm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext, i64 noundef) local_unnamed_addr #3 align 2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK4Simd17InputMemoryStream4DataEv(ptr noundef nonnull align 8 dereferenceable(40)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN4Simd17InputMemoryStreamC2EPKhm(ptr noundef nonnull align 8 dereferenceable(40), ptr noundef, i64 noundef) unnamed_addr #3 align 2

attributes #0 = { mustprogress 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 = { mustprogress 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 = { alwaysinline mustprogress 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 #4 = { alwaysinline mustprogress 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"_ZTSN4Simd4Base14ImagePngLoader5ChunkE", !7, i64 0, !7, i64 4, !7, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!6, !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !17, i64 248}
!14 = !{!"_ZTSN4Simd4Base14ImagePngLoaderE", !15, i64 0, !8, i64 120, !17, i64 176, !17, i64 184, !24, i64 192, !24, i64 193, !24, i64 194, !7, i64 196, !7, i64 200, !7, i64 204, !7, i64 208, !8, i64 212, !8, i64 218, !8, i64 219, !8, i64 220, !8, i64 221, !8, i64 222, !25, i64 232, !25, i64 248, !25, i64 264, !26, i64 280}
!15 = !{!"_ZTSN4Simd11ImageLoaderE", !16, i64 8, !21, i64 32, !22, i64 72}
!16 = !{!"_ZTSN4Simd16ImageLoaderParamE", !17, i64 0, !18, i64 8, !19, i64 16, !20, i64 20}
!17 = !{!"any pointer", !8, i64 0}
!18 = !{!"long", !8, i64 0}
!19 = !{!"_ZTS17SimdImageFileType", !8, i64 0}
!20 = !{!"_ZTS19SimdPixelFormatType", !8, i64 0}
!21 = !{!"_ZTSN4Simd17InputMemoryStreamE", !17, i64 0, !18, i64 8, !18, i64 16, !18, i64 24, !18, i64 32}
!22 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEEE", !18, i64 0, !18, i64 8, !18, i64 16, !23, i64 24, !17, i64 32, !24, i64 40}
!23 = !{!"_ZTSN4Simd4ViewINS_9AllocatorEE6FormatE", !8, i64 0}
!24 = !{!"bool", !8, i64 0}
!25 = !{!"_ZTSN4Simd5ArrayIhEE", !17, i64 0, !18, i64 8}
!26 = !{!"_ZTSSt6vectorIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !27, i64 0}
!27 = !{!"_ZTSSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE12_Vector_implE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN4Simd4Base14ImagePngLoader5ChunkESaIS3_EE17_Vector_impl_dataE", !17, i64 0, !17, i64 8, !17, i64 16}
!30 = !{!14, !18, i64 256}
!31 = distinct !{!31, !12}


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