; LLVM IR from romerojosh/zefr :: src/funcs.ll (ZN4QuatmlERKS_)

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

%struct.Quat = type { [4 x double] }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4QuatC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4QuatmlERKS_(ptr dead_on_unwind noalias writable sret(%struct.Quat) align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  store ptr %2, ptr %5, align 8, !tbaa !5
  %6 = load ptr, ptr %4, align 8
  call void @_ZN4QuatC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %7 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %8 = getelementptr inbounds [4 x double], ptr %7, i64 0, i64 0
  %9 = load double, ptr %8, align 8, !tbaa !9
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  %11 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %10, i32 noundef 0)
  %12 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %13 = getelementptr inbounds [4 x double], ptr %12, i64 0, i64 1
  %14 = load double, ptr %13, align 8, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %15, i32 noundef 1)
  %17 = fmul double %14, %16
  %18 = fneg double %17
  %19 = call double @llvm.fmuladd.f64(double %9, double %11, double %18)
  %20 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %21 = getelementptr inbounds [4 x double], ptr %20, i64 0, i64 2
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %23, i32 noundef 2)
  %25 = fneg double %22
  %26 = call double @llvm.fmuladd.f64(double %25, double %24, double %19)
  %27 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %28 = getelementptr inbounds [4 x double], ptr %27, i64 0, i64 3
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %30, i32 noundef 3)
  %32 = fneg double %29
  %33 = call double @llvm.fmuladd.f64(double %32, double %31, double %26)
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 0)
  store double %33, ptr %34, align 8, !tbaa !9
  %35 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %36 = getelementptr inbounds [4 x double], ptr %35, i64 0, i64 0
  %37 = load double, ptr %36, align 8, !tbaa !9
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %38, i32 noundef 1)
  %40 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %41 = getelementptr inbounds [4 x double], ptr %40, i64 0, i64 1
  %42 = load double, ptr %41, align 8, !tbaa !9
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %43, i32 noundef 0)
  %45 = fmul double %42, %44
  %46 = call double @llvm.fmuladd.f64(double %37, double %39, double %45)
  %47 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %48 = getelementptr inbounds [4 x double], ptr %47, i64 0, i64 2
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %50, i32 noundef 3)
  %52 = call double @llvm.fmuladd.f64(double %49, double %51, double %46)
  %53 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %54 = getelementptr inbounds [4 x double], ptr %53, i64 0, i64 3
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %56, i32 noundef 2)
  %58 = fneg double %55
  %59 = call double @llvm.fmuladd.f64(double %58, double %57, double %52)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 1)
  store double %59, ptr %60, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %62 = getelementptr inbounds [4 x double], ptr %61, i64 0, i64 0
  %63 = load double, ptr %62, align 8, !tbaa !9
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %64, i32 noundef 2)
  %66 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %67 = getelementptr inbounds [4 x double], ptr %66, i64 0, i64 2
  %68 = load double, ptr %67, align 8, !tbaa !9
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %69, i32 noundef 0)
  %71 = fmul double %68, %70
  %72 = call double @llvm.fmuladd.f64(double %63, double %65, double %71)
  %73 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %74 = getelementptr inbounds [4 x double], ptr %73, i64 0, i64 3
  %75 = load double, ptr %74, align 8, !tbaa !9
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %76, i32 noundef 1)
  %78 = call double @llvm.fmuladd.f64(double %75, double %77, double %72)
  %79 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %80 = getelementptr inbounds [4 x double], ptr %79, i64 0, i64 1
  %81 = load double, ptr %80, align 8, !tbaa !9
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %82, i32 noundef 3)
  %84 = fneg double %81
  %85 = call double @llvm.fmuladd.f64(double %84, double %83, double %78)
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 2)
  store double %85, ptr %86, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %88 = getelementptr inbounds [4 x double], ptr %87, i64 0, i64 0
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %90, i32 noundef 3)
  %92 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %93 = getelementptr inbounds [4 x double], ptr %92, i64 0, i64 3
  %94 = load double, ptr %93, align 8, !tbaa !9
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %95, i32 noundef 0)
  %97 = fmul double %94, %96
  %98 = call double @llvm.fmuladd.f64(double %89, double %91, double %97)
  %99 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %100 = getelementptr inbounds [4 x double], ptr %99, i64 0, i64 1
  %101 = load double, ptr %100, align 8, !tbaa !9
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %102, i32 noundef 2)
  %104 = call double @llvm.fmuladd.f64(double %101, double %103, double %98)
  %105 = getelementptr inbounds %struct.Quat, ptr %6, i32 0, i32 0
  %106 = getelementptr inbounds [4 x double], ptr %105, i64 0, i64 2
  %107 = load double, ptr %106, align 8, !tbaa !9
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %108, i32 noundef 1)
  %110 = fneg double %107
  %111 = call double @llvm.fmuladd.f64(double %110, double %109, double %104)
  %112 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 3)
  store double %111, ptr %112, align 8, !tbaa !9
  ret void
}

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" }
attributes #2 = { 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" }

