; LLVM IR from Slingshot-Physics/slingshot-community :: common/math/src/attitudeutils.ll (Z13frd2NedMatrixfffR8Matrix33)

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13frd2NedMatrixfffR8Matrix33(float noundef %0, float noundef %1, float noundef %2, ptr noundef nonnull align 4 dereferenceable(36) %3) #3 {
  %5 = alloca float, align 4
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca ptr, align 8
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca float, align 4
  store float %0, ptr %5, align 4, !tbaa !5
  store float %1, ptr %6, align 4, !tbaa !5
  store float %2, ptr %7, align 4, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  %15 = load float, ptr %5, align 4, !tbaa !5
  %16 = call noundef float @_ZSt3sinf(float noundef %15)
  store float %16, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %17 = load float, ptr %5, align 4, !tbaa !5
  %18 = call noundef float @_ZSt3cosf(float noundef %17)
  store float %18, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %19 = load float, ptr %6, align 4, !tbaa !5
  %20 = call noundef float @_ZSt3sinf(float noundef %19)
  store float %20, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %21 = load float, ptr %6, align 4, !tbaa !5
  %22 = call noundef float @_ZSt3cosf(float noundef %21)
  store float %22, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %23 = load float, ptr %7, align 4, !tbaa !5
  %24 = call noundef float @_ZSt3sinf(float noundef %23)
  store float %24, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %25 = load float, ptr %7, align 4, !tbaa !5
  %26 = call noundef float @_ZSt3cosf(float noundef %25)
  store float %26, ptr %14, align 4, !tbaa !5
  %27 = load float, ptr %12, align 4, !tbaa !5
  %28 = load float, ptr %14, align 4, !tbaa !5
  %29 = fmul float %27, %28
  %30 = load ptr, ptr %8, align 8, !tbaa !9
  %31 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %30, i32 noundef 0, i32 noundef 0)
  store float %29, ptr %31, align 4, !tbaa !5
  %32 = load float, ptr %9, align 4, !tbaa !5
  %33 = load float, ptr %11, align 4, !tbaa !5
  %34 = fmul float %32, %33
  %35 = load float, ptr %14, align 4, !tbaa !5
  %36 = load float, ptr %10, align 4, !tbaa !5
  %37 = load float, ptr %13, align 4, !tbaa !5
  %38 = fmul float %36, %37
  %39 = fneg float %38
  %40 = call float @llvm.fmuladd.f32(float %34, float %35, float %39)
  %41 = load ptr, ptr %8, align 8, !tbaa !9
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %41, i32 noundef 0, i32 noundef 1)
  store float %40, ptr %42, align 4, !tbaa !5
  %43 = load float, ptr %10, align 4, !tbaa !5
  %44 = load float, ptr %11, align 4, !tbaa !5
  %45 = fmul float %43, %44
  %46 = load float, ptr %14, align 4, !tbaa !5
  %47 = load float, ptr %9, align 4, !tbaa !5
  %48 = load float, ptr %13, align 4, !tbaa !5
  %49 = fmul float %47, %48
  %50 = call float @llvm.fmuladd.f32(float %45, float %46, float %49)
  %51 = load ptr, ptr %8, align 8, !tbaa !9
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %51, i32 noundef 0, i32 noundef 2)
  store float %50, ptr %52, align 4, !tbaa !5
  %53 = load float, ptr %12, align 4, !tbaa !5
  %54 = load float, ptr %13, align 4, !tbaa !5
  %55 = fmul float %53, %54
  %56 = load ptr, ptr %8, align 8, !tbaa !9
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %56, i32 noundef 1, i32 noundef 0)
  store float %55, ptr %57, align 4, !tbaa !5
  %58 = load float, ptr %9, align 4, !tbaa !5
  %59 = load float, ptr %11, align 4, !tbaa !5
  %60 = fmul float %58, %59
  %61 = load float, ptr %13, align 4, !tbaa !5
  %62 = load float, ptr %10, align 4, !tbaa !5
  %63 = load float, ptr %14, align 4, !tbaa !5
  %64 = fmul float %62, %63
  %65 = call float @llvm.fmuladd.f32(float %60, float %61, float %64)
  %66 = load ptr, ptr %8, align 8, !tbaa !9
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %66, i32 noundef 1, i32 noundef 1)
  store float %65, ptr %67, align 4, !tbaa !5
  %68 = load float, ptr %10, align 4, !tbaa !5
  %69 = load float, ptr %11, align 4, !tbaa !5
  %70 = fmul float %68, %69
  %71 = load float, ptr %13, align 4, !tbaa !5
  %72 = load float, ptr %9, align 4, !tbaa !5
  %73 = load float, ptr %14, align 4, !tbaa !5
  %74 = fmul float %72, %73
  %75 = fneg float %74
  %76 = call float @llvm.fmuladd.f32(float %70, float %71, float %75)
  %77 = load ptr, ptr %8, align 8, !tbaa !9
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %77, i32 noundef 1, i32 noundef 2)
  store float %76, ptr %78, align 4, !tbaa !5
  %79 = load float, ptr %11, align 4, !tbaa !5
  %80 = fmul float -1.000000e+00, %79
  %81 = load ptr, ptr %8, align 8, !tbaa !9
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %81, i32 noundef 2, i32 noundef 0)
  store float %80, ptr %82, align 4, !tbaa !5
  %83 = load float, ptr %9, align 4, !tbaa !5
  %84 = load float, ptr %12, align 4, !tbaa !5
  %85 = fmul float %83, %84
  %86 = load ptr, ptr %8, align 8, !tbaa !9
  %87 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %86, i32 noundef 2, i32 noundef 1)
  store float %85, ptr %87, align 4, !tbaa !5
  %88 = load float, ptr %10, align 4, !tbaa !5
  %89 = load float, ptr %12, align 4, !tbaa !5
  %90 = fmul float %88, %89
  %91 = load ptr, ptr %8, align 8, !tbaa !9
  %92 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %91, i32 noundef 2, i32 noundef 2)
  store float %90, ptr %92, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36), i32 noundef, i32 noundef) #4 align 2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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" }
attributes #3 = { mustprogress 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 #4 = { 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" }
attributes #5 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3sinf(float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt3cosf(float noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z13frd2NedMatrixfffR8Matrix33(float noundef %0, float noundef %1, float noundef %2, ptr noundef nonnull align 4 dereferenceable(36) %3) local_unnamed_addr #2 {
  %5 = tail call noundef float @_ZSt3sinf(float noundef %0)
  %6 = tail call noundef float @_ZSt3cosf(float noundef %0)
  %7 = tail call noundef float @_ZSt3sinf(float noundef %1)
  %8 = tail call noundef float @_ZSt3cosf(float noundef %1)
  %9 = tail call noundef float @_ZSt3sinf(float noundef %2)
  %10 = tail call noundef float @_ZSt3cosf(float noundef %2)
  %11 = fmul float %8, %10
  %12 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 0, i32 noundef 0)
  store float %11, ptr %12, align 4, !tbaa !5
  %13 = fmul float %5, %7
  %14 = fneg float %6
  %15 = fmul float %9, %14
  %16 = tail call float @llvm.fmuladd.f32(float %13, float %10, float %15)
  %17 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 0, i32 noundef 1)
  store float %16, ptr %17, align 4, !tbaa !5
  %18 = fmul float %6, %7
  %19 = fmul float %5, %9
  %20 = tail call float @llvm.fmuladd.f32(float %18, float %10, float %19)
  %21 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 0, i32 noundef 2)
  store float %20, ptr %21, align 4, !tbaa !5
  %22 = fmul float %8, %9
  %23 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 1, i32 noundef 0)
  store float %22, ptr %23, align 4, !tbaa !5
  %24 = fmul float %6, %10
  %25 = tail call float @llvm.fmuladd.f32(float %13, float %9, float %24)
  %26 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 1, i32 noundef 1)
  store float %25, ptr %26, align 4, !tbaa !5
  %27 = fneg float %5
  %28 = fmul float %10, %27
  %29 = tail call float @llvm.fmuladd.f32(float %18, float %9, float %28)
  %30 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 1, i32 noundef 2)
  store float %29, ptr %30, align 4, !tbaa !5
  %31 = fneg float %7
  %32 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 2, i32 noundef 0)
  store float %31, ptr %32, align 4, !tbaa !5
  %33 = fmul float %5, %8
  %34 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 2, i32 noundef 1)
  store float %33, ptr %34, align 4, !tbaa !5
  %35 = fmul float %6, %8
  %36 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %3, i32 noundef 2, i32 noundef 2)
  store float %35, ptr %36, align 4, !tbaa !5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

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