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