; LLVM IR from shupx/swarm_sync_sim :: src/px4_rotor_sim/src/mavros_px4_quadrotor_sim/px4_modules/mc_att_control/Attitu_5822f368 (ZNK15AttitudeControl6updateERKN6matrix10QuaternionIfEE)

; 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.matrix::Vector3" = type { %"class.matrix::Vector" }
%"class.matrix::Vector" = type { %"class.matrix::Matrix" }
%"class.matrix::Matrix" = type { [3 x [1 x float]] }
%"class.matrix::Quaternion" = type { %"class.matrix::Vector.0" }
%"class.matrix::Vector.0" = type { %"class.matrix::Matrix.1" }
%"class.matrix::Matrix.1" = type { [4 x [1 x float]] }
%class.AttitudeControl = type { %"class.matrix::Vector3", %"class.matrix::Vector3", float, %"class.matrix::Quaternion", float }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK15AttitudeControl6updateERKN6matrix10QuaternionIfEE(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4 %0, ptr noundef nonnull align 4 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(16) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %"class.matrix::Quaternion", align 4
  %8 = alloca %"class.matrix::Vector3", align 4
  %9 = alloca %"class.matrix::Vector3", align 4
  %10 = alloca %"class.matrix::Quaternion", align 4
  %11 = alloca %"class.matrix::Quaternion", align 4
  %12 = alloca %"class.matrix::Quaternion", align 4
  %13 = alloca %"class.matrix::Quaternion", align 4
  %14 = alloca %"class.matrix::Quaternion", align 4
  %15 = alloca %"class.matrix::Quaternion", align 4
  %16 = alloca %"class.matrix::Quaternion", align 4
  %17 = alloca %"class.matrix::Vector3", align 4
  %18 = alloca %"class.matrix::Matrix", align 4
  %19 = alloca %"class.matrix::Vector3", align 4
  %20 = alloca %"class.matrix::Quaternion", align 4
  %21 = alloca %"class.matrix::Matrix", align 4
  %22 = alloca %"class.matrix::Vector3", align 4
  %23 = alloca %"class.matrix::Vector3", align 4
  %24 = alloca %"class.matrix::Quaternion", align 4
  %25 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %7) #7
  %27 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 3
  call void @_ZN6matrix10QuaternionIfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(16) %27)
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #7
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind writable sret(%"class.matrix::Vector3") align 4 %8, ptr noundef nonnull align 4 dereferenceable(16) %28)
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #7
  call void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind writable sret(%"class.matrix::Vector3") align 4 %9, ptr noundef nonnull align 4 dereferenceable(16) %7)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  call void @_ZN6matrix10QuaternionIfEC2ERKNS_7Vector3IfEES5_f(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 0x3EE4F8B580000000)
  %29 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %10, i64 noundef 1)
  %30 = load float, ptr %29, align 4, !tbaa !9
  %31 = call float @llvm.fabs.f32(float %30)
  %32 = fcmp ogt float %31, 0x3FEFFFEB00000000
  br i1 %32, label %38, label %33

33:                                               ; preds = %3
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %10, i64 noundef 2)
  %35 = load float, ptr %34, align 4, !tbaa !9
  %36 = call float @llvm.fabs.f32(float %35)
  %37 = fcmp ogt float %36, 0x3FEFFFEB00000000
  br i1 %37, label %38, label %40

38:                                               ; preds = %33, %3
  %39 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %7)
  br label %42

40:                                               ; preds = %33
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZN6matrix10QuaternionIfEmLERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %41)
  br label %42

