; LLVM IR from aferikoglou/GenHLSOptimizer :: dataset/rodinia_cfd_flux_1_tiling_0 (cfd_flux)

; 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 uwtable
declare dso_local void @cfd_flux(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @workload(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca [160 x float], align 16
  %18 = alloca [128 x float], align 16
  %19 = alloca [384 x float], align 16
  %20 = alloca [5120 x float], align 16
  %21 = alloca [3072 x float], align 16
  %22 = alloca [3072 x float], align 16
  %23 = alloca [3072 x float], align 16
  %24 = alloca [3072 x float], align 16
  %25 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store ptr %5, ptr %14, align 8, !tbaa !5
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  br label %26

26:                                               ; preds = %8
  call void @llvm.lifetime.start.p0(i64 640, ptr %17) #3
  br label %27

27:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 512, ptr %18) #3
  br label %28

28:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1536, ptr %19) #3
  br label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 20480, ptr %20) #3
  br label %30

30:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 12288, ptr %21) #3
  br label %31

31:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 12288, ptr %22) #3
  br label %32

32:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 12288, ptr %23) #3
  br label %33

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 12288, ptr %24) #3
  %34 = getelementptr inbounds [5120 x float], ptr %20, i64 0, i64 0
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %34, ptr align 4 %35, i64 20480, i1 false)
  %36 = getelementptr inbounds [3072 x float], ptr %21, i64 0, i64 0
  %37 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %36, ptr align 4 %37, i64 12288, i1 false)
  %38 = getelementptr inbounds [3072 x float], ptr %22, i64 0, i64 0
  %39 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %38, ptr align 4 %39, i64 12288, i1 false)
  %40 = getelementptr inbounds [3072 x float], ptr %23, i64 0, i64 0
  %41 = load ptr, ptr %15, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %40, ptr align 4 %41, i64 12288, i1 false)
  %42 = getelementptr inbounds [3072 x float], ptr %24, i64 0, i64 0
  %43 = load ptr, ptr %16, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %42, ptr align 4 %43, i64 12288, i1 false)
  br label %44

44:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #3
  br label %45

45:                                               ; preds = %80, %44
  %46 = load i32, ptr %25, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 32
  br i1 %47, label %49, label %48

48:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #3
  br label %83

49:                                               ; preds = %45
  %50 = getelementptr inbounds [128 x float], ptr %18, i64 0, i64 0
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = load i32, ptr %25, align 4, !tbaa !9
  %53 = mul nsw i32 %52, 32
  %54 = mul nsw i32 %53, 4
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds float, ptr %51, i64 %55
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %50, ptr align 4 %56, i64 512, i1 false)
  %57 = getelementptr inbounds [384 x float], ptr %19, i64 0, i64 0
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load i32, ptr %25, align 4, !tbaa !9
  %60 = mul nsw i32 %59, 32
  %61 = mul nsw i32 %60, 4
  %62 = mul nsw i32 %61, 3
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds float, ptr %58, i64 %63
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %57, ptr align 4 %64, i64 1536, i1 false)
  %65 = getelementptr inbounds [160 x float], ptr %17, i64 0, i64 0
  %66 = getelementptr inbounds [128 x float], ptr %18, i64 0, i64 0
  %67 = getelementptr inbounds [384 x float], ptr %19, i64 0, i64 0
  %68 = getelementptr inbounds [5120 x float], ptr %20, i64 0, i64 0
  %69 = getelementptr inbounds [3072 x float], ptr %21, i64 0, i64 0
  %70 = getelementptr inbounds [3072 x float], ptr %22, i64 0, i64 0
  %71 = getelementptr inbounds [3072 x float], ptr %23, i64 0, i64 0
  %72 = getelementptr inbounds [3072 x float], ptr %24, i64 0, i64 0
  call void @cfd_flux(ptr noundef %65, ptr noundef %66, ptr noundef %67, ptr noundef %68, ptr noundef %69, ptr noundef %70, ptr noundef %71, ptr noundef %72)
  %73 = load ptr, ptr %9, align 8, !tbaa !5
  %74 = load i32, ptr %25, align 4, !tbaa !9
  %75 = mul nsw i32 %74, 32
  %76 = mul nsw i32 %75, 5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds float, ptr %73, i64 %77
  %79 = getelementptr inbounds [160 x float], ptr %17, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %78, ptr align 16 %79, i64 640, i1 false)
  br label %80

80:                                               ; preds = %49
  %81 = load i32, ptr %25, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %25, align 4, !tbaa !9
  br label %45, !llvm.loop !11

83:                                               ; preds = %48
  call void @llvm.lifetime.end.p0(i64 12288, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 12288, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 12288, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 12288, ptr %21) #3
  call void @llvm.lifetime.end.p0(i64 20480, ptr %20) #3
  call void @llvm.lifetime.end.p0(i64 1536, ptr %19) #3
  call void @llvm.lifetime.end.p0(i64 512, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 640, ptr %17) #3
  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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"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 nofree norecurse nosync nounwind willreturn memory(none) uwtable
define dso_local void @workload(ptr nocapture noundef readnone %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6, ptr nocapture noundef readonly %7) local_unnamed_addr #0 {
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(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" }

!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: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass