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

; 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 willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.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: nounwind uwtable
define dso_local double @Mat3d_determinant(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds [3 x double], ptr %4, i64 0
  %6 = getelementptr inbounds [3 x double], ptr %5, i64 0, i64 0
  %7 = load double, ptr %6, align 8, !tbaa !9
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds [3 x double], ptr %8, i64 1
  %10 = getelementptr inbounds [3 x double], ptr %9, i64 0, i64 1
  %11 = load double, ptr %10, align 8, !tbaa !9
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds [3 x double], ptr %12, i64 2
  %14 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 2
  %15 = load double, ptr %14, align 8, !tbaa !9
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds [3 x double], ptr %16, i64 2
  %18 = getelementptr inbounds [3 x double], ptr %17, i64 0, i64 1
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds [3 x double], ptr %20, i64 1
  %22 = getelementptr inbounds [3 x double], ptr %21, i64 0, i64 2
  %23 = load double, ptr %22, align 8, !tbaa !9
  %24 = fmul double %19, %23
  %25 = fneg double %24
  %26 = call double @llvm.fmuladd.f64(double %11, double %15, double %25)
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds [3 x double], ptr %27, i64 0
  %29 = getelementptr inbounds [3 x double], ptr %28, i64 0, i64 1
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds [3 x double], ptr %31, i64 1
  %33 = getelementptr inbounds [3 x double], ptr %32, i64 0, i64 0
  %34 = load double, ptr %33, align 8, !tbaa !9
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds [3 x double], ptr %35, i64 2
  %37 = getelementptr inbounds [3 x double], ptr %36, i64 0, i64 2
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds [3 x double], ptr %39, i64 1
  %41 = getelementptr inbounds [3 x double], ptr %40, i64 0, i64 2
  %42 = load double, ptr %41, align 8, !tbaa !9
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds [3 x double], ptr %43, i64 2
  %45 = getelementptr inbounds [3 x double], ptr %44, i64 0, i64 0
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = fmul double %42, %46
  %48 = fneg double %47
  %49 = call double @llvm.fmuladd.f64(double %34, double %38, double %48)
  %50 = fmul double %30, %49
  %51 = fneg double %50
  %52 = call double @llvm.fmuladd.f64(double %7, double %26, double %51)
  %53 = load ptr, ptr %2, align 8, !tbaa !5
  %54 = getelementptr inbounds [3 x double], ptr %53, i64 0
  %55 = getelementptr inbounds [3 x double], ptr %54, i64 0, i64 2
  %56 = load double, ptr %55, align 8, !tbaa !9
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds [3 x double], ptr %57, i64 1
  %59 = getelementptr inbounds [3 x double], ptr %58, i64 0, i64 0
  %60 = load double, ptr %59, align 8, !tbaa !9
  %61 = load ptr, ptr %2, align 8, !tbaa !5
  %62 = getelementptr inbounds [3 x double], ptr %61, i64 2
  %63 = getelementptr inbounds [3 x double], ptr %62, i64 0, i64 1
  %64 = load double, ptr %63, align 8, !tbaa !9
  %65 = load ptr, ptr %2, align 8, !tbaa !5
  %66 = getelementptr inbounds [3 x double], ptr %65, i64 1
  %67 = getelementptr inbounds [3 x double], ptr %66, i64 0, i64 1
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds [3 x double], ptr %69, i64 2
  %71 = getelementptr inbounds [3 x double], ptr %70, i64 0, i64 0
  %72 = load double, ptr %71, align 8, !tbaa !9
  %73 = fmul double %68, %72
  %74 = fneg double %73
  %75 = call double @llvm.fmuladd.f64(double %60, double %64, double %74)
  %76 = call double @llvm.fmuladd.f64(double %56, double %75, double %52)
  store double %76, ptr %3, align 8, !tbaa !9
  %77 = load double, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret double %77
}

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}


; 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 @Mat3d_determinant(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = load double, ptr %0, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 24
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = load double, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 48
  %7 = getelementptr inbounds i8, ptr %0, i64 64
  %8 = load double, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 40
  %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 %5, double %8, double %14)
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = load double, ptr %3, align 8, !tbaa !5
  %19 = load double, ptr %6, align 8, !tbaa !5
  %20 = fneg double %12
  %21 = fmul double %19, %20
  %22 = tail call double @llvm.fmuladd.f64(double %18, double %8, double %21)
  %23 = fneg double %17
  %24 = fmul double %22, %23
  %25 = tail call double @llvm.fmuladd.f64(double %2, double %15, double %24)
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = load double, ptr %26, align 8, !tbaa !5
  %28 = fneg double %5
  %29 = fmul double %19, %28
  %30 = tail call double @llvm.fmuladd.f64(double %18, double %10, double %29)
  %31 = tail call double @llvm.fmuladd.f64(double %27, double %30, double %25)
  ret double %31
}

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

!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