42:                                               ; preds = %40, %38
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  call void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind writable sret(%"class.matrix::Quaternion") align 4 %12, ptr noundef nonnull align 4 dereferenceable(16) %10)
  call void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind writable sret(%"class.matrix::Quaternion") align 4 %11, ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @_ZN6matrix10QuaternionIfE12canonicalizeEv(ptr noundef nonnull align 4 dereferenceable(16) %11)
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %11, i64 noundef 0)
  %44 = load float, ptr %43, align 4, !tbaa !9
  %45 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %44, float noundef -1.000000e+00, float noundef 1.000000e+00)
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %11, i64 noundef 0)
  store float %45, ptr %46, align 4, !tbaa !9
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %11, i64 noundef 3)
  %48 = load float, ptr %47, align 4, !tbaa !9
  %49 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %48, float noundef -1.000000e+00, float noundef 1.000000e+00)
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %11, i64 noundef 3)
  store float %49, ptr %50, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  %51 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 2
  %52 = load float, ptr %51, align 4, !tbaa !11
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %11, i64 noundef 0)
  %54 = load float, ptr %53, align 4, !tbaa !9
  %55 = call float @acosf(float noundef %54) #7
  %56 = fmul float %52, %55
  %57 = call float @cosf(float noundef %56) #7
  %58 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 2
  %59 = load float, ptr %58, align 4, !tbaa !11
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %11, i64 noundef 3)
  %61 = load float, ptr %60, align 4, !tbaa !9
  %62 = call float @asinf(float noundef %61) #7
  %63 = fmul float %59, %62
  %64 = call float @sinf(float noundef %63) #7
  call void @_ZN6matrix10QuaternionIfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %14, float noundef %57, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %64)
  call void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind writable sret(%"class.matrix::Quaternion") align 4 %13, ptr noundef nonnull align 4 dereferenceable(16) %10, ptr noundef nonnull align 4 dereferenceable(16) %14)
  %65 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(16) %13)
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind writable sret(%"class.matrix::Quaternion") align 4 %16, ptr noundef nonnull align 4 dereferenceable(16) %66)
  call void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind writable sret(%"class.matrix::Quaternion") align 4 %15, ptr noundef nonnull align 4 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(16) %7)
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  call void @_ZNK6matrix10QuaternionIfE9canonicalEv(ptr dead_on_unwind writable sret(%"class.matrix::Quaternion") align 4 %20, ptr noundef nonnull align 4 dereferenceable(16) %15)
  call void @_ZNK6matrix10QuaternionIfE4imagEv(ptr dead_on_unwind writable sret(%"class.matrix::Vector3") align 4 %19, ptr noundef nonnull align 4 dereferenceable(16) %20)
  call void @_ZN6matrixmlIfLm3ELm1EEENS_6MatrixIT_XT0_EXT1_EEES2_RKS3_(ptr dead_on_unwind writable sret(%"class.matrix::Matrix") align 4 %18, float noundef 2.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @_ZN6matrix7Vector3IfEC2ERKNS_6MatrixIfLm3ELm1EEE(ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #7
  %67 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 0
  call void @_ZNK6matrix6MatrixIfLm3ELm1EE5emultERKS1_(ptr dead_on_unwind writable sret(%"class.matrix::Matrix") align 4 %21, ptr noundef nonnull align 4 dereferenceable(12) %17, ptr noundef nonnull align 4 dereferenceable(12) %67)
  call void @_ZN6matrix7Vector3IfEC2ERKNS_6MatrixIfLm3ELm1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %21)
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #7
  %68 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 4
  %69 = load float, ptr %68, align 4, !tbaa !19
  %70 = call noundef zeroext i1 @_ZN6matrix9is_finiteIfEEbT_(float noundef %69)
  br i1 %70, label %71, label %75

71:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %72 = load ptr, ptr %6, align 8, !tbaa !5
  call void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind writable sret(%"class.matrix::Quaternion") align 4 %24, ptr noundef nonnull align 4 dereferenceable(16) %72)
  call void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind writable sret(%"class.matrix::Vector3") align 4 %23, ptr noundef nonnull align 4 dereferenceable(16) %24)
  %73 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 4
  %74 = load float, ptr %73, align 4, !tbaa !19
  call void @_ZNK6matrix7Vector3IfEmlEf(ptr dead_on_unwind writable sret(%"class.matrix::Vector3") align 4 %22, ptr noundef nonnull align 4 dereferenceable(12) %23, float noundef %74)
  call void @_ZN6matrix6MatrixIfLm3ELm1EEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %22)
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #7
  br label %75

