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

; 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.Matrix33 = type { [9 x float] }
%class.Vector3 = type { [3 x float] }

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

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

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

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

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

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

declare void @_Z14identityMatrixv(ptr dead_on_unwind writable sret(%class.Matrix33) align 4) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12makeVectorUpRK7Vector3(ptr dead_on_unwind noalias writable sret(%class.Matrix33) align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.Vector3, align 4
  %6 = alloca %class.Vector3, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %class.Vector3, align 4
  %10 = alloca %class.Matrix33, align 4
  %11 = alloca i32, align 4
  %12 = alloca %class.Vector3, align 4
  %13 = alloca %class.Vector3, align 4
  store ptr %0, ptr %3, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @_ZN8Matrix33C2Ev(ptr noundef nonnull align 4 dereferenceable(36) %0)
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZNK7Vector310unitVectorEv(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %5, ptr noundef nonnull align 4 dereferenceable(12) %14)
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #5
  call void @_ZN7Vector3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 1, ptr %8, align 4, !tbaa !9
  br label %15

15:                                               ; preds = %30, %2
  %16 = load i32, ptr %8, align 4, !tbaa !9
  %17 = icmp ult i32 %16, 3
  br i1 %17, label %19, label %18

18:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %33

19:                                               ; preds = %15
  %20 = load i32, ptr %8, align 4, !tbaa !9
  %21 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef %20)
  %22 = load float, ptr %21, align 4, !tbaa !11
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef %23)
  %25 = load float, ptr %24, align 4, !tbaa !11
  %26 = fcmp ogt float %22, %25
  br i1 %26, label %27, label %29

27:                                               ; preds = %19
  %28 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %28, ptr %7, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %27, %19
  br label %30

30:                                               ; preds = %29
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = add i32 %31, 1
  store i32 %32, ptr %8, align 4, !tbaa !9
  br label %15, !llvm.loop !13

33:                                               ; preds = %18
  %34 = load i32, ptr %7, align 4, !tbaa !9
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef %34)
  store float 1.000000e+00, ptr %35, align 4, !tbaa !11
  %36 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %37 = fpext float %36 to double
  %38 = call double @llvm.fabs.f64(double %37)
  %39 = fcmp oge double %38, 0x3FEFFFFFC0000000
  br i1 %39, label %40, label %47

40:                                               ; preds = %33
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef %41)
  store float 0.000000e+00, ptr %42, align 4, !tbaa !11
  %43 = load i32, ptr %7, align 4, !tbaa !9
  %44 = add i32 %43, 1
  %45 = urem i32 %44, 3
  %46 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %6, i32 noundef %45)
  store float 1.000000e+00, ptr %46, align 4, !tbaa !11
  br label %47

47:                                               ; preds = %40, %33
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #5
  call void @_ZN7Vector3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %48 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %9)
  %49 = fpext float %48 to double
  %50 = call double @llvm.fabs.f64(double %49)
  %51 = fcmp oge double %50, 0x3FEFFFFFCA501ACB
  br i1 %51, label %52, label %54

52:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 36, ptr %10) #5
  call void @_Z14identityMatrixv(ptr dead_on_unwind writable sret(%class.Matrix33) align 4 %10)
  %53 = call noundef nonnull align 4 dereferenceable(36) ptr @_ZN8Matrix33aSERKS_(ptr noundef nonnull align 4 dereferenceable(36) %0, ptr noundef nonnull align 4 dereferenceable(36) %10)
  call void @llvm.lifetime.end.p0(i64 36, ptr %10) #5
  store i32 1, ptr %11, align 4
  br label %84

54:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  call void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %12, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %55 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector39NormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %12)
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #5
  call void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind writable sret(%class.Vector3) align 4 %13, ptr noundef nonnull align 4 dereferenceable(12) %5, ptr noundef nonnull align 4 dereferenceable(12) %12)
  %56 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector39NormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %13)
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef 0)
  %58 = load float, ptr %57, align 4, !tbaa !11
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 0, i32 noundef 0)
  store float %58, ptr %59, align 4, !tbaa !11
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef 1)
  %61 = load float, ptr %60, align 4, !tbaa !11
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 0, i32 noundef 1)
  store float %61, ptr %62, align 4, !tbaa !11
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %12, i32 noundef 2)
  %64 = load float, ptr %63, align 4, !tbaa !11
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 0, i32 noundef 2)
  store float %64, ptr %65, align 4, !tbaa !11
  %66 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 0)
  %67 = load float, ptr %66, align 4, !tbaa !11
  %68 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 1, i32 noundef 0)
  store float %67, ptr %68, align 4, !tbaa !11
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 1)
  %70 = load float, ptr %69, align 4, !tbaa !11
  %71 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 1, i32 noundef 1)
  store float %70, ptr %71, align 4, !tbaa !11
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %13, i32 noundef 2)
  %73 = load float, ptr %72, align 4, !tbaa !11
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 1, i32 noundef 2)
  store float %73, ptr %74, align 4, !tbaa !11
  %75 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 0)
  %76 = load float, ptr %75, align 4, !tbaa !11
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 2, i32 noundef 0)
  store float %76, ptr %77, align 4, !tbaa !11
  %78 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 1)
  %79 = load float, ptr %78, align 4, !tbaa !11
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 2, i32 noundef 1)
  store float %79, ptr %80, align 4, !tbaa !11
  %81 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %5, i32 noundef 2)
  %82 = load float, ptr %81, align 4, !tbaa !11
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 2, i32 noundef 2)
  store float %82, ptr %83, align 4, !tbaa !11
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  br label %84

84:                                               ; preds = %54, %52
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #5
  ret void
}

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector39NormalizeEv(ptr noundef nonnull align 4 dereferenceable(12)) #2 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"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.Matrix33 = type { [9 x float] }
%class.Vector3 = type { [3 x float] }

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

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

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

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

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

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

