; LLVM IR from moarseniy/CudaFEMproject :: FEMproject/matrix_pack/src/cpu_matrix.ll (Z6det3x3Pf)

; 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 float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef float @_Z6det3x3Pf(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds float, ptr %3, i64 0
  %5 = load float, ptr %4, align 4, !tbaa !9
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds float, ptr %6, i64 4
  %8 = load float, ptr %7, align 4, !tbaa !9
  %9 = fmul float %5, %8
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds float, ptr %10, i64 8
  %12 = load float, ptr %11, align 4, !tbaa !9
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds float, ptr %13, i64 1
  %15 = load float, ptr %14, align 4, !tbaa !9
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = getelementptr inbounds float, ptr %16, i64 6
  %18 = load float, ptr %17, align 4, !tbaa !9
  %19 = fmul float %15, %18
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds float, ptr %20, i64 5
  %22 = load float, ptr %21, align 4, !tbaa !9
  %23 = fmul float %19, %22
  %24 = call float @llvm.fmuladd.f32(float %9, float %12, float %23)
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds float, ptr %25, i64 2
  %27 = load float, ptr %26, align 4, !tbaa !9
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  %29 = getelementptr inbounds float, ptr %28, i64 3
  %30 = load float, ptr %29, align 4, !tbaa !9
  %31 = fmul float %27, %30
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds float, ptr %32, i64 7
  %34 = load float, ptr %33, align 4, !tbaa !9
  %35 = call float @llvm.fmuladd.f32(float %31, float %34, float %24)
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds float, ptr %36, i64 6
  %38 = load float, ptr %37, align 4, !tbaa !9
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds float, ptr %39, i64 4
  %41 = load float, ptr %40, align 4, !tbaa !9
  %42 = fmul float %38, %41
  %43 = load ptr, ptr %2, align 8, !tbaa !5
  %44 = getelementptr inbounds float, ptr %43, i64 2
  %45 = load float, ptr %44, align 4, !tbaa !9
  %46 = fneg float %42
  %47 = call float @llvm.fmuladd.f32(float %46, float %45, float %35)
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds float, ptr %48, i64 0
  %50 = load float, ptr %49, align 4, !tbaa !9
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds float, ptr %51, i64 5
  %53 = load float, ptr %52, align 4, !tbaa !9
  %54 = fmul float %50, %53
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds float, ptr %55, i64 7
  %57 = load float, ptr %56, align 4, !tbaa !9
  %58 = fneg float %54
  %59 = call float @llvm.fmuladd.f32(float %58, float %57, float %47)
  %60 = load ptr, ptr %2, align 8, !tbaa !5
  %61 = getelementptr inbounds float, ptr %60, i64 1
  %62 = load float, ptr %61, align 4, !tbaa !9
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = getelementptr inbounds float, ptr %63, i64 3
  %65 = load float, ptr %64, align 4, !tbaa !9
  %66 = fmul float %62, %65
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds float, ptr %67, i64 8
  %69 = load float, ptr %68, align 4, !tbaa !9
  %70 = fneg float %66
  %71 = call float @llvm.fmuladd.f32(float %70, float %69, float %59)
  ret float %71
}

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { mustprogress 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" }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"float", !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 float @llvm.fmuladd.f32(float, float, float) #0

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: read) uwtable
define dso_local noundef float @_Z6det3x3Pf(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = load float, ptr %0, align 4, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = load float, ptr %3, align 4, !tbaa !5
  %5 = fmul float %2, %4
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load float, ptr %6, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 4
  %9 = load float, ptr %8, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = fmul float %9, %11
  %13 = getelementptr inbounds i8, ptr %0, i64 20
  %14 = load float, ptr %13, align 4, !tbaa !5
  %15 = fmul float %12, %14
  %16 = tail call float @llvm.fmuladd.f32(float %5, float %7, float %15)
  %17 = getelementptr inbounds i8, ptr %0, i64 8
  %18 = load float, ptr %17, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %0, i64 12
  %20 = load float, ptr %19, align 4, !tbaa !5
  %21 = fmul float %18, %20
  %22 = getelementptr inbounds i8, ptr %0, i64 28
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = tail call float @llvm.fmuladd.f32(float %21, float %23, float %16)
  %25 = fneg float %11
  %26 = fmul float %4, %25
  %27 = tail call float @llvm.fmuladd.f32(float %26, float %18, float %24)
  %28 = fneg float %2
  %29 = fmul float %14, %28
  %30 = tail call float @llvm.fmuladd.f32(float %29, float %23, float %27)
  %31 = fneg float %9
  %32 = fmul float %20, %31
  %33 = tail call float @llvm.fmuladd.f32(float %32, float %7, float %30)
  ret float %33
}

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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,TailCallElimPass