!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 = !{!"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"

%struct.Quat = type { [4 x double] }

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4QuatC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN4QuatmlERKS_(ptr dead_on_unwind noalias nonnull writable sret(%struct.Quat) align 8 %0, ptr nocapture noundef nonnull readonly align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2) local_unnamed_addr #1 align 2 {
  tail call void @_ZN4QuatC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %0)
  %4 = load double, ptr %1, align 8, !tbaa !5
  %5 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 0)
  %6 = getelementptr inbounds i8, ptr %1, i64 8
  %7 = load double, ptr %6, align 8, !tbaa !5
  %8 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 1)
  %9 = fneg double %7
  %10 = fmul double %8, %9
  %11 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %10)
  %12 = getelementptr inbounds i8, ptr %1, i64 16
  %13 = load double, ptr %12, align 8, !tbaa !5
  %14 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 2)
  %15 = fneg double %13
  %16 = tail call double @llvm.fmuladd.f64(double %15, double %14, double %11)
  %17 = getelementptr inbounds i8, ptr %1, i64 24
  %18 = load double, ptr %17, align 8, !tbaa !5
  %19 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 3)
  %20 = fneg double %18
  %21 = tail call double @llvm.fmuladd.f64(double %20, double %19, double %16)
  %22 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 0)
  store double %21, ptr %22, align 8, !tbaa !5
  %23 = load double, ptr %1, align 8, !tbaa !5
  %24 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 1)
  %25 = load double, ptr %6, align 8, !tbaa !5
  %26 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 0)
  %27 = fmul double %25, %26
  %28 = tail call double @llvm.fmuladd.f64(double %23, double %24, double %27)
  %29 = load double, ptr %12, align 8, !tbaa !5
  %30 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 3)
  %31 = tail call double @llvm.fmuladd.f64(double %29, double %30, double %28)
  %32 = load double, ptr %17, align 8, !tbaa !5
  %33 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 2)
  %34 = fneg double %32
  %35 = tail call double @llvm.fmuladd.f64(double %34, double %33, double %31)
  %36 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 1)
  store double %35, ptr %36, align 8, !tbaa !5
  %37 = load double, ptr %1, align 8, !tbaa !5
  %38 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 2)
  %39 = load double, ptr %12, align 8, !tbaa !5
  %40 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 0)
  %41 = fmul double %39, %40
  %42 = tail call double @llvm.fmuladd.f64(double %37, double %38, double %41)
  %43 = load double, ptr %17, align 8, !tbaa !5
  %44 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 1)
  %45 = tail call double @llvm.fmuladd.f64(double %43, double %44, double %42)
  %46 = load double, ptr %6, align 8, !tbaa !5
  %47 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 3)
  %48 = fneg double %46
  %49 = tail call double @llvm.fmuladd.f64(double %48, double %47, double %45)
  %50 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 2)
  store double %49, ptr %50, align 8, !tbaa !5
  %51 = load double, ptr %1, align 8, !tbaa !5
  %52 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 3)
  %53 = load double, ptr %17, align 8, !tbaa !5
  %54 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 0)
  %55 = fmul double %53, %54
  %56 = tail call double @llvm.fmuladd.f64(double %51, double %52, double %55)
  %57 = load double, ptr %6, align 8, !tbaa !5
  %58 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 2)
  %59 = tail call double @llvm.fmuladd.f64(double %57, double %58, double %56)
  %60 = load double, ptr %12, align 8, !tbaa !5
  %61 = tail call noundef double @_ZNK4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 1)
  %62 = fneg double %60
  %63 = tail call double @llvm.fmuladd.f64(double %62, double %61, double %59)
  %64 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZN4QuatixEj(ptr noundef nonnull align 8 dereferenceable(32) %0, i32 noundef 3)
  store double %63, ptr %64, align 8, !tbaa !5
  ret void
}

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


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