; LLVM IR from sourceryinstitute/MORFEUS-Source :: src/FV/src/mesh_optimize/OptMS (SMfunc3d)

; 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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #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
define dso_local double @dComputeTetJacobian(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #3
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds double, ptr %25, i64 0
  %27 = load double, ptr %26, align 8, !tbaa !9
  store double %27, ptr %13, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds double, ptr %28, i64 1
  %30 = load double, ptr %29, align 8, !tbaa !9
  store double %30, ptr %17, align 8, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds double, ptr %31, i64 2
  %33 = load double, ptr %32, align 8, !tbaa !9
  store double %33, ptr %21, align 8, !tbaa !9
  %34 = load ptr, ptr %6, align 8, !tbaa !5
  %35 = getelementptr inbounds double, ptr %34, i64 0
  %36 = load double, ptr %35, align 8, !tbaa !9
  store double %36, ptr %14, align 8, !tbaa !9
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds double, ptr %37, i64 1
  %39 = load double, ptr %38, align 8, !tbaa !9
  store double %39, ptr %18, align 8, !tbaa !9
  %40 = load ptr, ptr %6, align 8, !tbaa !5
  %41 = getelementptr inbounds double, ptr %40, i64 2
  %42 = load double, ptr %41, align 8, !tbaa !9
  store double %42, ptr %22, align 8, !tbaa !9
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = getelementptr inbounds double, ptr %43, i64 0
  %45 = load double, ptr %44, align 8, !tbaa !9
  store double %45, ptr %15, align 8, !tbaa !9
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds double, ptr %46, i64 1
  %48 = load double, ptr %47, align 8, !tbaa !9
  store double %48, ptr %19, align 8, !tbaa !9
  %49 = load ptr, ptr %7, align 8, !tbaa !5
  %50 = getelementptr inbounds double, ptr %49, i64 2
  %51 = load double, ptr %50, align 8, !tbaa !9
  store double %51, ptr %23, align 8, !tbaa !9
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds double, ptr %52, i64 0
  %54 = load double, ptr %53, align 8, !tbaa !9
  store double %54, ptr %16, align 8, !tbaa !9
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds double, ptr %55, i64 1
  %57 = load double, ptr %56, align 8, !tbaa !9
  store double %57, ptr %20, align 8, !tbaa !9
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds double, ptr %58, i64 2
  %60 = load double, ptr %59, align 8, !tbaa !9
  store double %60, ptr %24, align 8, !tbaa !9
  %61 = load double, ptr %14, align 8, !tbaa !9
  %62 = load double, ptr %19, align 8, !tbaa !9
  %63 = load double, ptr %24, align 8, !tbaa !9
  %64 = load double, ptr %23, align 8, !tbaa !9
  %65 = load double, ptr %20, align 8, !tbaa !9
  %66 = fmul double %64, %65
  %67 = fneg double %66
  %68 = call double @llvm.fmuladd.f64(double %62, double %63, double %67)
  %69 = load double, ptr %15, align 8, !tbaa !9
  %70 = load double, ptr %18, align 8, !tbaa !9
  %71 = load double, ptr %24, align 8, !tbaa !9
  %72 = load double, ptr %20, align 8, !tbaa !9
  %73 = load double, ptr %22, align 8, !tbaa !9
  %74 = fmul double %72, %73
  %75 = fneg double %74
  %76 = call double @llvm.fmuladd.f64(double %70, double %71, double %75)
  %77 = fmul double %69, %76
  %78 = fneg double %77
  %79 = call double @llvm.fmuladd.f64(double %61, double %68, double %78)
  %80 = load double, ptr %16, align 8, !tbaa !9
  %81 = load double, ptr %18, align 8, !tbaa !9
  %82 = load double, ptr %23, align 8, !tbaa !9
  %83 = load double, ptr %22, align 8, !tbaa !9
  %84 = load double, ptr %19, align 8, !tbaa !9
  %85 = fmul double %83, %84
  %86 = fneg double %85
  %87 = call double @llvm.fmuladd.f64(double %81, double %82, double %86)
  %88 = call double @llvm.fmuladd.f64(double %80, double %87, double %79)
  store double %88, ptr %9, align 8, !tbaa !9
  %89 = load double, ptr %19, align 8, !tbaa !9
  %90 = load double, ptr %24, align 8, !tbaa !9
  %91 = load double, ptr %23, align 8, !tbaa !9
  %92 = load double, ptr %20, align 8, !tbaa !9
  %93 = fmul double %91, %92
  %94 = fneg double %93
  %95 = call double @llvm.fmuladd.f64(double %89, double %90, double %94)
  %96 = load double, ptr %18, align 8, !tbaa !9
  %97 = load double, ptr %24, align 8, !tbaa !9
  %98 = load double, ptr %20, align 8, !tbaa !9
  %99 = load double, ptr %22, align 8, !tbaa !9
  %100 = fmul double %98, %99
  %101 = fneg double %100
  %102 = call double @llvm.fmuladd.f64(double %96, double %97, double %101)
  %103 = fsub double %95, %102
  %104 = load double, ptr %18, align 8, !tbaa !9
  %105 = load double, ptr %23, align 8, !tbaa !9
  %106 = load double, ptr %19, align 8, !tbaa !9
  %107 = load double, ptr %22, align 8, !tbaa !9
  %108 = fmul double %106, %107
  %109 = fneg double %108
  %110 = call double @llvm.fmuladd.f64(double %104, double %105, double %109)
  %111 = fadd double %103, %110
  store double %111, ptr %10, align 8, !tbaa !9
  %112 = load double, ptr %14, align 8, !tbaa !9
  %113 = load double, ptr %24, align 8, !tbaa !9
  %114 = load double, ptr %23, align 8, !tbaa !9
  %115 = fsub double %113, %114
  %116 = load double, ptr %15, align 8, !tbaa !9
  %117 = load double, ptr %24, align 8, !tbaa !9
  %118 = load double, ptr %22, align 8, !tbaa !9
  %119 = fsub double %117, %118
  %120 = fmul double %116, %119
  %121 = fneg double %120
  %122 = call double @llvm.fmuladd.f64(double %112, double %115, double %121)
  %123 = load double, ptr %16, align 8, !tbaa !9
  %124 = load double, ptr %23, align 8, !tbaa !9
  %125 = load double, ptr %22, align 8, !tbaa !9
  %126 = fsub double %124, %125
  %127 = call double @llvm.fmuladd.f64(double %123, double %126, double %122)
  store double %127, ptr %11, align 8, !tbaa !9
  %128 = load double, ptr %14, align 8, !tbaa !9
  %129 = load double, ptr %19, align 8, !tbaa !9
  %130 = load double, ptr %20, align 8, !tbaa !9
  %131 = fsub double %129, %130
  %132 = load double, ptr %15, align 8, !tbaa !9
  %133 = load double, ptr %18, align 8, !tbaa !9
  %134 = load double, ptr %20, align 8, !tbaa !9
  %135 = fsub double %133, %134
  %136 = fmul double %132, %135
  %137 = fneg double %136
  %138 = call double @llvm.fmuladd.f64(double %128, double %131, double %137)
  %139 = load double, ptr %16, align 8, !tbaa !9
  %140 = load double, ptr %18, align 8, !tbaa !9
  %141 = load double, ptr %19, align 8, !tbaa !9
  %142 = fsub double %140, %141
  %143 = call double @llvm.fmuladd.f64(double %139, double %142, double %138)
  store double %143, ptr %12, align 8, !tbaa !9
  %144 = load double, ptr %9, align 8, !tbaa !9
  %145 = load double, ptr %10, align 8, !tbaa !9
  %146 = load double, ptr %13, align 8, !tbaa !9
  %147 = fneg double %145
  %148 = call double @llvm.fmuladd.f64(double %147, double %146, double %144)
  %149 = load double, ptr %11, align 8, !tbaa !9
  %150 = load double, ptr %17, align 8, !tbaa !9
  %151 = fneg double %149
  %152 = call double @llvm.fmuladd.f64(double %151, double %150, double %148)
  %153 = load double, ptr %12, align 8, !tbaa !9
  %154 = load double, ptr %21, align 8, !tbaa !9
  %155 = fneg double %153
  %156 = call double @llvm.fmuladd.f64(double %155, double %154, double %152)
  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 8, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret double %156
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"double", !7, i64 0}


; 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 nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local double @dComputeTetJacobian(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3) local_unnamed_addr #1 {
  %5 = load double, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load double, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = load double, ptr %1, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load double, ptr %11, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = load double, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %2, i64 8
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %2, i64 16
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = load double, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %3, i64 8
  %22 = load double, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %3, i64 16
  %24 = load double, ptr %23, align 8, !tbaa !5
  %25 = insertelement <2 x double> poison, double %19, i64 0
  %26 = insertelement <2 x double> %25, double %22, i64 1
  %27 = fneg <2 x double> %26
  %28 = insertelement <2 x double> poison, double %22, i64 0
  %29 = insertelement <2 x double> %28, double %14, i64 1
  %30 = fmul <2 x double> %29, %27
  %31 = insertelement <2 x double> poison, double %17, i64 0
  %32 = insertelement <2 x double> %31, double %12, i64 1
  %33 = insertelement <2 x double> poison, double %24, i64 0
  %34 = shufflevector <2 x double> %33, <2 x double> poison, <2 x i32> zeroinitializer
  %35 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %32, <2 x double> %34, <2 x double> %30)
  %36 = fneg double %15
  %37 = extractelement <2 x double> %35, i64 1
  %38 = fmul double %37, %36
  %39 = extractelement <2 x double> %35, i64 0
  %40 = tail call double @llvm.fmuladd.f64(double %10, double %39, double %38)
  %41 = fneg double %14
  %42 = fmul double %17, %41
  %43 = tail call double @llvm.fmuladd.f64(double %12, double %19, double %42)
  %44 = tail call double @llvm.fmuladd.f64(double %20, double %43, double %40)
  %45 = fsub double %39, %37
  %46 = fadd double %43, %45
  %47 = fsub double %24, %19
  %48 = fsub double %24, %14
  %49 = fmul double %48, %36
  %50 = tail call double @llvm.fmuladd.f64(double %10, double %47, double %49)
  %51 = fsub double %19, %14
  %52 = tail call double @llvm.fmuladd.f64(double %20, double %51, double %50)
  %53 = fsub double %17, %22
  %54 = fsub double %12, %22
  %55 = fmul double %54, %36
  %56 = tail call double @llvm.fmuladd.f64(double %10, double %53, double %55)
  %57 = fsub double %12, %17
  %58 = tail call double @llvm.fmuladd.f64(double %20, double %57, double %56)
  %59 = fneg double %46
  %60 = tail call double @llvm.fmuladd.f64(double %59, double %5, double %44)
  %61 = fneg double %52
  %62 = tail call double @llvm.fmuladd.f64(double %61, double %7, double %60)
  %63 = fneg double %58
  %64 = tail call double @llvm.fmuladd.f64(double %63, double %9, double %62)
  ret double %64
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) 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 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass