; 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: nounwind
declare double @sqrt(double noundef) #1

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

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

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

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nounwind "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 willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !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: readwrite) uwtable
define dso_local noundef i32 @SMcreateWeightedJacobian(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef writeonly %4, ptr nocapture noundef writeonly %5, ptr nocapture noundef writeonly %6) local_unnamed_addr #1 {
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %3, i64 16
  %11 = load double, ptr %10, align 8, !tbaa !5
  %12 = fsub double %9, %11
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load double, ptr %13, align 8, !tbaa !5
  %15 = fsub double %14, %11
  %16 = getelementptr inbounds i8, ptr %2, i64 16
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = fsub double %17, %11
  %19 = load <2 x double>, ptr %0, align 8, !tbaa !5
  %20 = load <2 x double>, ptr %3, align 8, !tbaa !5
  %21 = fsub <2 x double> %19, %20
  %22 = getelementptr inbounds i8, ptr %4, i64 16
  %23 = load <2 x double>, ptr %1, align 8, !tbaa !5
  %24 = fsub <2 x double> %23, %20
  %25 = fneg <2 x double> %21
  %26 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %24, <2 x double> <double 2.000000e+00, double 2.000000e+00>, <2 x double> %25)
  %27 = fmul <2 x double> %26, <double 0x3FE279A74590331D, double 0x3FE279A74590331D>
  %28 = fneg double %12
  %29 = tail call double @llvm.fmuladd.f64(double %15, double 2.000000e+00, double %28)
  %30 = fmul double %29, 0x3FE279A74590331D
  %31 = getelementptr inbounds i8, ptr %5, i64 16
  %32 = load <2 x double>, ptr %2, align 8, !tbaa !5
  %33 = fsub <2 x double> %32, %20
  store <2 x double> %21, ptr %4, align 8, !tbaa !5
  store double %12, ptr %22, align 8, !tbaa !5
  store <2 x double> %27, ptr %5, align 8, !tbaa !5
  store double %30, ptr %31, align 8, !tbaa !5
  %34 = fsub <2 x double> %25, %24
  %35 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %33, <2 x double> <double 3.000000e+00, double 3.000000e+00>, <2 x double> %34)
  %36 = fmul <2 x double> %35, <double 0x3FDA20BD700C2C3F, double 0x3FDA20BD700C2C3F>
  store <2 x double> %36, ptr %6, align 8, !tbaa !5
  %37 = fsub double %28, %15
  %38 = tail call double @llvm.fmuladd.f64(double %18, double 3.000000e+00, double %37)
  %39 = fmul double %38, 0x3FDA20BD700C2C3F
  %40 = getelementptr inbounds i8, ptr %6, i64 16
  store double %39, ptr %40, align 8, !tbaa !5
  ret i32 0
}

; 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: readwrite) 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,SLPVectorizerPass,SROAPass,TailCallElimPass