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

; 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.mdvector = type <{ i32, [4 x i8], i64, i64, %"struct.std::array", %"struct.std::array", %"class.std::vector.6", ptr, i8, [7 x i8] }>
%"struct.std::array" = type { [6 x i32] }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.point = type { double, double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::initializer_list" = type { ptr, i64 }
%"class.std::allocator.3" = type { i8 }

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

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

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

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare double @cos(double noundef) #1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEEC2ESt16initializer_listIjERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8mdvectorIdEC2ESt6vectorIjSaIjEEdb(ptr noundef nonnull align 8 dereferenceable(105), ptr noundef, double noundef, i1 noundef zeroext) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105), i32 noundef, i32 noundef) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8mdvectorIdED2Ev(ptr noundef nonnull align 8 dereferenceable(105)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17getRotationMatrixPdd(ptr dead_on_unwind noalias writable sret(%class.mdvector) align 8 %0, ptr noundef %1, double noundef %2) #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca double, align 8
  %7 = alloca %struct.point, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca i1, align 1
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca %"class.std::initializer_list", align 8
  %15 = alloca [2 x i32], align 4
  %16 = alloca %"class.std::allocator.3", align 1
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store double %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds double, ptr %25, i64 0
  %27 = load double, ptr %26, align 8, !tbaa !9
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds double, ptr %28, i64 1
  %30 = load double, ptr %29, align 8, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds double, ptr %31, i64 2
  %33 = load double, ptr %32, align 8, !tbaa !9
  call void @_ZN5pointC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %7, double noundef %27, double noundef %30, double noundef %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %34 = call noundef double @_ZN5point4normEv(ptr noundef nonnull align 8 dereferenceable(24) %7)
  store double %34, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %35 = getelementptr inbounds %struct.point, ptr %7, i32 0, i32 0
  %36 = load double, ptr %35, align 8, !tbaa !11
  store double %36, ptr %9, align 8, !tbaa !9
  %37 = load double, ptr %8, align 8, !tbaa !9
  %38 = load double, ptr %9, align 8, !tbaa !9
  %39 = fdiv double %38, %37
  store double %39, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %40 = getelementptr inbounds %struct.point, ptr %7, i32 0, i32 1
  %41 = load double, ptr %40, align 8, !tbaa !13
  store double %41, ptr %10, align 8, !tbaa !9
  %42 = load double, ptr %8, align 8, !tbaa !9
  %43 = load double, ptr %10, align 8, !tbaa !9
  %44 = fdiv double %43, %42
  store double %44, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %45 = getelementptr inbounds %struct.point, ptr %7, i32 0, i32 2
  %46 = load double, ptr %45, align 8, !tbaa !14
  store double %46, ptr %11, align 8, !tbaa !9
  %47 = load double, ptr %8, align 8, !tbaa !9
  %48 = load double, ptr %11, align 8, !tbaa !9
  %49 = fdiv double %48, %47
  store double %49, ptr %11, align 8, !tbaa !9
  %50 = load double, ptr %8, align 8, !tbaa !9
  %51 = fcmp ogt double %50, 1.000000e-08
  br i1 %51, label %52, label %62

52:                                               ; preds = %3
  %53 = load double, ptr %8, align 8, !tbaa !9
  %54 = load double, ptr %9, align 8, !tbaa !9
  %55 = fdiv double %54, %53
  store double %55, ptr %9, align 8, !tbaa !9
  %56 = load double, ptr %8, align 8, !tbaa !9
  %57 = load double, ptr %10, align 8, !tbaa !9
  %58 = fdiv double %57, %56
  store double %58, ptr %10, align 8, !tbaa !9
  %59 = load double, ptr %8, align 8, !tbaa !9
  %60 = load double, ptr %11, align 8, !tbaa !9
  %61 = fdiv double %60, %59
  store double %61, ptr %11, align 8, !tbaa !9
  br label %62

62:                                               ; preds = %52, %3
  store i1 false, ptr %12, align 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i32 3, ptr %15, align 4, !tbaa !15
  %63 = getelementptr inbounds i32, ptr %15, i64 1
  store i32 3, ptr %63, align 4, !tbaa !15
  %64 = getelementptr inbounds %"class.std::initializer_list", ptr %14, i32 0, i32 0
  store ptr %15, ptr %64, align 8, !tbaa !17
  %65 = getelementptr inbounds %"class.std::initializer_list", ptr %14, i32 0, i32 1
  store i64 2, ptr %65, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #5
  call void @_ZNSaIjEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  %66 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8
  %68 = getelementptr inbounds { ptr, i64 }, ptr %14, i32 0, i32 1
  %69 = load i64, ptr %68, align 8
  invoke void @_ZNSt6vectorIjSaIjEEC2ESt16initializer_listIjERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr %67, i64 %69, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %70 unwind label %157

70:                                               ; preds = %62
  invoke void @_ZN8mdvectorIdEC2ESt6vectorIjSaIjEEdb(ptr noundef nonnull align 8 dereferenceable(105) %0, ptr noundef %13, double noundef 0.000000e+00, i1 noundef zeroext false)
          to label %71 unwind label %161

71:                                               ; preds = %70
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %72 = load double, ptr %6, align 8, !tbaa !9
  %73 = call double @sin(double noundef %72) #5
  store double %73, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %74 = load double, ptr %6, align 8, !tbaa !9
  %75 = call double @cos(double noundef %74) #5
  store double %75, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %76 = load double, ptr %20, align 8, !tbaa !9
  %77 = fsub double 1.000000e+00, %76
  store double %77, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %78 = load double, ptr %9, align 8, !tbaa !9
  %79 = load double, ptr %10, align 8, !tbaa !9
  %80 = fmul double %78, %79
  %81 = load double, ptr %21, align 8, !tbaa !9
  %82 = fmul double %80, %81
  store double %82, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %83 = load double, ptr %9, align 8, !tbaa !9
  %84 = load double, ptr %11, align 8, !tbaa !9
  %85 = fmul double %83, %84
  %86 = load double, ptr %21, align 8, !tbaa !9
  %87 = fmul double %85, %86
  store double %87, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %88 = load double, ptr %10, align 8, !tbaa !9
  %89 = load double, ptr %11, align 8, !tbaa !9
  %90 = fmul double %88, %89
  %91 = load double, ptr %21, align 8, !tbaa !9
  %92 = fmul double %90, %91
  store double %92, ptr %24, align 8, !tbaa !9
  %93 = load double, ptr %20, align 8, !tbaa !9
  %94 = load double, ptr %9, align 8, !tbaa !9
  %95 = load double, ptr %9, align 8, !tbaa !9
  %96 = fmul double %94, %95
  %97 = load double, ptr %21, align 8, !tbaa !9
  %98 = call double @llvm.fmuladd.f64(double %96, double %97, double %93)
  %99 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 0, i32 noundef 0)
          to label %100 unwind label %166

100:                                              ; preds = %71
  store double %98, ptr %99, align 8, !tbaa !9
  %101 = load double, ptr %22, align 8, !tbaa !9
  %102 = load double, ptr %11, align 8, !tbaa !9
  %103 = load double, ptr %19, align 8, !tbaa !9
  %104 = fneg double %102
  %105 = call double @llvm.fmuladd.f64(double %104, double %103, double %101)
  %106 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 0, i32 noundef 1)
          to label %107 unwind label %166

107:                                              ; preds = %100
  store double %105, ptr %106, align 8, !tbaa !9
  %108 = load double, ptr %23, align 8, !tbaa !9
  %109 = load double, ptr %10, align 8, !tbaa !9
  %110 = load double, ptr %19, align 8, !tbaa !9
  %111 = call double @llvm.fmuladd.f64(double %109, double %110, double %108)
  %112 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 0, i32 noundef 2)
          to label %113 unwind label %166

113:                                              ; preds = %107
  store double %111, ptr %112, align 8, !tbaa !9
  %114 = load double, ptr %22, align 8, !tbaa !9
  %115 = load double, ptr %11, align 8, !tbaa !9
  %116 = load double, ptr %19, align 8, !tbaa !9
  %117 = call double @llvm.fmuladd.f64(double %115, double %116, double %114)
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 1, i32 noundef 0)
          to label %119 unwind label %166

119:                                              ; preds = %113
  store double %117, ptr %118, align 8, !tbaa !9
  %120 = load double, ptr %20, align 8, !tbaa !9
  %121 = load double, ptr %10, align 8, !tbaa !9
  %122 = load double, ptr %10, align 8, !tbaa !9
  %123 = fmul double %121, %122
  %124 = load double, ptr %21, align 8, !tbaa !9
  %125 = call double @llvm.fmuladd.f64(double %123, double %124, double %120)
  %126 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 1, i32 noundef 1)
          to label %127 unwind label %166

127:                                              ; preds = %119
  store double %125, ptr %126, align 8, !tbaa !9
  %128 = load double, ptr %24, align 8, !tbaa !9
  %129 = load double, ptr %9, align 8, !tbaa !9
  %130 = load double, ptr %19, align 8, !tbaa !9
  %131 = fneg double %129
  %132 = call double @llvm.fmuladd.f64(double %131, double %130, double %128)
  %133 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 1, i32 noundef 2)
          to label %134 unwind label %166

134:                                              ; preds = %127
  store double %132, ptr %133, align 8, !tbaa !9
  %135 = load double, ptr %23, align 8, !tbaa !9
  %136 = load double, ptr %10, align 8, !tbaa !9
  %137 = load double, ptr %19, align 8, !tbaa !9
  %138 = fneg double %136
  %139 = call double @llvm.fmuladd.f64(double %138, double %137, double %135)
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 2, i32 noundef 0)
          to label %141 unwind label %166

141:                                              ; preds = %134
  store double %139, ptr %140, align 8, !tbaa !9
  %142 = load double, ptr %24, align 8, !tbaa !9
  %143 = load double, ptr %9, align 8, !tbaa !9
  %144 = load double, ptr %19, align 8, !tbaa !9
  %145 = call double @llvm.fmuladd.f64(double %143, double %144, double %142)
  %146 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 2, i32 noundef 1)
          to label %147 unwind label %166

147:                                              ; preds = %141
  store double %145, ptr %146, align 8, !tbaa !9
  %148 = load double, ptr %20, align 8, !tbaa !9
  %149 = load double, ptr %11, align 8, !tbaa !9
  %150 = load double, ptr %11, align 8, !tbaa !9
  %151 = fmul double %149, %150
  %152 = load double, ptr %21, align 8, !tbaa !9
  %153 = call double @llvm.fmuladd.f64(double %151, double %152, double %148)
  %154 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 2, i32 noundef 2)
          to label %155 unwind label %166

155:                                              ; preds = %147
  store double %153, ptr %154, align 8, !tbaa !9
  store i1 true, ptr %12, align 1
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %156 = load i1, ptr %12, align 1
  br i1 %156, label %171, label %170

157:                                              ; preds = %62
  %158 = landingpad { ptr, i32 }
          cleanup
  %159 = extractvalue { ptr, i32 } %158, 0
  store ptr %159, ptr %17, align 8
  %160 = extractvalue { ptr, i32 } %158, 1
  store i32 %160, ptr %18, align 4
  br label %165

161:                                              ; preds = %70
  %162 = landingpad { ptr, i32 }
          cleanup
  %163 = extractvalue { ptr, i32 } %162, 0
  store ptr %163, ptr %17, align 8
  %164 = extractvalue { ptr, i32 } %162, 1
  store i32 %164, ptr %18, align 4
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #5
  br label %165

165:                                              ; preds = %161, %157
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %172

166:                                              ; preds = %147, %141, %134, %127, %119, %113, %107, %100, %71
  %167 = landingpad { ptr, i32 }
          cleanup
  %168 = extractvalue { ptr, i32 } %167, 0
  store ptr %168, ptr %17, align 8
  %169 = extractvalue { ptr, i32 } %167, 1
  store i32 %169, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @_ZN8mdvectorIdED2Ev(ptr noundef nonnull align 8 dereferenceable(105) %0) #5
  br label %172

170:                                              ; preds = %155
  call void @_ZN8mdvectorIdED2Ev(ptr noundef nonnull align 8 dereferenceable(105) %0) #5
  br label %171

171:                                              ; preds = %170, %155
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  ret void

172:                                              ; preds = %166, %165
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #5
  br label %173

173:                                              ; preds = %172
  %174 = load ptr, ptr %17, align 8
  %175 = load i32, ptr %18, align 4
  %176 = insertvalue { ptr, i32 } poison, ptr %174, 0
  %177 = insertvalue { ptr, i32 } %176, i32 %175, 1
  resume { ptr, i32 } %177
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5pointC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5point4normEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { 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 #4 = { 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}
!11 = !{!12, !10, i64 0}
!12 = !{!"_ZTS5point", !10, i64 0, !10, i64 8, !10, i64 16}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !7, i64 0}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSSt16initializer_listIjE", !6, i64 0, !19, i64 8}
!19 = !{!"long", !7, i64 0}
!20 = !{!18, !19, i64 8}


; 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.mdvector = type <{ i32, [4 x i8], i64, i64, %"struct.std::array", %"struct.std::array", %"class.std::vector.6", ptr, i8, [7 x i8] }>
%"struct.std::array" = type { [6 x i32] }
%"class.std::vector.6" = type { %"struct.std::_Vector_base.7" }
%"struct.std::_Vector_base.7" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl" = type { %"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" }
%"struct.std::_Vector_base<double, std::allocator<double>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.point = type { double, double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.3" = type { i8 }

; 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 nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #1

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

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

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEEC2ESt16initializer_listIjERKS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr, i64, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8mdvectorIdEC2ESt6vectorIjSaIjEEdb(ptr noundef nonnull align 8 dereferenceable(105), ptr noundef, double noundef, i1 noundef zeroext) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105), i32 noundef, i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z17getRotationMatrixPdd(ptr dead_on_unwind noalias writable sret(%class.mdvector) align 8 %0, ptr nocapture noundef readonly %1, double noundef %2) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %4 = alloca %struct.point, align 16
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca [2 x i32], align 4
  %7 = alloca %"class.std::allocator.3", align 1
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #5
  %8 = load double, ptr %1, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %1, i64 8
  %10 = load double, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 16
  %12 = load double, ptr %11, align 8, !tbaa !5
  call void @_ZN5pointC2Eddd(ptr noundef nonnull align 8 dereferenceable(24) %4, double noundef %8, double noundef %10, double noundef %12)
  %13 = call noundef double @_ZN5point4normEv(ptr noundef nonnull align 8 dereferenceable(24) %4)
  %14 = load <2 x double>, ptr %4, align 16, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %4, i64 16
  %16 = load double, ptr %15, align 16, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #5
  store i32 3, ptr %6, align 4, !tbaa !11
  %17 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 3, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #5
  call void @_ZNSaIjEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  invoke void @_ZNSt6vectorIjSaIjEEC2ESt16initializer_listIjERKS0_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr nonnull %6, i64 2, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %18 unwind label %66

18:                                               ; preds = %3
  invoke void @_ZN8mdvectorIdEC2ESt6vectorIjSaIjEEdb(ptr noundef nonnull align 8 dereferenceable(105) %0, ptr noundef nonnull %5, double noundef 0.000000e+00, i1 noundef zeroext false)
          to label %19 unwind label %68

