; LLVM IR from stonne-simulator/stonne :: pytorch-frontend/third_party/NNPACK/src/scalar/blas/sdotxf.ll_nnp_sdotxf7 (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_sdotxf7__scalar(ptr noalias noundef align 4 dereferenceable(4) %0, ptr noalias noundef align 4 dereferenceable(28) %1, i64 noundef %2, ptr noalias noundef align 4 dereferenceable(28) %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 float, align 4
  %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 ptr, align 8
  %24 = alloca ptr, align 8
  %25 = 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store float 0.000000e+00, ptr %17, align 4, !tbaa !11
  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 %18) #3
  %26 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %26, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  %27 = load ptr, ptr %18, align 8, !tbaa !5
  %28 = load i64, ptr %8, align 8, !tbaa !9
  %29 = getelementptr inbounds float, ptr %27, i64 %28
  store ptr %29, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  %30 = load ptr, ptr %19, align 8, !tbaa !5
  %31 = load i64, ptr %8, align 8, !tbaa !9
  %32 = getelementptr inbounds float, ptr %30, i64 %31
  store ptr %32, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %33 = load ptr, ptr %20, align 8, !tbaa !5
  %34 = load i64, ptr %8, align 8, !tbaa !9
  %35 = getelementptr inbounds float, ptr %33, i64 %34
  store ptr %35, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  %36 = load ptr, ptr %21, align 8, !tbaa !5
  %37 = load i64, ptr %8, align 8, !tbaa !9
  %38 = getelementptr inbounds float, ptr %36, i64 %37
  store ptr %38, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  %39 = load ptr, ptr %22, align 8, !tbaa !5
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = getelementptr inbounds float, ptr %39, i64 %40
  store ptr %41, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %42 = load ptr, ptr %23, align 8, !tbaa !5
  %43 = load i64, ptr %8, align 8, !tbaa !9
  %44 = getelementptr inbounds float, ptr %42, i64 %43
  store ptr %44, ptr %24, align 8, !tbaa !5
  br label %45

45:                                               ; preds = %49, %5
  %46 = load i64, ptr %10, align 8, !tbaa !9
  %47 = add i64 %46, -1
  store i64 %47, ptr %10, align 8, !tbaa !9
  %48 = icmp ne i64 %46, 0
  br i1 %48, label %49, label %95

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

95:                                               ; preds = %45
  %96 = load float, ptr %11, align 4, !tbaa !11
  %97 = load ptr, ptr %9, align 8, !tbaa !5
  %98 = getelementptr inbounds float, ptr %97, i64 0
  store float %96, ptr %98, align 4, !tbaa !11
  %99 = load float, ptr %12, align 4, !tbaa !11
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds float, ptr %100, i64 1
  store float %99, ptr %101, align 4, !tbaa !11
  %102 = load float, ptr %13, align 4, !tbaa !11
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  %104 = getelementptr inbounds float, ptr %103, i64 2
  store float %102, ptr %104, align 4, !tbaa !11
  %105 = load float, ptr %14, align 4, !tbaa !11
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = getelementptr inbounds float, ptr %106, i64 3
  store float %105, ptr %107, align 4, !tbaa !11
  %108 = load float, ptr %15, align 4, !tbaa !11
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds float, ptr %109, i64 4
  store float %108, ptr %110, align 4, !tbaa !11
  %111 = load float, ptr %16, align 4, !tbaa !11
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  %113 = getelementptr inbounds float, ptr %112, i64 5
  store float %111, ptr %113, align 4, !tbaa !11
  %114 = load float, ptr %17, align 4, !tbaa !11
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds float, ptr %115, i64 6
  store float %114, ptr %116, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  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 4, 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: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @nnp_sdotxf7__scalar(ptr noalias nocapture noundef readonly align 4 dereferenceable(4) %0, ptr noalias nocapture noundef readonly align 4 dereferenceable(28) %1, i64 noundef %2, ptr noalias nocapture noundef writeonly align 4 dereferenceable(28) %3, i64 noundef %4) local_unnamed_addr #1 {
  %.not64 = icmp eq i64 %4, 0
  br i1 %.not64, 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
  %11 = getelementptr inbounds float, ptr %10, i64 %2
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.080 = phi ptr [ %15, %.lr.ph ], [ %0, %.lr.ph.preheader ]
  %.04979 = phi ptr [ %41, %.lr.ph ], [ %11, %.lr.ph.preheader ]
  %.05078 = phi ptr [ %34, %.lr.ph ], [ %10, %.lr.ph.preheader ]
  %.05177 = phi ptr [ %32, %.lr.ph ], [ %9, %.lr.ph.preheader ]
  %.05276 = phi ptr [ %23, %.lr.ph ], [ %8, %.lr.ph.preheader ]
  %.05375 = phi ptr [ %21, %.lr.ph ], [ %7, %.lr.ph.preheader ]
  %.05474 = phi ptr [ %19, %.lr.ph ], [ %6, %.lr.ph.preheader ]
  %.05573 = phi ptr [ %17, %.lr.ph ], [ %1, %.lr.ph.preheader ]
  %.05672 = phi float [ %43, %.lr.ph ], [ 0.000000e+00, %.lr.ph.preheader ]
  %.06365 = phi i64 [ %14, %.lr.ph ], [ %4, %.lr.ph.preheader ]
  %12 = phi <4 x float> [ %31, %.lr.ph ], [ zeroinitializer, %.lr.ph.preheader ]
  %13 = phi <2 x float> [ %40, %.lr.ph ], [ zeroinitializer, %.lr.ph.preheader ]
  %14 = add i64 %.06365, -1
  %15 = getelementptr inbounds i8, ptr %.080, i64 4
  %16 = load float, ptr %.080, align 4, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %.05573, i64 4
  %18 = load float, ptr %.05573, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %.05474, i64 4
  %20 = load float, ptr %.05474, align 4, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %.05375, i64 4
  %22 = load float, ptr %.05375, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %.05276, i64 4
  %24 = load float, ptr %.05276, align 4, !tbaa !5
  %25 = insertelement <4 x float> poison, float %16, i64 0
  %26 = shufflevector <4 x float> %25, <4 x float> poison, <4 x i32> zeroinitializer
  %27 = insertelement <4 x float> poison, float %18, i64 0
  %28 = insertelement <4 x float> %27, float %20, i64 1
  %29 = insertelement <4 x float> %28, float %22, i64 2
  %30 = insertelement <4 x float> %29, float %24, i64 3
  %31 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %26, <4 x float> %30, <4 x float> %12)
  %32 = getelementptr inbounds i8, ptr %.05177, i64 4
  %33 = load float, ptr %.05177, align 4, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %.05078, i64 4
  %35 = load float, ptr %.05078, align 4, !tbaa !5
  %36 = insertelement <2 x float> poison, float %16, i64 0
  %37 = shufflevector <2 x float> %36, <2 x float> poison, <2 x i32> zeroinitializer
  %38 = insertelement <2 x float> poison, float %33, i64 0
  %39 = insertelement <2 x float> %38, float %35, i64 1
  %40 = tail call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %37, <2 x float> %39, <2 x float> %13)
  %41 = getelementptr inbounds i8, ptr %.04979, i64 4
  %42 = load float, ptr %.04979, align 4, !tbaa !5
  %43 = tail call float @llvm.fmuladd.f32(float %16, float %42, float %.05672)
  %.not = icmp eq i64 %14, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %5
  %.056.lcssa = phi float [ 0.000000e+00, %5 ], [ %43, %.lr.ph ]
  %44 = phi <4 x float> [ zeroinitializer, %5 ], [ %31, %.lr.ph ]
  %45 = phi <2 x float> [ zeroinitializer, %5 ], [ %40, %.lr.ph ]
  store <4 x float> %44, ptr %3, align 4, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %3, i64 16
  store <2 x float> %45, ptr %46, align 4, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %3, i64 24
  store float %.056.lcssa, ptr %47, 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>) #2

; 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>) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { 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 #2 = { 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,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass