; LLVM IR from aferikoglou/GenHLSOptimizer :: dataset/rodinia-hotspot-0-baseline (hotspot)

; 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: mustprogress nounwind uwtable
declare dso_local void @hotspot(ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef, float noundef, float 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: mustprogress nounwind uwtable
define dso_local void @workload(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %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 i32, 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
  store float 0x3F00624DE0000000, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #2
  store float 0x3F00624DE0000000, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #2
  %20 = load float, ptr %8, align 4, !tbaa !9
  %21 = fpext float %20 to double
  %22 = fmul double 4.375000e+02, %21
  %23 = load float, ptr %7, align 4, !tbaa !9
  %24 = fpext float %23 to double
  %25 = fmul double %22, %24
  %26 = fptrunc double %25 to float
  store float %26, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #2
  %27 = load float, ptr %8, align 4, !tbaa !9
  %28 = fpext float %27 to double
  %29 = load float, ptr %7, align 4, !tbaa !9
  %30 = fpext float %29 to double
  %31 = fmul double 1.000000e-01, %30
  %32 = fdiv double %28, %31
  %33 = fptrunc double %32 to float
  store float %33, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #2
  %34 = load float, ptr %7, align 4, !tbaa !9
  %35 = fpext float %34 to double
  %36 = load float, ptr %8, align 4, !tbaa !9
  %37 = fpext float %36 to double
  %38 = fmul double 1.000000e-01, %37
  %39 = fdiv double %35, %38
  %40 = fptrunc double %39 to float
  store float %40, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #2
  %41 = load float, ptr %7, align 4, !tbaa !9
  %42 = fmul float 1.000000e+02, %41
  %43 = load float, ptr %8, align 4, !tbaa !9
  %44 = fmul float %42, %43
  %45 = fpext float %44 to double
  %46 = fdiv double 5.000000e-04, %45
  %47 = fptrunc double %46 to float
  store float %47, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #2
  store float 0x4051249240000000, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #2
  %48 = load float, ptr %13, align 4, !tbaa !9
  %49 = fpext float %48 to double
  %50 = fdiv double 1.000000e-03, %49
  %51 = fdiv double %50, 1.000000e+03
  %52 = fptrunc double %51 to float
  store float %52, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #2
  %53 = load float, ptr %10, align 4, !tbaa !9
  %54 = fdiv float 1.000000e+00, %53
  store float %54, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #2
  %55 = load float, ptr %11, align 4, !tbaa !9
  %56 = fdiv float 1.000000e+00, %55
  store float %56, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #2
  %57 = load float, ptr %12, align 4, !tbaa !9
  %58 = fdiv float 1.000000e+00, %57
  store float %58, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #2
  %59 = load float, ptr %14, align 4, !tbaa !9
  %60 = load float, ptr %9, align 4, !tbaa !9
  %61 = fdiv float %59, %60
  store float %61, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #2
  br label %62

62:                                               ; preds = %3
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %63

63:                                               ; preds = %81, %62
  %64 = load i32, ptr %19, align 4, !tbaa !11
  %65 = icmp slt i32 %64, 32
  br i1 %65, label %66, label %84

66:                                               ; preds = %63
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load float, ptr %18, align 4, !tbaa !9
  %71 = load float, ptr %15, align 4, !tbaa !9
  %72 = load float, ptr %16, align 4, !tbaa !9
  %73 = load float, ptr %17, align 4, !tbaa !9
  call void @hotspot(ptr noundef %67, ptr noundef %68, ptr noundef %69, float noundef %70, float noundef %71, float noundef %72, float noundef %73)
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = load float, ptr %18, align 4, !tbaa !9
  %78 = load float, ptr %15, align 4, !tbaa !9
  %79 = load float, ptr %16, align 4, !tbaa !9
  %80 = load float, ptr %17, align 4, !tbaa !9
  call void @hotspot(ptr noundef %74, ptr noundef %75, ptr noundef %76, float noundef %77, float noundef %78, float noundef %79, float noundef %80)
  br label %81

81:                                               ; preds = %66
  %82 = load i32, ptr %19, align 4, !tbaa !11
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %19, align 4, !tbaa !11
  br label %63, !llvm.loop !13

84:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #2
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #2
  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 = { mustprogress 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++ 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 nounwind uwtable
declare dso_local void @hotspot(ptr noundef, ptr noundef, ptr noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @workload(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  br label %4

4:                                                ; preds = %3, %4
  %.029 = phi i32 [ 0, %3 ], [ %5, %4 ]
  tail call void @hotspot(ptr noundef %0, ptr noundef %1, ptr noundef %2, float noundef 0x3FA179EC80000000, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000, float noundef 0x3F299999A0000000)
  tail call void @hotspot(ptr noundef %1, ptr noundef %0, ptr noundef %2, float noundef 0x3FA179EC80000000, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000, float noundef 0x3F299999A0000000)
  %5 = add nuw nsw i32 %.029, 1
  %exitcond.not = icmp eq i32 %5, 32
  br i1 %exitcond.not, label %6, label %4, !llvm.loop !5

6:                                                ; preds = %4
  ret void
}

attributes #0 = { mustprogress 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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