19:                                               ; preds = %18
  %20 = fcmp ogt double %13, 1.000000e-08
  %21 = insertelement <2 x double> poison, double %13, i64 0
  %22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> zeroinitializer
  %23 = fdiv <2 x double> %14, %22
  %24 = fdiv <2 x double> %23, %22
  %25 = insertelement <2 x i1> poison, i1 %20, i64 0
  %26 = shufflevector <2 x i1> %25, <2 x i1> poison, <2 x i32> zeroinitializer
  %27 = select <2 x i1> %26, <2 x double> %24, <2 x double> %23
  %28 = fdiv double %16, %13
  %29 = fdiv double %28, %13
  %.061 = select i1 %20, double %29, double %28
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  %30 = call double @sin(double noundef %2) #5
  %31 = call double @cos(double noundef %2) #5
  %32 = fsub double 1.000000e+00, %31
  %33 = extractelement <2 x double> %27, i64 0
  %34 = extractelement <2 x double> %27, i64 1
  %35 = fmul double %33, %34
  %36 = fmul double %35, %32
  %37 = fmul double %33, %.061
  %38 = fmul double %37, %32
  %39 = fmul double %34, %.061
  %40 = fmul double %39, %32
  %41 = fmul <2 x double> %27, %27
  %42 = extractelement <2 x double> %41, i64 0
  %43 = call double @llvm.fmuladd.f64(double %42, double %32, double %31)
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 0, i32 noundef 0)
  store double %43, ptr %44, align 8, !tbaa !5
  %45 = fneg double %.061
  %46 = call double @llvm.fmuladd.f64(double %45, double %30, double %36)
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 0, i32 noundef 1)
  store double %46, ptr %47, align 8, !tbaa !5
  %48 = call double @llvm.fmuladd.f64(double %34, double %30, double %38)
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 0, i32 noundef 2)
  store double %48, ptr %49, align 8, !tbaa !5
  %50 = call double @llvm.fmuladd.f64(double %.061, double %30, double %36)
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 1, i32 noundef 0)
  store double %50, ptr %51, align 8, !tbaa !5
  %52 = fmul double %34, %34
  %53 = call double @llvm.fmuladd.f64(double %52, double %32, double %31)
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 1, i32 noundef 1)
  store double %53, ptr %54, align 8, !tbaa !5
  %55 = fneg double %33
  %56 = call double @llvm.fmuladd.f64(double %55, double %30, double %40)
  %57 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 1, i32 noundef 2)
  store double %56, ptr %57, align 8, !tbaa !5
  %58 = fneg double %34
  %59 = call double @llvm.fmuladd.f64(double %58, double %30, double %38)
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 2, i32 noundef 0)
  store double %59, ptr %60, align 8, !tbaa !5
  %61 = call double @llvm.fmuladd.f64(double %33, double %30, double %40)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 2, i32 noundef 1)
  store double %61, ptr %62, align 8, !tbaa !5
  %63 = fmul double %.061, %.061
  %64 = call double @llvm.fmuladd.f64(double %63, double %32, double %31)
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN8mdvectorIdEclEjj(ptr noundef nonnull align 8 dereferenceable(105) %0, i32 noundef 2, i32 noundef 2)
  store double %64, ptr %65, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  ret void

66:                                               ; preds = %3
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %70

68:                                               ; preds = %18
  %69 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  br label %70

70:                                               ; preds = %68, %66
  %.pn = phi { ptr, i32 } [ %69, %68 ], [ %67, %66 ]
  call void @_ZNSt15__new_allocatorIjED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #5
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5pointC2Eddd(ptr noundef nonnull align 8 dereferenceable(24), double noundef, double noundef, double noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef double @_ZN5point4normEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,VectorCombinePass