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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!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 @SMfrobenius_norm_squared_adj3x3(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #1 {
  %5 = getelementptr inbounds i8, ptr %0, i64 8
  %6 = load double, ptr %5, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %1, i64 16
  %8 = load double, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 8
  %12 = load double, ptr %11, align 8, !tbaa !5
  %13 = fneg double %10
  %14 = fmul double %12, %13
  %15 = tail call double @llvm.fmuladd.f64(double %6, double %8, double %14)
  %16 = load double, ptr %0, align 8, !tbaa !5
  %17 = load double, ptr %1, align 8, !tbaa !5
  %18 = fmul double %17, %13
  %19 = tail call double @llvm.fmuladd.f64(double %16, double %12, double %18)
  %20 = fneg double %6
  %21 = fmul double %17, %20
  %22 = tail call double @llvm.fmuladd.f64(double %16, double %12, double %21)
  %23 = fmul double %19, %19
  %24 = tail call double @llvm.fmuladd.f64(double %15, double %15, double %23)
  %25 = tail call double @llvm.fmuladd.f64(double %22, double %22, double %24)
  store double %25, ptr %3, align 8, !tbaa !5
  %26 = load double, ptr %11, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %2, i64 16
  %28 = load double, ptr %27, align 8, !tbaa !5
  %29 = load double, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %2, i64 8
  %31 = load double, ptr %30, align 8, !tbaa !5
  %32 = fneg double %29
  %33 = fmul double %31, %32
  %34 = tail call double @llvm.fmuladd.f64(double %26, double %28, double %33)
  %35 = load double, ptr %1, align 8, !tbaa !5
  %36 = load double, ptr %2, align 8, !tbaa !5
  %37 = fmul double %36, %32
  %38 = tail call double @llvm.fmuladd.f64(double %35, double %31, double %37)
  %39 = fneg double %26
  %40 = fmul double %36, %39
  %41 = tail call double @llvm.fmuladd.f64(double %35, double %31, double %40)
  %42 = fmul double %38, %38
  %43 = tail call double @llvm.fmuladd.f64(double %34, double %34, double %42)
  %44 = tail call double @llvm.fmuladd.f64(double %41, double %41, double %43)
  %45 = fadd double %25, %44
  store double %45, ptr %3, align 8, !tbaa !5
  %46 = load double, ptr %30, align 8, !tbaa !5
  %47 = load double, ptr %9, align 8, !tbaa !5
  %48 = load double, ptr %27, align 8, !tbaa !5
  %49 = load double, ptr %5, align 8, !tbaa !5
  %50 = fneg double %48
  %51 = fmul double %49, %50
  %52 = tail call double @llvm.fmuladd.f64(double %46, double %47, double %51)
  %53 = load double, ptr %2, align 8, !tbaa !5
  %54 = load double, ptr %0, align 8, !tbaa !5
  %55 = fmul double %54, %50
  %56 = tail call double @llvm.fmuladd.f64(double %53, double %49, double %55)
  %57 = fneg double %46
  %58 = fmul double %54, %57
  %59 = tail call double @llvm.fmuladd.f64(double %53, double %49, double %58)
  %60 = fmul double %56, %56
  %61 = tail call double @llvm.fmuladd.f64(double %52, double %52, double %60)
  %62 = tail call double @llvm.fmuladd.f64(double %59, double %59, double %61)
  %63 = fadd double %45, %62
  store double %63, ptr %3, align 8, !tbaa !5
  ret i32 0
}

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" }

!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,SROAPass,TailCallElimPass