; LLVM IR from niessner/Matterport :: code/gaps/pkgs/R3Shapes/R3Quaternion.ll (Z17R3QuaternionSlerpRK12R3QuaternionS1_d)

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

%class.R3Quaternion = type { [4 x double] }

@RN_EPSILON = external global double, align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17R3QuaternionSlerpRK12R3QuaternionS1_d(ptr dead_on_unwind noalias writable sret(%class.R3Quaternion) align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, double noundef %3) #1 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca double, align 8
  %9 = alloca [4 x double], align 16
  %10 = alloca [4 x double], align 16
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca [4 x double], align 16
  %15 = alloca i32, align 4
  %16 = alloca [4 x double], align 16
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store double %3, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %9) #5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %19, i32 noundef 0)
  store double %20, ptr %9, align 8, !tbaa !9
  %21 = getelementptr inbounds double, ptr %9, i64 1
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %22, i32 noundef 1)
  store double %23, ptr %21, align 8, !tbaa !9
  %24 = getelementptr inbounds double, ptr %9, i64 2
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %25, i32 noundef 2)
  store double %26, ptr %24, align 8, !tbaa !9
  %27 = getelementptr inbounds double, ptr %9, i64 3
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %28, i32 noundef 3)
  store double %29, ptr %27, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 32, ptr %10) #5
  %30 = load ptr, ptr %7, align 8, !tbaa !5
  %31 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %30, i32 noundef 0)
  store double %31, ptr %10, align 8, !tbaa !9
  %32 = getelementptr inbounds double, ptr %10, i64 1
  %33 = load ptr, ptr %7, align 8, !tbaa !5
  %34 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %33, i32 noundef 1)
  store double %34, ptr %32, align 8, !tbaa !9
  %35 = getelementptr inbounds double, ptr %10, i64 2
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %36, i32 noundef 2)
  store double %37, ptr %35, align 8, !tbaa !9
  %38 = getelementptr inbounds double, ptr %10, i64 3
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %39, i32 noundef 3)
  store double %40, ptr %38, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %41 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 0
  %42 = load double, ptr %41, align 16, !tbaa !9
  %43 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 0
  %44 = load double, ptr %43, align 16, !tbaa !9
  %45 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 1
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 1
  %48 = load double, ptr %47, align 8, !tbaa !9
  %49 = fmul double %46, %48
  %50 = call double @llvm.fmuladd.f64(double %42, double %44, double %49)
  %51 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 2
  %52 = load double, ptr %51, align 16, !tbaa !9
  %53 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 2
  %54 = load double, ptr %53, align 16, !tbaa !9
  %55 = call double @llvm.fmuladd.f64(double %52, double %54, double %50)
  %56 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 3
  %57 = load double, ptr %56, align 8, !tbaa !9
  %58 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 3
  %59 = load double, ptr %58, align 8, !tbaa !9
  %60 = call double @llvm.fmuladd.f64(double %57, double %59, double %55)
  store double %60, ptr %11, align 8, !tbaa !9
  %61 = load double, ptr %11, align 8, !tbaa !9
  %62 = fcmp olt double %61, 0.000000e+00
  br i1 %62, label %63, label %82

63:                                               ; preds = %4
  %64 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 0
  %65 = load double, ptr %64, align 16, !tbaa !9
  %66 = fneg double %65
  %67 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 0
  store double %66, ptr %67, align 16, !tbaa !9
  %68 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 1
  %69 = load double, ptr %68, align 8, !tbaa !9
  %70 = fneg double %69
  %71 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 1
  store double %70, ptr %71, align 8, !tbaa !9
  %72 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 2
  %73 = load double, ptr %72, align 16, !tbaa !9
  %74 = fneg double %73
  %75 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 2
  store double %74, ptr %75, align 16, !tbaa !9
  %76 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 3
  %77 = load double, ptr %76, align 8, !tbaa !9
  %78 = fneg double %77
  %79 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 3
  store double %78, ptr %79, align 8, !tbaa !9
  %80 = load double, ptr %11, align 8, !tbaa !9
  %81 = fneg double %80
  store double %81, ptr %11, align 8, !tbaa !9
  br label %82

82:                                               ; preds = %63, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %83 = load double, ptr %11, align 8, !tbaa !9
  %84 = fcmp olt double %83, 1.000000e+00
  br i1 %84, label %85, label %88

85:                                               ; preds = %82
  %86 = load double, ptr %11, align 8, !tbaa !9
  %87 = call double @acos(double noundef %86) #5
  br label %89

88:                                               ; preds = %82
  br label %89

89:                                               ; preds = %88, %85
  %90 = phi double [ %87, %85 ], [ 0.000000e+00, %88 ]
  store double %90, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %91 = load double, ptr %12, align 8, !tbaa !9
  %92 = call double @sin(double noundef %91) #5
  store double %92, ptr %13, align 8, !tbaa !9
  %93 = load double, ptr %13, align 8, !tbaa !9
  %94 = load double, ptr @RN_EPSILON, align 8, !tbaa !9
  %95 = call noundef i32 @_Z8RNIsZerodd(double noundef %93, double noundef %94)
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %97, label %139

97:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 32, ptr %14) #5
  %98 = load double, ptr %8, align 8, !tbaa !9
  %99 = fsub double 1.000000e+00, %98
  %100 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 0
  %101 = load double, ptr %100, align 16, !tbaa !9
  %102 = load double, ptr %8, align 8, !tbaa !9
  %103 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 0
  %104 = load double, ptr %103, align 16, !tbaa !9
  %105 = fmul double %102, %104
  %106 = call double @llvm.fmuladd.f64(double %99, double %101, double %105)
  %107 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 0
  store double %106, ptr %107, align 16, !tbaa !9
  %108 = load double, ptr %8, align 8, !tbaa !9
  %109 = fsub double 1.000000e+00, %108
  %110 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 1
  %111 = load double, ptr %110, align 8, !tbaa !9
  %112 = load double, ptr %8, align 8, !tbaa !9
  %113 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 1
  %114 = load double, ptr %113, align 8, !tbaa !9
  %115 = fmul double %112, %114
  %116 = call double @llvm.fmuladd.f64(double %109, double %111, double %115)
  %117 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 1
  store double %116, ptr %117, align 8, !tbaa !9
  %118 = load double, ptr %8, align 8, !tbaa !9
  %119 = fsub double 1.000000e+00, %118
  %120 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 2
  %121 = load double, ptr %120, align 16, !tbaa !9
  %122 = load double, ptr %8, align 8, !tbaa !9
  %123 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 2
  %124 = load double, ptr %123, align 16, !tbaa !9
  %125 = fmul double %122, %124
  %126 = call double @llvm.fmuladd.f64(double %119, double %121, double %125)
  %127 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 2
  store double %126, ptr %127, align 16, !tbaa !9
  %128 = load double, ptr %8, align 8, !tbaa !9
  %129 = fsub double 1.000000e+00, %128
  %130 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 3
  %131 = load double, ptr %130, align 8, !tbaa !9
  %132 = load double, ptr %8, align 8, !tbaa !9
  %133 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 3
  %134 = load double, ptr %133, align 8, !tbaa !9
  %135 = fmul double %132, %134
  %136 = call double @llvm.fmuladd.f64(double %129, double %131, double %135)
  %137 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 3
  store double %136, ptr %137, align 8, !tbaa !9
  %138 = getelementptr inbounds [4 x double], ptr %14, i64 0, i64 0
  call void @_ZN12R3QuaternionC1EPKd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %138)
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 32, ptr %14) #5
  br label %190

139:                                              ; preds = %89
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %140 = load double, ptr %8, align 8, !tbaa !9
  %141 = fsub double 1.000000e+00, %140
  %142 = load double, ptr %12, align 8, !tbaa !9
  %143 = fmul double %141, %142
  %144 = call double @sin(double noundef %143) #5
  %145 = load double, ptr %13, align 8, !tbaa !9
  %146 = fdiv double %144, %145
  store double %146, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %147 = load double, ptr %8, align 8, !tbaa !9
  %148 = load double, ptr %12, align 8, !tbaa !9
  %149 = fmul double %147, %148
  %150 = call double @sin(double noundef %149) #5
  %151 = load double, ptr %13, align 8, !tbaa !9
  %152 = fdiv double %150, %151
  store double %152, ptr %18, align 8, !tbaa !9
  %153 = load double, ptr %17, align 8, !tbaa !9
  %154 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 0
  %155 = load double, ptr %154, align 16, !tbaa !9
  %156 = load double, ptr %18, align 8, !tbaa !9
  %157 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 0
  %158 = load double, ptr %157, align 16, !tbaa !9
  %159 = fmul double %156, %158
  %160 = call double @llvm.fmuladd.f64(double %153, double %155, double %159)
  %161 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 0
  store double %160, ptr %161, align 16, !tbaa !9
  %162 = load double, ptr %17, align 8, !tbaa !9
  %163 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 1
  %164 = load double, ptr %163, align 8, !tbaa !9
  %165 = load double, ptr %18, align 8, !tbaa !9
  %166 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 1
  %167 = load double, ptr %166, align 8, !tbaa !9
  %168 = fmul double %165, %167
  %169 = call double @llvm.fmuladd.f64(double %162, double %164, double %168)
  %170 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 1
  store double %169, ptr %170, align 8, !tbaa !9
  %171 = load double, ptr %17, align 8, !tbaa !9
  %172 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 2
  %173 = load double, ptr %172, align 16, !tbaa !9
  %174 = load double, ptr %18, align 8, !tbaa !9
  %175 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 2
  %176 = load double, ptr %175, align 16, !tbaa !9
  %177 = fmul double %174, %176
  %178 = call double @llvm.fmuladd.f64(double %171, double %173, double %177)
  %179 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 2
  store double %178, ptr %179, align 16, !tbaa !9
  %180 = load double, ptr %17, align 8, !tbaa !9
  %181 = getelementptr inbounds [4 x double], ptr %9, i64 0, i64 3
  %182 = load double, ptr %181, align 8, !tbaa !9
  %183 = load double, ptr %18, align 8, !tbaa !9
  %184 = getelementptr inbounds [4 x double], ptr %10, i64 0, i64 3
  %185 = load double, ptr %184, align 8, !tbaa !9
  %186 = fmul double %183, %185
  %187 = call double @llvm.fmuladd.f64(double %180, double %182, double %186)
  %188 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 3
  store double %187, ptr %188, align 8, !tbaa !9
  %189 = getelementptr inbounds [4 x double], ptr %16, i64 0, i64 0
  call void @_ZN12R3QuaternionC1EPKd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %189)
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #5
  br label %190

190:                                              ; preds = %139, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %9) #5
  ret void
}

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

; Function Attrs: nounwind
declare double @sin(double noundef) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32), i32 noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) #4

; Function Attrs: nounwind
declare double @acos(double noundef) #2

declare void @_ZN12R3QuaternionC1EPKd(ptr, ptr)

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

%class.R3Quaternion = type { [4 x double] }

@RN_EPSILON = external local_unnamed_addr global double, align 8

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17R3QuaternionSlerpRK12R3QuaternionS1_d(ptr dead_on_unwind noalias writable sret(%class.R3Quaternion) align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %2, double noundef %3) local_unnamed_addr #1 {
  %5 = alloca [4 x double], align 16
  %6 = alloca [4 x double], align 16
  %7 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef 0)
  %8 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef 1)
  %9 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef 2)
  %10 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef 3)
  %11 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 0)
  %12 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 1)
  %13 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 2)
  %14 = tail call noundef double @_ZNK12R3QuaternionixEi(ptr noundef nonnull align 8 dereferenceable(32) %2, i32 noundef 3)
  %15 = fmul double %8, %12
  %16 = tail call double @llvm.fmuladd.f64(double %7, double %11, double %15)
  %17 = tail call double @llvm.fmuladd.f64(double %9, double %13, double %16)
  %18 = tail call double @llvm.fmuladd.f64(double %10, double %14, double %17)
  %19 = fcmp olt double %18, 0.000000e+00
  %20 = insertelement <2 x double> poison, double %11, i64 0
  %21 = insertelement <2 x double> %20, double %12, i64 1
  %22 = insertelement <2 x double> poison, double %13, i64 0
  %23 = insertelement <2 x double> %22, double %14, i64 1
  %24 = fneg <2 x double> %21
  %25 = fneg <2 x double> %23
  %26 = fneg double %18
  %.0 = select i1 %19, double %26, double %18
  %27 = select i1 %19, <2 x double> %24, <2 x double> %21
  %28 = select i1 %19, <2 x double> %25, <2 x double> %23
  %29 = fcmp olt double %.0, 1.000000e+00
  br i1 %29, label %30, label %32

