; LLVM IR from stonne-simulator/stonne :: pytorch-frontend/third_party/NNPACK/src/scalar/blas/sdotxf.ll_nnp_sdotxf6 (scalar)

; 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 speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #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 @nnp_sdotxf6__scalar(ptr noalias noundef align 4 dereferenceable(4) %0, ptr noalias noundef align 4 dereferenceable(24) %1, i64 noundef %2, ptr noalias noundef align 4 dereferenceable(24) %3, i64 noundef %4) #2 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  %15 = alloca float, align 4
  %16 = alloca float, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  store i64 %4, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  store float 0.000000e+00, ptr %16, align 4, !tbaa !11
  store float 0.000000e+00, ptr %15, align 4, !tbaa !11
  store float 0.000000e+00, ptr %14, align 4, !tbaa !11
  store float 0.000000e+00, ptr %13, align 4, !tbaa !11
  store float 0.000000e+00, ptr %12, align 4, !tbaa !11
  store float 0.000000e+00, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  %24 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %24, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  %25 = load ptr, ptr %17, align 8, !tbaa !5
  %26 = load i64, ptr %8, align 8, !tbaa !9
  %27 = getelementptr inbounds float, ptr %25, i64 %26
  store ptr %27, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %28 = load ptr, ptr %18, align 8, !tbaa !5
  %29 = load i64, ptr %8, align 8, !tbaa !9
  %30 = getelementptr inbounds float, ptr %28, i64 %29
  store ptr %30, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %31 = load ptr, ptr %19, align 8, !tbaa !5
  %32 = load i64, ptr %8, align 8, !tbaa !9
  %33 = getelementptr inbounds float, ptr %31, i64 %32
  store ptr %33, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %34 = load ptr, ptr %20, align 8, !tbaa !5
  %35 = load i64, ptr %8, align 8, !tbaa !9
  %36 = getelementptr inbounds float, ptr %34, i64 %35
  store ptr %36, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %37 = load ptr, ptr %21, align 8, !tbaa !5
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = getelementptr inbounds float, ptr %37, i64 %38
  store ptr %39, ptr %22, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %44, %5
  %41 = load i64, ptr %10, align 8, !tbaa !9
  %42 = add i64 %41, -1
  store i64 %42, ptr %10, align 8, !tbaa !9
  %43 = icmp ne i64 %41, 0
  br i1 %43, label %44, label %84

44:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #3
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds float, ptr %45, i32 1
  store ptr %46, ptr %6, align 8, !tbaa !5
  %47 = load float, ptr %45, align 4, !tbaa !11
  store float %47, ptr %23, align 4, !tbaa !11
  %48 = load float, ptr %23, align 4, !tbaa !11
  %49 = load ptr, ptr %17, align 8, !tbaa !5
  %50 = getelementptr inbounds float, ptr %49, i32 1
  store ptr %50, ptr %17, align 8, !tbaa !5
  %51 = load float, ptr %49, align 4, !tbaa !11
  %52 = load float, ptr %11, align 4, !tbaa !11
  %53 = call float @llvm.fmuladd.f32(float %48, float %51, float %52)
  store float %53, ptr %11, align 4, !tbaa !11
  %54 = load float, ptr %23, align 4, !tbaa !11
  %55 = load ptr, ptr %18, align 8, !tbaa !5
  %56 = getelementptr inbounds float, ptr %55, i32 1
  store ptr %56, ptr %18, align 8, !tbaa !5
  %57 = load float, ptr %55, align 4, !tbaa !11
  %58 = load float, ptr %12, align 4, !tbaa !11
  %59 = call float @llvm.fmuladd.f32(float %54, float %57, float %58)
  store float %59, ptr %12, align 4, !tbaa !11
  %60 = load float, ptr %23, align 4, !tbaa !11
  %61 = load ptr, ptr %19, align 8, !tbaa !5
  %62 = getelementptr inbounds float, ptr %61, i32 1
  store ptr %62, ptr %19, align 8, !tbaa !5
  %63 = load float, ptr %61, align 4, !tbaa !11
  %64 = load float, ptr %13, align 4, !tbaa !11
  %65 = call float @llvm.fmuladd.f32(float %60, float %63, float %64)
  store float %65, ptr %13, align 4, !tbaa !11
  %66 = load float, ptr %23, align 4, !tbaa !11
  %67 = load ptr, ptr %20, align 8, !tbaa !5
  %68 = getelementptr inbounds float, ptr %67, i32 1
  store ptr %68, ptr %20, align 8, !tbaa !5
  %69 = load float, ptr %67, align 4, !tbaa !11
  %70 = load float, ptr %14, align 4, !tbaa !11
  %71 = call float @llvm.fmuladd.f32(float %66, float %69, float %70)
  store float %71, ptr %14, align 4, !tbaa !11
  %72 = load float, ptr %23, align 4, !tbaa !11
  %73 = load ptr, ptr %21, align 8, !tbaa !5
  %74 = getelementptr inbounds float, ptr %73, i32 1
  store ptr %74, ptr %21, align 8, !tbaa !5
  %75 = load float, ptr %73, align 4, !tbaa !11
  %76 = load float, ptr %15, align 4, !tbaa !11
  %77 = call float @llvm.fmuladd.f32(float %72, float %75, float %76)
  store float %77, ptr %15, align 4, !tbaa !11
  %78 = load float, ptr %23, align 4, !tbaa !11
  %79 = load ptr, ptr %22, align 8, !tbaa !5
  %80 = getelementptr inbounds float, ptr %79, i32 1
  store ptr %80, ptr %22, align 8, !tbaa !5
  %81 = load float, ptr %79, align 4, !tbaa !11
  %82 = load float, ptr %16, align 4, !tbaa !11
  %83 = call float @llvm.fmuladd.f32(float %78, float %81, float %82)
  store float %83, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #3
  br label %40, !llvm.loop !13

84:                                               ; preds = %40
  %85 = load float, ptr %11, align 4, !tbaa !11
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds float, ptr %86, i64 0
  store float %85, ptr %87, align 4, !tbaa !11
  %88 = load float, ptr %12, align 4, !tbaa !11
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds float, ptr %89, i64 1
  store float %88, ptr %90, align 4, !tbaa !11
  %91 = load float, ptr %13, align 4, !tbaa !11
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds float, ptr %92, i64 2
  store float %91, ptr %93, align 4, !tbaa !11
  %94 = load float, ptr %14, align 4, !tbaa !11
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds float, ptr %95, i64 3
  store float %94, ptr %96, align 4, !tbaa !11
  %97 = load float, ptr %15, align 4, !tbaa !11
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds float, ptr %98, i64 4
  store float %97, ptr %99, align 4, !tbaa !11
  %100 = load float, ptr %16, align 4, !tbaa !11
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = getelementptr inbounds float, ptr %101, i64 5
  store float %100, ptr %102, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !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 nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @nnp_sdotxf6__scalar(ptr noalias nocapture noundef readonly align 4 dereferenceable(4) %0, ptr noalias nocapture noundef readonly align 4 dereferenceable(24) %1, i64 noundef %2, ptr noalias nocapture noundef writeonly align 4 dereferenceable(24) %3, i64 noundef %4) local_unnamed_addr #0 {
  %.not55 = icmp eq i64 %4, 0
  br i1 %.not55, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %5
  %6 = getelementptr inbounds float, ptr %1, i64 %2
  %7 = getelementptr inbounds float, ptr %6, i64 %2
  %8 = getelementptr inbounds float, ptr %7, i64 %2
  %9 = getelementptr inbounds float, ptr %8, i64 %2
  %10 = getelementptr inbounds float, ptr %9, i64 %2
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.069 = phi ptr [ %14, %.lr.ph ], [ %0, %.lr.ph.preheader ]
  %.04268 = phi ptr [ %33, %.lr.ph ], [ %10, %.lr.ph.preheader ]
  %.04367 = phi ptr [ %31, %.lr.ph ], [ %9, %.lr.ph.preheader ]
  %.04466 = phi ptr [ %22, %.lr.ph ], [ %8, %.lr.ph.preheader ]
  %.04565 = phi ptr [ %20, %.lr.ph ], [ %7, %.lr.ph.preheader ]
  %.04664 = phi ptr [ %18, %.lr.ph ], [ %6, %.lr.ph.preheader ]
  %.04763 = phi ptr [ %16, %.lr.ph ], [ %1, %.lr.ph.preheader ]
  %.05456 = phi i64 [ %13, %.lr.ph ], [ %4, %.lr.ph.preheader ]
  %11 = phi <4 x float> [ %30, %.lr.ph ], [ zeroinitializer, %.lr.ph.preheader ]
  %12 = phi <2 x float> [ %39, %.lr.ph ], [ zeroinitializer, %.lr.ph.preheader ]
  %13 = add i64 %.05456, -1
  %14 = getelementptr inbounds i8, ptr %.069, i64 4
  %15 = load float, ptr %.069, align 4, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %.04763, i64 4
  %17 = load float, ptr %.04763, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %.04664, i64 4
  %19 = load float, ptr %.04664, align 4, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %.04565, i64 4
  %21 = load float, ptr %.04565, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %.04466, i64 4
  %23 = load float, ptr %.04466, align 4, !tbaa !5
  %24 = insertelement <4 x float> poison, float %15, i64 0
  %25 = shufflevector <4 x float> %24, <4 x float> poison, <4 x i32> zeroinitializer
  %26 = insertelement <4 x float> poison, float %17, i64 0
  %27 = insertelement <4 x float> %26, float %19, i64 1
  %28 = insertelement <4 x float> %27, float %21, i64 2
  %29 = insertelement <4 x float> %28, float %23, i64 3
  %30 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %25, <4 x float> %29, <4 x float> %11)
  %31 = getelementptr inbounds i8, ptr %.04367, i64 4
  %32 = load float, ptr %.04367, align 4, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %.04268, i64 4
  %34 = load float, ptr %.04268, align 4, !tbaa !5
  %35 = insertelement <2 x float> poison, float %15, i64 0
  %36 = shufflevector <2 x float> %35, <2 x float> poison, <2 x i32> zeroinitializer
  %37 = insertelement <2 x float> poison, float %32, i64 0
  %38 = insertelement <2 x float> %37, float %34, i64 1
  %39 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %36, <2 x float> %38, <2 x float> %12)
  %.not = icmp eq i64 %13, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %5
  %40 = phi <4 x float> [ zeroinitializer, %5 ], [ %30, %.lr.ph ]
  %41 = phi <2 x float> [ zeroinitializer, %5 ], [ %39, %.lr.ph ]
  store <4 x float> %40, ptr %3, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %3, i64 16
  store <2 x float> %41, ptr %42, align 4, !tbaa !5
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #1

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

!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 = !{!"float", !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: EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass