; LLVM IR from EntityFX/anybench :: src/benchmarks/generic/mpmflops (mpmflops_s)

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

%struct.MYCALCS = type { ptr, i32 }

@xval = external dso_local global float, align 4
@aval = external dso_local global float, align 4
@bval = external dso_local global float, align 4
@cval = external dso_local global float, align 4
@dval = external dso_local global float, align 4
@eval = external dso_local global float, align 4
@fval = external dso_local global float, align 4
@gval = external dso_local global float, align 4
@hval = external dso_local global float, align 4
@jval = external dso_local global float, align 4
@kval = external dso_local global float, align 4
@lval = external dso_local global float, align 4
@mval = external dso_local global float, align 4
@oval = external dso_local global float, align 4
@pval = external dso_local global float, align 4
@qval = external dso_local global float, align 4
@rval = external dso_local global float, align 4
@sval = external dso_local global float, align 4
@tval = external dso_local global float, align 4
@uval = external dso_local global float, align 4
@vval = external dso_local global float, align 4
@wval = external dso_local global float, align 4
@yval = external dso_local global float, align 4
@xcalcs = external dso_local global %struct.MYCALCS, align 8
@runrepeats = external dso_local global i32, align 4
@part = external dso_local global i32, align 4
@opwd = external dso_local global i32, align 4

; Function Attrs: nounwind uwtable
declare dso_local void @triadplus2(i32 noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local void @triad(i32 noundef, float noundef, float noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local ptr @runTests(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %7 = load ptr, ptr %2, align 8, !tbaa !5
  %8 = ptrtoint ptr %7 to i64
  store i64 %8, ptr %5, align 8, !tbaa !9
  %9 = load i32, ptr getelementptr inbounds (%struct.MYCALCS, ptr @xcalcs, i32 0, i32 1), align 8, !tbaa !11
  store i32 %9, ptr %4, align 4, !tbaa !14
  %10 = load ptr, ptr @xcalcs, align 8, !tbaa !15
  %11 = load i64, ptr %5, align 8, !tbaa !9
  %12 = load i32, ptr %4, align 4, !tbaa !14
  %13 = sext i32 %12 to i64
  %14 = mul nsw i64 %11, %13
  %15 = getelementptr inbounds float, ptr %10, i64 %14
  store ptr %15, ptr %6, align 8, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %16

16:                                               ; preds = %57, %1
  %17 = load i32, ptr %3, align 4, !tbaa !14
  %18 = load i32, ptr @runrepeats, align 4, !tbaa !14
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %20, label %60

20:                                               ; preds = %16
  %21 = load i32, ptr @part, align 4, !tbaa !14
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %28

23:                                               ; preds = %20
  %24 = load i32, ptr %4, align 4, !tbaa !14
  %25 = load float, ptr @aval, align 4, !tbaa !16
  %26 = load float, ptr @xval, align 4, !tbaa !16
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  call void @triad(i32 noundef %24, float noundef %25, float noundef %26, ptr noundef %27)
  store i32 2, ptr @opwd, align 4, !tbaa !14
  br label %28

28:                                               ; preds = %23, %20
  %29 = load i32, ptr @part, align 4, !tbaa !14
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %56

31:                                               ; preds = %28
  %32 = load i32, ptr %4, align 4, !tbaa !14
  %33 = load float, ptr @aval, align 4, !tbaa !16
  %34 = load float, ptr @bval, align 4, !tbaa !16
  %35 = load float, ptr @cval, align 4, !tbaa !16
  %36 = load float, ptr @dval, align 4, !tbaa !16
  %37 = load float, ptr @eval, align 4, !tbaa !16
  %38 = load float, ptr @fval, align 4, !tbaa !16
  %39 = load float, ptr @gval, align 4, !tbaa !16
  %40 = load float, ptr @hval, align 4, !tbaa !16
  %41 = load float, ptr @jval, align 4, !tbaa !16
  %42 = load float, ptr @kval, align 4, !tbaa !16
  %43 = load float, ptr @lval, align 4, !tbaa !16
  %44 = load float, ptr @mval, align 4, !tbaa !16
  %45 = load float, ptr @oval, align 4, !tbaa !16
  %46 = load float, ptr @pval, align 4, !tbaa !16
  %47 = load float, ptr @qval, align 4, !tbaa !16
  %48 = load float, ptr @rval, align 4, !tbaa !16
  %49 = load float, ptr @sval, align 4, !tbaa !16
  %50 = load float, ptr @tval, align 4, !tbaa !16
  %51 = load float, ptr @uval, align 4, !tbaa !16
  %52 = load float, ptr @vval, align 4, !tbaa !16
  %53 = load float, ptr @wval, align 4, !tbaa !16
  %54 = load float, ptr @yval, align 4, !tbaa !16
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  call void @triadplus2(i32 noundef %32, float noundef %33, float noundef %34, float noundef %35, float noundef %36, float noundef %37, float noundef %38, float noundef %39, float noundef %40, float noundef %41, float noundef %42, float noundef %43, float noundef %44, float noundef %45, float noundef %46, float noundef %47, float noundef %48, float noundef %49, float noundef %50, float noundef %51, float noundef %52, float noundef %53, float noundef %54, ptr noundef %55)
  store i32 32, ptr @opwd, align 4, !tbaa !14
  br label %56

56:                                               ; preds = %31, %28
  br label %57

57:                                               ; preds = %56
  %58 = load i32, ptr %3, align 4, !tbaa !14
  %59 = add nsw i32 %58, 1
  store i32 %59, ptr %3, align 4, !tbaa !14
  br label %16, !llvm.loop !18

60:                                               ; preds = %16
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret ptr null
}

attributes #0 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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, !13, i64 8}
!12 = !{!"", !6, i64 0, !13, i64 8}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !6, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"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"

%struct.MYCALCS = type { ptr, i32 }

@xval = external dso_local local_unnamed_addr global float, align 4
@aval = external dso_local local_unnamed_addr global float, align 4
@bval = external dso_local local_unnamed_addr global float, align 4
@cval = external dso_local local_unnamed_addr global float, align 4
@dval = external dso_local local_unnamed_addr global float, align 4
@eval = external dso_local local_unnamed_addr global float, align 4
@fval = external dso_local local_unnamed_addr global float, align 4
@gval = external dso_local local_unnamed_addr global float, align 4
@hval = external dso_local local_unnamed_addr global float, align 4
@jval = external dso_local local_unnamed_addr global float, align 4
@kval = external dso_local local_unnamed_addr global float, align 4
@lval = external dso_local local_unnamed_addr global float, align 4
@mval = external dso_local local_unnamed_addr global float, align 4
@oval = external dso_local local_unnamed_addr global float, align 4
@pval = external dso_local local_unnamed_addr global float, align 4
@qval = external dso_local local_unnamed_addr global float, align 4
@rval = external dso_local local_unnamed_addr global float, align 4
@sval = external dso_local local_unnamed_addr global float, align 4
@tval = external dso_local local_unnamed_addr global float, align 4
@uval = external dso_local local_unnamed_addr global float, align 4
@vval = external dso_local local_unnamed_addr global float, align 4
@wval = external dso_local local_unnamed_addr global float, align 4
@yval = external dso_local local_unnamed_addr global float, align 4
@xcalcs = external dso_local local_unnamed_addr global %struct.MYCALCS, align 8
@runrepeats = external dso_local local_unnamed_addr global i32, align 4
@part = external dso_local local_unnamed_addr global i32, align 4
@opwd = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: nounwind uwtable
declare dso_local void @triadplus2(i32 noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, float noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @triad(i32 noundef, float noundef, float noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @runTests(ptr noundef %0) local_unnamed_addr #0 {
  %2 = ptrtoint ptr %0 to i64
  %3 = load i32, ptr getelementptr inbounds (i8, ptr @xcalcs, i64 8), align 8, !tbaa !5
  %4 = load ptr, ptr @xcalcs, align 8, !tbaa !11
  %5 = sext i32 %3 to i64
  %6 = mul nsw i64 %5, %2
  %7 = getelementptr inbounds float, ptr %4, i64 %6
  %8 = load i32, ptr @runrepeats, align 4, !tbaa !12
  %9 = icmp sgt i32 %8, 0
  br i1 %9, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %1
  %.pre9 = load i32, ptr @part, align 4, !tbaa !12
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %41
  %10 = phi i32 [ %42, %41 ], [ %.pre9, %.lr.ph.preheader ]
  %.08 = phi i32 [ %43, %41 ], [ 0, %.lr.ph.preheader ]
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %15

12:                                               ; preds = %.lr.ph
  %13 = load float, ptr @aval, align 4, !tbaa !13
  %14 = load float, ptr @xval, align 4, !tbaa !13
  tail call void @triad(i32 noundef %3, float noundef %13, float noundef %14, ptr noundef %7)
  store i32 2, ptr @opwd, align 4, !tbaa !12
  %.pr = load i32, ptr @part, align 4, !tbaa !12
  br label %15

15:                                               ; preds = %12, %.lr.ph
  %16 = phi i32 [ %.pr, %12 ], [ %10, %.lr.ph ]
  %17 = icmp eq i32 %16, 1
  br i1 %17, label %18, label %41

18:                                               ; preds = %15
  %19 = load float, ptr @aval, align 4, !tbaa !13
  %20 = load float, ptr @bval, align 4, !tbaa !13
  %21 = load float, ptr @cval, align 4, !tbaa !13
  %22 = load float, ptr @dval, align 4, !tbaa !13
  %23 = load float, ptr @eval, align 4, !tbaa !13
  %24 = load float, ptr @fval, align 4, !tbaa !13
  %25 = load float, ptr @gval, align 4, !tbaa !13
  %26 = load float, ptr @hval, align 4, !tbaa !13
  %27 = load float, ptr @jval, align 4, !tbaa !13
  %28 = load float, ptr @kval, align 4, !tbaa !13
  %29 = load float, ptr @lval, align 4, !tbaa !13
  %30 = load float, ptr @mval, align 4, !tbaa !13
  %31 = load float, ptr @oval, align 4, !tbaa !13
  %32 = load float, ptr @pval, align 4, !tbaa !13
  %33 = load float, ptr @qval, align 4, !tbaa !13
  %34 = load float, ptr @rval, align 4, !tbaa !13
  %35 = load float, ptr @sval, align 4, !tbaa !13
  %36 = load float, ptr @tval, align 4, !tbaa !13
  %37 = load float, ptr @uval, align 4, !tbaa !13
  %38 = load float, ptr @vval, align 4, !tbaa !13
  %39 = load float, ptr @wval, align 4, !tbaa !13
  %40 = load float, ptr @yval, align 4, !tbaa !13
  tail call void @triadplus2(i32 noundef %3, float noundef %19, float noundef %20, float noundef %21, float noundef %22, float noundef %23, float noundef %24, float noundef %25, float noundef %26, float noundef %27, float noundef %28, float noundef %29, float noundef %30, float noundef %31, float noundef %32, float noundef %33, float noundef %34, float noundef %35, float noundef %36, float noundef %37, float noundef %38, float noundef %39, float noundef %40, ptr noundef %7)
  store i32 32, ptr @opwd, align 4, !tbaa !12
  %.pre = load i32, ptr @part, align 4, !tbaa !12
  br label %41

41:                                               ; preds = %15, %18
  %42 = phi i32 [ %16, %15 ], [ %.pre, %18 ]
  %43 = add nuw nsw i32 %.08, 1
  %44 = load i32, ptr @runrepeats, align 4, !tbaa !12
  %45 = icmp slt i32 %43, %44
  br i1 %45, label %.lr.ph, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %41, %1
  ret ptr null
}

attributes #0 = { 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" }

!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, !10, i64 8}
!6 = !{!"", !7, i64 0, !10, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!10, !10, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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