; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_quaternion)

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

attributes #0 = { 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 #1 = { mustprogress 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,SROAPass,TailCallElimPass