75:                                               ; preds = %71, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  store i32 0, ptr %25, align 4, !tbaa !20
  br label %76

76:                                               ; preds = %100, %75
  %77 = load i32, ptr %25, align 4, !tbaa !20
  %78 = icmp slt i32 %77, 3
  br i1 %78, label %80, label %79

79:                                               ; preds = %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %103

80:                                               ; preds = %76
  %81 = load i32, ptr %25, align 4, !tbaa !20
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef %82)
  %84 = load float, ptr %83, align 4, !tbaa !9
  %85 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 1
  %86 = load i32, ptr %25, align 4, !tbaa !20
  %87 = sext i32 %86 to i64
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %85, i64 noundef %87)
  %89 = load float, ptr %88, align 4, !tbaa !9
  %90 = fneg float %89
  %91 = getelementptr inbounds %class.AttitudeControl, ptr %26, i32 0, i32 1
  %92 = load i32, ptr %25, align 4, !tbaa !20
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %91, i64 noundef %93)
  %95 = load float, ptr %94, align 4, !tbaa !9
  %96 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %84, float noundef %90, float noundef %95)
  %97 = load i32, ptr %25, align 4, !tbaa !20
  %98 = sext i32 %97 to i64
  %99 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef %98)
  store float %96, ptr %99, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %80
  %101 = load i32, ptr %25, align 4, !tbaa !20
  %102 = add nsw i32 %101, 1
  store i32 %102, ptr %25, align 4, !tbaa !20
  br label %76, !llvm.loop !22

103:                                              ; preds = %79
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %7) #7
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEC2ERKNS_7Vector3IfEES5_f(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16), i64 noundef) #1 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEmLERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Quaternion") align 4, ptr noundef nonnull align 4 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind noalias writable sret(%"class.matrix::Quaternion") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfE12canonicalizeEv(ptr noundef nonnull align 4 dereferenceable(16)) #2 align 2

; Function Attrs: nounwind
declare float @cosf(float noundef) #6

; Function Attrs: nounwind
declare float @acosf(float noundef) #6

; Function Attrs: nounwind
declare float @sinf(float noundef) #6

; Function Attrs: nounwind
declare float @asinf(float noundef) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrixmlIfLm3ELm1EEENS_6MatrixIT_XT0_EXT1_EEES2_RKS3_(ptr dead_on_unwind noalias writable sret(%"class.matrix::Matrix") align 4, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE9canonicalEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Quaternion") align 4, ptr noundef nonnull align 4 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE4imagEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(16)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix7Vector3IfEC2ERKNS_6MatrixIfLm3ELm1EEE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK6matrix6MatrixIfLm3ELm1EE5emultERKS1_(ptr dead_on_unwind noalias writable sret(%"class.matrix::Matrix") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6matrix9is_finiteIfEEbT_(float noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6matrix7Vector3IfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix6MatrixIfLm3ELm1EEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) #1 align 2

attributes #0 = { 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 #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 #7 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !10, i64 24}
!12 = !{!"_ZTS15AttitudeControl", !13, i64 0, !13, i64 12, !10, i64 24, !16, i64 28, !10, i64 44}
!13 = !{!"_ZTSN6matrix7Vector3IfEE", !14, i64 0}
!14 = !{!"_ZTSN6matrix6VectorIfLm3EEE", !15, i64 0}
!15 = !{!"_ZTSN6matrix6MatrixIfLm3ELm1EEE", !7, i64 0}
!16 = !{!"_ZTSN6matrix10QuaternionIfEE", !17, i64 0}
!17 = !{!"_ZTSN6matrix6VectorIfLm4EEE", !18, i64 0}
!18 = !{!"_ZTSN6matrix6MatrixIfLm4ELm1EEE", !7, i64 0}
!19 = !{!12, !10, i64 44}
!20 = !{!21, !21, i64 0}
!21 = !{!"int", !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; 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.matrix::Vector3" = type { %"class.matrix::Vector" }
%"class.matrix::Vector" = type { %"class.matrix::Matrix" }
%"class.matrix::Matrix" = type { [3 x [1 x float]] }
%"class.matrix::Quaternion" = type { %"class.matrix::Vector.0" }
%"class.matrix::Vector.0" = type { %"class.matrix::Matrix.1" }
%"class.matrix::Matrix.1" = type { [4 x [1 x float]] }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK15AttitudeControl6updateERKN6matrix10QuaternionIfEE(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4 %0, ptr noundef nonnull align 4 dereferenceable(48) %1, ptr noundef nonnull align 4 dereferenceable(16) %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.matrix::Quaternion", align 4
  %5 = alloca %"class.matrix::Vector3", align 4
  %6 = alloca %"class.matrix::Vector3", align 4
  %7 = alloca %"class.matrix::Quaternion", align 4
  %8 = alloca %"class.matrix::Quaternion", align 4
  %9 = alloca %"class.matrix::Quaternion", align 4
  %10 = alloca %"class.matrix::Quaternion", align 4
  %11 = alloca %"class.matrix::Quaternion", align 4
  %12 = alloca %"class.matrix::Quaternion", align 4
  %13 = alloca %"class.matrix::Quaternion", align 4
  %14 = alloca %"class.matrix::Vector3", align 4
  %15 = alloca %"class.matrix::Matrix", align 4
  %16 = alloca %"class.matrix::Vector3", align 4
  %17 = alloca %"class.matrix::Quaternion", align 4
  %18 = alloca %"class.matrix::Matrix", align 4
  %19 = alloca %"class.matrix::Vector3", align 4
  %20 = alloca %"class.matrix::Vector3", align 4
  %21 = alloca %"class.matrix::Quaternion", align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %22 = getelementptr inbounds i8, ptr %1, i64 28
  call void @_ZN6matrix10QuaternionIfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(16) %22)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #7
  call void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Vector3") align 4 %5, ptr noundef nonnull align 4 dereferenceable(16) %2)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #7
  call void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Vector3") align 4 %6, ptr noundef nonnull align 4 dereferenceable(16) %4)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #7
  call void @_ZN6matrix10QuaternionIfEC2ERKNS_7Vector3IfEES5_f(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 0x3EE4F8B580000000)
  %23 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %7, i64 noundef 1)
  %24 = load float, ptr %23, align 4, !tbaa !5
  %25 = call float @llvm.fabs.f32(float %24)
  %26 = fcmp ogt float %25, 0x3FEFFFEB00000000
  br i1 %26, label %32, label %27

27:                                               ; preds = %3
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %7, i64 noundef 2)
  %29 = load float, ptr %28, align 4, !tbaa !5
  %30 = call float @llvm.fabs.f32(float %29)
  %31 = fcmp ogt float %30, 0x3FEFFFEB00000000
  br i1 %31, label %32, label %34

32:                                               ; preds = %27, %3
  %33 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(16) %4)
  br label %35

34:                                               ; preds = %27
  call void @_ZN6matrix10QuaternionIfEmLERKS1_(ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(16) %2)
  br label %35

35:                                               ; preds = %34, %32
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #7
  call void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Quaternion") align 4 %9, ptr noundef nonnull align 4 dereferenceable(16) %7)
  call void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Quaternion") align 4 %8, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #7
  call void @_ZN6matrix10QuaternionIfE12canonicalizeEv(ptr noundef nonnull align 4 dereferenceable(16) %8)
  %36 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %8, i64 noundef 0)
  %37 = load float, ptr %36, align 4, !tbaa !5
  %38 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %37, float noundef -1.000000e+00, float noundef 1.000000e+00)
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %8, i64 noundef 0)
  store float %38, ptr %39, align 4, !tbaa !5
  %40 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %8, i64 noundef 3)
  %41 = load float, ptr %40, align 4, !tbaa !5
  %42 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %41, float noundef -1.000000e+00, float noundef 1.000000e+00)
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %8, i64 noundef 3)
  store float %42, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %44 = getelementptr inbounds i8, ptr %1, i64 24
  %45 = load float, ptr %44, align 4, !tbaa !9
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %8, i64 noundef 0)
  %47 = load float, ptr %46, align 4, !tbaa !5
  %48 = call float @acosf(float noundef %47) #7
  %49 = fmul float %45, %48
  %50 = call float @cosf(float noundef %49) #7
  %51 = load float, ptr %44, align 4, !tbaa !9
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16) %8, i64 noundef 3)
  %53 = load float, ptr %52, align 4, !tbaa !5
  %54 = call float @asinf(float noundef %53) #7
  %55 = fmul float %51, %54
  %56 = call float @sinf(float noundef %55) #7
  call void @_ZN6matrix10QuaternionIfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %11, float noundef %50, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %56)
  call void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Quaternion") align 4 %10, ptr noundef nonnull align 4 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(16) %11)
  %57 = call noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #7
  call void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Quaternion") align 4 %13, ptr noundef nonnull align 4 dereferenceable(16) %2)
  call void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Quaternion") align 4 %12, ptr noundef nonnull align 4 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(16) %4)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %17) #7
  call void @_ZNK6matrix10QuaternionIfE9canonicalEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Quaternion") align 4 %17, ptr noundef nonnull align 4 dereferenceable(16) %12)
  call void @_ZNK6matrix10QuaternionIfE4imagEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Vector3") align 4 %16, ptr noundef nonnull align 4 dereferenceable(16) %17)
  call void @_ZN6matrixmlIfLm3ELm1EEENS_6MatrixIT_XT0_EXT1_EEES2_RKS3_(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Matrix") align 4 %15, float noundef 2.000000e+00, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @_ZN6matrix7Vector3IfEC2ERKNS_6MatrixIfLm3ELm1EEE(ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %15)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %16) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #7
  call void @_ZNK6matrix6MatrixIfLm3ELm1EE5emultERKS1_(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Matrix") align 4 %18, ptr noundef nonnull align 4 dereferenceable(12) %14, ptr noundef nonnull align 4 dereferenceable(12) %1)
  call void @_ZN6matrix7Vector3IfEC2ERKNS_6MatrixIfLm3ELm1EEE(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #7
  %58 = getelementptr inbounds i8, ptr %1, i64 44
  %59 = load float, ptr %58, align 4, !tbaa !17
  %60 = call noundef zeroext i1 @_ZN6matrix9is_finiteIfEEbT_(float noundef %59)
  br i1 %60, label %61, label %63

61:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %21) #7
  call void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Quaternion") align 4 %21, ptr noundef nonnull align 4 dereferenceable(16) %2)
  call void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Vector3") align 4 %20, ptr noundef nonnull align 4 dereferenceable(16) %21)
  %62 = load float, ptr %58, align 4, !tbaa !17
  call void @_ZNK6matrix7Vector3IfEmlEf(ptr dead_on_unwind nonnull writable sret(%"class.matrix::Vector3") align 4 %19, ptr noundef nonnull align 4 dereferenceable(12) %20, float noundef %62)
  call void @_ZN6matrix6MatrixIfLm3ELm1EEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %0, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #7
  br label %63

63:                                               ; preds = %61, %35
  %64 = getelementptr inbounds i8, ptr %1, i64 12
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef 0)
  %66 = load float, ptr %65, align 4, !tbaa !5
  %67 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %64, i64 noundef 0)
  %68 = load float, ptr %67, align 4, !tbaa !5
  %69 = fneg float %68
  %70 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %64, i64 noundef 0)
  %71 = load float, ptr %70, align 4, !tbaa !5
  %72 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %66, float noundef %69, float noundef %71)
  %73 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef 0)
  store float %72, ptr %73, align 4, !tbaa !5
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef 1)
  %75 = load float, ptr %74, align 4, !tbaa !5
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %64, i64 noundef 1)
  %77 = load float, ptr %76, align 4, !tbaa !5
  %78 = fneg float %77
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %64, i64 noundef 1)
  %80 = load float, ptr %79, align 4, !tbaa !5
  %81 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %75, float noundef %78, float noundef %80)
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef 1)
  store float %81, ptr %82, align 4, !tbaa !5
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef 2)
  %84 = load float, ptr %83, align 4, !tbaa !5
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %64, i64 noundef 2)
  %86 = load float, ptr %85, align 4, !tbaa !5
  %87 = fneg float %86
  %88 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %64, i64 noundef 2)
  %89 = load float, ptr %88, align 4, !tbaa !5
  %90 = call noundef float @_ZN4math9constrainIfEET_S1_S1_S1_(float noundef %84, float noundef %87, float noundef %89)
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12) %0, i64 noundef 2)
  store float %90, ptr %91, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEC2ERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE5dcm_zEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEC2ERKNS_7Vector3IfEES5_f(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6matrix6VectorIfLm4EEclEm(ptr noundef nonnull align 4 dereferenceable(16), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEmLERKS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE8inversedEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Quaternion") align 4, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfEmlERKS1_(ptr dead_on_unwind noalias writable sret(%"class.matrix::Quaternion") align 4, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix10QuaternionIfE12canonicalizeEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @cosf(float noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @acosf(float noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @sinf(float noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @asinf(float noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix10QuaternionIfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(16) ptr @_ZN6matrix10QuaternionIfEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrixmlIfLm3ELm1EEENS_6MatrixIT_XT0_EXT1_EEES2_RKS3_(ptr dead_on_unwind noalias writable sret(%"class.matrix::Matrix") align 4, float noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE9canonicalEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Quaternion") align 4, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK6matrix10QuaternionIfE4imagEv(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6matrix7Vector3IfEC2ERKNS_6MatrixIfLm3ELm1EEE(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK6matrix6MatrixIfLm3ELm1EE5emultERKS1_(ptr dead_on_unwind noalias writable sret(%"class.matrix::Matrix") align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN6matrix9is_finiteIfEEbT_(float noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZNK6matrix7Vector3IfEmlEf(ptr dead_on_unwind noalias writable sret(%"class.matrix::Vector3") align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6matrix6MatrixIfLm3ELm1EEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNK6matrix6VectorIfLm3EEclEm(ptr noundef nonnull align 4 dereferenceable(12), i64 noundef) local_unnamed_addr #1 align 2

attributes #0 = { 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 #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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { 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, !6, i64 24}
!10 = !{!"_ZTS15AttitudeControl", !11, i64 0, !11, i64 12, !6, i64 24, !14, i64 28, !6, i64 44}
!11 = !{!"_ZTSN6matrix7Vector3IfEE", !12, i64 0}
!12 = !{!"_ZTSN6matrix6VectorIfLm3EEE", !13, i64 0}
!13 = !{!"_ZTSN6matrix6MatrixIfLm3ELm1EEE", !7, i64 0}
!14 = !{!"_ZTSN6matrix10QuaternionIfEE", !15, i64 0}
!15 = !{!"_ZTSN6matrix6VectorIfLm4EEE", !16, i64 0}
!16 = !{!"_ZTSN6matrix6MatrixIfLm4ELm1EEE", !7, i64 0}
!17 = !{!10, !6, i64 44}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LICMPass,LoopRotatePass,SROAPass,SimplifyCFGPass