30:                                               ; preds = %4
  %31 = tail call double @acos(double noundef %.0) #6
  br label %32

32:                                               ; preds = %4, %30
  %33 = phi double [ %31, %30 ], [ 0.000000e+00, %4 ]
  %34 = tail call double @sin(double noundef %33) #6
  %35 = load double, ptr @RN_EPSILON, align 8, !tbaa !5
  %36 = tail call noundef i32 @_Z8RNIsZerodd(double noundef %34, double noundef %35)
  %.not = icmp eq i32 %36, 0
  %37 = fsub double 1.000000e+00, %3
  br i1 %.not, label %52, label %38

38:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #6
  %39 = insertelement <2 x double> poison, double %3, i64 0
  %40 = shufflevector <2 x double> %39, <2 x double> poison, <2 x i32> zeroinitializer
  %41 = fmul <2 x double> %27, %40
  %42 = insertelement <2 x double> poison, double %37, i64 0
  %43 = shufflevector <2 x double> %42, <2 x double> poison, <2 x i32> zeroinitializer
  %44 = insertelement <2 x double> poison, double %7, i64 0
  %45 = insertelement <2 x double> %44, double %8, i64 1
  %46 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> %45, <2 x double> %41)
  store <2 x double> %46, ptr %5, align 16, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %5, i64 16
  %48 = fmul <2 x double> %28, %40
  %49 = insertelement <2 x double> poison, double %9, i64 0
  %50 = insertelement <2 x double> %49, double %10, i64 1
  %51 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> %50, <2 x double> %48)
  store <2 x double> %51, ptr %47, align 16, !tbaa !5
  call void @_ZN12R3QuaternionC1EPKd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %5)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #6
  br label %72

52:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #6
  %53 = fmul double %37, %33
  %54 = tail call double @sin(double noundef %53) #6
  %55 = fdiv double %54, %34
  %56 = fmul double %33, %3
  %57 = tail call double @sin(double noundef %56) #6
  %58 = fdiv double %57, %34
  %59 = insertelement <2 x double> poison, double %58, i64 0
  %60 = shufflevector <2 x double> %59, <2 x double> poison, <2 x i32> zeroinitializer
  %61 = fmul <2 x double> %27, %60
  %62 = insertelement <2 x double> poison, double %55, i64 0
  %63 = shufflevector <2 x double> %62, <2 x double> poison, <2 x i32> zeroinitializer
  %64 = insertelement <2 x double> poison, double %7, i64 0
  %65 = insertelement <2 x double> %64, double %8, i64 1
  %66 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %63, <2 x double> %65, <2 x double> %61)
  store <2 x double> %66, ptr %6, align 16, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %6, i64 16
  %68 = fmul <2 x double> %28, %60
  %69 = insertelement <2 x double> poison, double %9, i64 0
  %70 = insertelement <2 x double> %69, double %10, i64 1
  %71 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %63, <2 x double> %70, <2 x double> %68)
  store <2 x double> %71, ptr %67, align 16, !tbaa !5
  call void @_ZN12R3QuaternionC1EPKd(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %6)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #6
  br label %72

72:                                               ; preds = %52, %38
  ret void
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_Z8RNIsZerodd(double noundef, double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @acos(double noundef) local_unnamed_addr #2

declare void @_ZN12R3QuaternionC1EPKd(ptr, ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { mustprogress nofree nounwind willreturn memory(write) "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { inlinehint 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


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