; LLVM IR from aferikoglou/GenHLSOptimizer :: dataset/rodinia_lc_mgvf_0_baseline_0 (lc_mgvf)

; 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: mustprogress uwtable
declare dso_local float @lc_mgvf(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @workload(ptr noundef %0, ptr noundef %1, ptr noundef %2) #1 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca float, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #2
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  store float 1.000000e+00, ptr %8, align 4, !tbaa !9
  br label %9

9:                                                ; preds = %3
  store i32 0, ptr %7, align 4, !tbaa !11
  br label %10

10:                                               ; preds = %22, %9
  %11 = load i32, ptr %7, align 4, !tbaa !11
  %12 = icmp slt i32 %11, 32
  br i1 %12, label %13, label %25

13:                                               ; preds = %10
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = load ptr, ptr %6, align 8, !tbaa !5
  %17 = call float @lc_mgvf(ptr noundef %14, ptr noundef %15, ptr noundef %16)
  store float %17, ptr %8, align 4, !tbaa !9
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %6, align 8, !tbaa !5
  %21 = call float @lc_mgvf(ptr noundef %18, ptr noundef %19, ptr noundef %20)
  store float %21, ptr %8, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %13
  %23 = load i32, ptr %7, align 4, !tbaa !11
  %24 = add nsw i32 %23, 1
  store i32 %24, ptr %7, align 4, !tbaa !11
  br label %10, !llvm.loop !13

25:                                               ; preds = %10
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #2
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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 uwtable
declare dso_local float @lc_mgvf(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @workload(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %5 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %6 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %7 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %8 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %9 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %10 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %11 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %12 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %13 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %14 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %15 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %16 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %17 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %18 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %19 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %20 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %21 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %22 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %23 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %24 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %25 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %26 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %27 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %28 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %29 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %30 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %31 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %32 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %33 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %34 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %35 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %36 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %37 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %38 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %39 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %40 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %41 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %42 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %43 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %44 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %45 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %46 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %47 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %48 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %49 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %50 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %51 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %52 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %53 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %54 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %55 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %56 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %57 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %58 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %59 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %60 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %61 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %62 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %63 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %64 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %65 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  %66 = tail call float @lc_mgvf(ptr noundef %0, ptr noundef %1, ptr noundef %2)
  %67 = tail call float @lc_mgvf(ptr noundef %1, ptr noundef %0, ptr noundef %2)
  ret void
}

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


; Effective O3 passes: GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass