; LLVM IR from ssvb/tinymembench :: util (aligned_block_copy_pf32)

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

; 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
define dso_local void @aligned_block_copy_pf32(ptr noalias noundef %0, ptr noalias noundef %1, i32 noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %12 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %12, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  br label %13

13:                                               ; preds = %17, %3
  %14 = load i32, ptr %6, align 4, !tbaa !9
  %15 = sub nsw i32 %14, 64
  store i32 %15, ptr %6, align 4, !tbaa !9
  %16 = icmp sge i32 %15, 0
  br i1 %16, label %17, label %70

17:                                               ; preds = %13
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds i64, ptr %18, i64 32
  call void @llvm.prefetch.p0(ptr %19, i32 0, i32 0, i32 1)
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds i64, ptr %20, i32 1
  store ptr %21, ptr %5, align 8, !tbaa !5
  %22 = load i64, ptr %20, align 8, !tbaa !11
  store i64 %22, ptr %8, align 8, !tbaa !11
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds i64, ptr %23, i32 1
  store ptr %24, ptr %5, align 8, !tbaa !5
  %25 = load i64, ptr %23, align 8, !tbaa !11
  store i64 %25, ptr %9, align 8, !tbaa !11
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds i64, ptr %26, i32 1
  store ptr %27, ptr %5, align 8, !tbaa !5
  %28 = load i64, ptr %26, align 8, !tbaa !11
  store i64 %28, ptr %10, align 8, !tbaa !11
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds i64, ptr %29, i32 1
  store ptr %30, ptr %5, align 8, !tbaa !5
  %31 = load i64, ptr %29, align 8, !tbaa !11
  store i64 %31, ptr %11, align 8, !tbaa !11
  %32 = load i64, ptr %8, align 8, !tbaa !11
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = getelementptr inbounds i64, ptr %33, i32 1
  store ptr %34, ptr %7, align 8, !tbaa !5
  store volatile i64 %32, ptr %33, align 8, !tbaa !11
  %35 = load i64, ptr %9, align 8, !tbaa !11
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds i64, ptr %36, i32 1
  store ptr %37, ptr %7, align 8, !tbaa !5
  store volatile i64 %35, ptr %36, align 8, !tbaa !11
  %38 = load i64, ptr %10, align 8, !tbaa !11
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds i64, ptr %39, i32 1
  store ptr %40, ptr %7, align 8, !tbaa !5
  store volatile i64 %38, ptr %39, align 8, !tbaa !11
  %41 = load i64, ptr %11, align 8, !tbaa !11
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds i64, ptr %42, i32 1
  store ptr %43, ptr %7, align 8, !tbaa !5
  store volatile i64 %41, ptr %42, align 8, !tbaa !11
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds i64, ptr %44, i64 32
  call void @llvm.prefetch.p0(ptr %45, i32 0, i32 0, i32 1)
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds i64, ptr %46, i32 1
  store ptr %47, ptr %5, align 8, !tbaa !5
  %48 = load i64, ptr %46, align 8, !tbaa !11
  store i64 %48, ptr %8, align 8, !tbaa !11
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds i64, ptr %49, i32 1
  store ptr %50, ptr %5, align 8, !tbaa !5
  %51 = load i64, ptr %49, align 8, !tbaa !11
  store i64 %51, ptr %9, align 8, !tbaa !11
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds i64, ptr %52, i32 1
  store ptr %53, ptr %5, align 8, !tbaa !5
  %54 = load i64, ptr %52, align 8, !tbaa !11
  store i64 %54, ptr %10, align 8, !tbaa !11
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds i64, ptr %55, i32 1
  store ptr %56, ptr %5, align 8, !tbaa !5
  %57 = load i64, ptr %55, align 8, !tbaa !11
  store i64 %57, ptr %11, align 8, !tbaa !11
  %58 = load i64, ptr %8, align 8, !tbaa !11
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds i64, ptr %59, i32 1
  store ptr %60, ptr %7, align 8, !tbaa !5
  store volatile i64 %58, ptr %59, align 8, !tbaa !11
  %61 = load i64, ptr %9, align 8, !tbaa !11
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds i64, ptr %62, i32 1
  store ptr %63, ptr %7, align 8, !tbaa !5
  store volatile i64 %61, ptr %62, align 8, !tbaa !11
  %64 = load i64, ptr %10, align 8, !tbaa !11
  %65 = load ptr, ptr %7, align 8, !tbaa !5
  %66 = getelementptr inbounds i64, ptr %65, i32 1
  store ptr %66, ptr %7, align 8, !tbaa !5
  store volatile i64 %64, ptr %65, align 8, !tbaa !11
  %67 = load i64, ptr %11, align 8, !tbaa !11
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds i64, ptr %68, i32 1
  store ptr %69, ptr %7, align 8, !tbaa !5
  store volatile i64 %67, ptr %68, align 8, !tbaa !11
  br label %13, !llvm.loop !13

70:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @llvm.prefetch.p0(ptr nocapture readonly, i32 immarg, i32 immarg, i32 immarg) #2

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; 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: nofree norecurse nounwind uwtable
define dso_local void @aligned_block_copy_pf32(ptr noalias noundef %0, ptr noalias nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = icmp sgt i32 %2, 63
  br i1 %4, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3, %.lr.ph
  %.032 = phi ptr [ %26, %.lr.ph ], [ %1, %3 ]
  %.02731 = phi i32 [ %5, %.lr.ph ], [ %2, %3 ]
  %.02830 = phi ptr [ %31, %.lr.ph ], [ %0, %3 ]
  %5 = add nsw i32 %.02731, -64
  %6 = getelementptr inbounds i8, ptr %.032, i64 256
  tail call void @llvm.prefetch.p0(ptr nonnull %6, i32 0, i32 0, i32 1)
  %7 = getelementptr inbounds i8, ptr %.032, i64 8
  %8 = load i64, ptr %.032, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %.032, i64 16
  %10 = load i64, ptr %7, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %.032, i64 24
  %12 = load i64, ptr %9, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %.032, i64 32
  %14 = load i64, ptr %11, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %.02830, i64 8
  store volatile i64 %8, ptr %.02830, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %.02830, i64 16
  store volatile i64 %10, ptr %15, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %.02830, i64 24
  store volatile i64 %12, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %.02830, i64 32
  store volatile i64 %14, ptr %17, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %.032, i64 288
  tail call void @llvm.prefetch.p0(ptr nonnull %19, i32 0, i32 0, i32 1)
  %20 = getelementptr inbounds i8, ptr %.032, i64 40
  %21 = load i64, ptr %13, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %.032, i64 48
  %23 = load i64, ptr %20, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %.032, i64 56
  %25 = load i64, ptr %22, align 8, !tbaa !5
  %26 = getelementptr inbounds i8, ptr %.032, i64 64
  %27 = load i64, ptr %24, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %.02830, i64 40
  store volatile i64 %21, ptr %18, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %.02830, i64 48
  store volatile i64 %23, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %.02830, i64 56
  store volatile i64 %25, ptr %29, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %.02830, i64 64
  store volatile i64 %27, ptr %30, align 8, !tbaa !5
  %32 = icmp ugt i32 %.02731, 127
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %3
  ret void
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @llvm.prefetch.p0(ptr nocapture readonly, i32 immarg, i32 immarg, i32 immarg) #1

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

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass