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

50:                                               ; preds = %54, %5
  %51 = load i64, ptr %10, align 8, !tbaa !9
  %52 = add i64 %51, -1
  store i64 %52, ptr %10, align 8, !tbaa !9
  %53 = icmp ne i64 %51, 0
  br i1 %53, label %54, label %106

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

106:                                              ; preds = %50
  %107 = load float, ptr %11, align 4, !tbaa !11
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds float, ptr %108, i64 0
  store float %107, ptr %109, align 4, !tbaa !11
  %110 = load float, ptr %12, align 4, !tbaa !11
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds float, ptr %111, i64 1
  store float %110, ptr %112, align 4, !tbaa !11
  %113 = load float, ptr %13, align 4, !tbaa !11
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds float, ptr %114, i64 2
  store float %113, ptr %115, align 4, !tbaa !11
  %116 = load float, ptr %14, align 4, !tbaa !11
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds float, ptr %117, i64 3
  store float %116, ptr %118, align 4, !tbaa !11
  %119 = load float, ptr %15, align 4, !tbaa !11
  %120 = load ptr, ptr %9, align 8, !tbaa !5
  %121 = getelementptr inbounds float, ptr %120, i64 4
  store float %119, ptr %121, align 4, !tbaa !11
  %122 = load float, ptr %16, align 4, !tbaa !11
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds float, ptr %123, i64 5
  store float %122, ptr %124, align 4, !tbaa !11
  %125 = load float, ptr %17, align 4, !tbaa !11
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds float, ptr %126, i64 6
  store float %125, ptr %127, align 4, !tbaa !11
  %128 = load float, ptr %18, align 4, !tbaa !11
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds float, ptr %129, i64 7
  store float %128, ptr %130, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #3
  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 4, 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: nofree norecurse nosync nounwind memory(read, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @nnp_sdotxf8__scalar(ptr noalias nocapture noundef readonly align 4 dereferenceable(4) %0, ptr noalias nocapture noundef readonly align 4 dereferenceable(32) %1, i64 noundef %2, ptr noalias nocapture noundef writeonly align 4 dereferenceable(32) %3, i64 noundef %4) local_unnamed_addr #0 {
  %.not73 = icmp eq i64 %4, 0
  br i1 %.not73, 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
  %12 = getelementptr inbounds float, ptr %11, i64 %2
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.091 = phi ptr [ %16, %.lr.ph ], [ %0, %.lr.ph.preheader ]
  %.05690 = phi ptr [ %39, %.lr.ph ], [ %12, %.lr.ph.preheader ]
  %.05789 = phi ptr [ %37, %.lr.ph ], [ %11, %.lr.ph.preheader ]
  %.05888 = phi ptr [ %35, %.lr.ph ], [ %10, %.lr.ph.preheader ]
  %.05987 = phi ptr [ %33, %.lr.ph ], [ %9, %.lr.ph.preheader ]
  %.06086 = phi ptr [ %24, %.lr.ph ], [ %8, %.lr.ph.preheader ]
  %.06185 = phi ptr [ %22, %.lr.ph ], [ %7, %.lr.ph.preheader ]
  %.06284 = phi ptr [ %20, %.lr.ph ], [ %6, %.lr.ph.preheader ]
  %.06383 = phi ptr [ %18, %.lr.ph ], [ %1, %.lr.ph.preheader ]
  %.07274 = phi i64 [ %15, %.lr.ph ], [ %4, %.lr.ph.preheader ]
  %13 = phi <4 x float> [ %32, %.lr.ph ], [ zeroinitializer, %.lr.ph.preheader ]
  %14 = phi <4 x float> [ %45, %.lr.ph ], [ zeroinitializer, %.lr.ph.preheader ]
  %15 = add i64 %.07274, -1
  %16 = getelementptr inbounds i8, ptr %.091, i64 4
  %17 = load float, ptr %.091, align 4, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %.06383, i64 4
  %19 = load float, ptr %.06383, align 4, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %.06284, i64 4
  %21 = load float, ptr %.06284, align 4, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %.06185, i64 4
  %23 = load float, ptr %.06185, align 4, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %.06086, i64 4
  %25 = load float, ptr %.06086, align 4, !tbaa !5
  %26 = insertelement <4 x float> poison, float %17, i64 0
  %27 = shufflevector <4 x float> %26, <4 x float> poison, <4 x i32> zeroinitializer
  %28 = insertelement <4 x float> poison, float %19, i64 0
  %29 = insertelement <4 x float> %28, float %21, i64 1
  %30 = insertelement <4 x float> %29, float %23, i64 2
  %31 = insertelement <4 x float> %30, float %25, i64 3
  %32 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %27, <4 x float> %31, <4 x float> %13)
  %33 = getelementptr inbounds i8, ptr %.05987, i64 4
  %34 = load float, ptr %.05987, align 4, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %.05888, i64 4
  %36 = load float, ptr %.05888, align 4, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %.05789, i64 4
  %38 = load float, ptr %.05789, align 4, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %.05690, i64 4
  %40 = load float, ptr %.05690, align 4, !tbaa !5
  %41 = insertelement <4 x float> poison, float %34, i64 0
  %42 = insertelement <4 x float> %41, float %36, i64 1
  %43 = insertelement <4 x float> %42, float %38, i64 2
  %44 = insertelement <4 x float> %43, float %40, i64 3
  %45 = tail call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %27, <4 x float> %44, <4 x float> %14)
  %.not = icmp eq i64 %15, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

._crit_edge:                                      ; preds = %.lr.ph, %5
  %46 = phi <4 x float> [ zeroinitializer, %5 ], [ %32, %.lr.ph ]
  %47 = phi <4 x float> [ zeroinitializer, %5 ], [ %45, %.lr.ph ]
  store <4 x float> %46, ptr %3, align 4, !tbaa !5
  %48 = getelementptr inbounds i8, ptr %3, i64 16
  store <4 x float> %47, ptr %48, 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

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