declare void @_Z14identityMatrixv(ptr dead_on_unwind writable sret(%class.Matrix33) align 4) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_Z12makeVectorUpRK7Vector3(ptr dead_on_unwind noalias nonnull writable sret(%class.Matrix33) align 4 %0, ptr noundef nonnull align 4 dereferenceable(12) %1) local_unnamed_addr #2 {
  %3 = alloca %class.Vector3, align 4
  %4 = alloca %class.Vector3, align 4
  %5 = alloca %class.Vector3, align 4
  %6 = alloca %class.Matrix33, align 4
  %7 = alloca %class.Vector3, align 4
  %8 = alloca %class.Vector3, align 4
  tail call void @_ZN8Matrix33C2Ev(ptr noundef nonnull align 4 dereferenceable(36) %0)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #5
  call void @_ZNK7Vector310unitVectorEv(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %3, ptr noundef nonnull align 4 dereferenceable(12) %1)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  call void @_ZN7Vector3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %9 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 1)
  %10 = load float, ptr %9, align 4, !tbaa !5
  %11 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 0)
  %12 = load float, ptr %11, align 4, !tbaa !5
  %13 = fcmp ogt float %10, %12
  %.1 = zext i1 %13 to i32
  %14 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 2)
  %15 = load float, ptr %14, align 4, !tbaa !5
  %16 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef %.1)
  %17 = load float, ptr %16, align 4, !tbaa !5
  %18 = fcmp ogt float %15, %17
  %.1.1 = select i1 %18, i32 2, i32 %.1
  %19 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %4, i32 noundef %.1.1)
  store float 1.000000e+00, ptr %19, align 4, !tbaa !5
  %20 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %21 = call float @llvm.fabs.f32(float %20)
  %22 = fcmp ult float %21, 0x3FEFFFFFC0000000
  br i1 %22, label %29, label %23

23:                                               ; preds = %2
  %24 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %4, i32 noundef %.1.1)
  store float 0.000000e+00, ptr %24, align 4, !tbaa !5
  %25 = add nuw nsw i32 %.1.1, 1
  %26 = icmp eq i32 %25, 3
  %27 = select i1 %26, i32 0, i32 %25
  %28 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %4, i32 noundef %27)
  store float 1.000000e+00, ptr %28, align 4, !tbaa !5
  br label %29

29:                                               ; preds = %23, %2
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  call void @_ZN7Vector3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %30 = call noundef float @_ZNK7Vector33dotERKS_(ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %31 = call float @llvm.fabs.f32(float %30)
  %32 = fpext float %31 to double
  %33 = fcmp ult double %32, 0x3FEFFFFFCA501ACB
  br i1 %33, label %36, label %34

34:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %6) #5
  call void @_Z14identityMatrixv(ptr dead_on_unwind nonnull writable sret(%class.Matrix33) align 4 %6)
  %35 = call noundef nonnull align 4 dereferenceable(36) ptr @_ZN8Matrix33aSERKS_(ptr noundef nonnull align 4 dereferenceable(36) %0, ptr noundef nonnull align 4 dereferenceable(36) %6)
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %6) #5
  br label %66

36:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #5
  call void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %7, ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %3)
  %37 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector39NormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %8) #5
  call void @_ZNK7Vector312crossProductERKS_(ptr dead_on_unwind nonnull writable sret(%class.Vector3) align 4 %8, ptr noundef nonnull align 4 dereferenceable(12) %3, ptr noundef nonnull align 4 dereferenceable(12) %7)
  %38 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN7Vector39NormalizeEv(ptr noundef nonnull align 4 dereferenceable(12) %8)
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %7, i32 noundef 0)
  %40 = load float, ptr %39, align 4, !tbaa !5
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 0, i32 noundef 0)
  store float %40, ptr %41, align 4, !tbaa !5
  %42 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %7, i32 noundef 1)
  %43 = load float, ptr %42, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 0, i32 noundef 1)
  store float %43, ptr %44, align 4, !tbaa !5
  %45 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %7, i32 noundef 2)
  %46 = load float, ptr %45, align 4, !tbaa !5
  %47 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 0, i32 noundef 2)
  store float %46, ptr %47, align 4, !tbaa !5
  %48 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %8, i32 noundef 0)
  %49 = load float, ptr %48, align 4, !tbaa !5
  %50 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 1, i32 noundef 0)
  store float %49, ptr %50, align 4, !tbaa !5
  %51 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %8, i32 noundef 1)
  %52 = load float, ptr %51, align 4, !tbaa !5
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 1, i32 noundef 1)
  store float %52, ptr %53, align 4, !tbaa !5
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %8, i32 noundef 2)
  %55 = load float, ptr %54, align 4, !tbaa !5
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 1, i32 noundef 2)
  store float %55, ptr %56, align 4, !tbaa !5
  %57 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 0)
  %58 = load float, ptr %57, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 2, i32 noundef 0)
  store float %58, ptr %59, align 4, !tbaa !5
  %60 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 1)
  %61 = load float, ptr %60, align 4, !tbaa !5
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 2, i32 noundef 1)
  store float %61, ptr %62, align 4, !tbaa !5
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNK7Vector3ixEj(ptr noundef nonnull align 4 dereferenceable(12) %3, i32 noundef 2)
  %64 = load float, ptr %63, align 4, !tbaa !5
  %65 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN8Matrix33clEjj(ptr noundef nonnull align 4 dereferenceable(36) %0, i32 noundef 2, i32 noundef 2)
  store float %64, ptr %65, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  br label %66

66:                                               ; preds = %36, %34
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #5
  ret void
}

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

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

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

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

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LCSSAPass,LoopRotatePass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass