; LLVM IR from hadryansalles/Luz :: deps/imgui/ImGuizmo.ll (ZN8ImGuizmo27DecomposeMatrixToComponentsEPKfPfS2_S2_)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.ImGuizmo::matrix_t" = type { %union.anon }
%union.anon = type { [4 x [4 x float]] }
%struct.anon = type { %"struct.ImGuizmo::vec_t", %"struct.ImGuizmo::vec_t", %"struct.ImGuizmo::vec_t", %"struct.ImGuizmo::vec_t" }
%"struct.ImGuizmo::vec_t" = type { float, float, float, float }

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

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

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

; Function Attrs: nounwind
declare float @sqrtf(float noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8ImGuizmo27DecomposeMatrixToComponentsEPKfPfS2_S2_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #3 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.ImGuizmo::matrix_t", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 64, ptr %9) #6
  %10 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN8ImGuizmo8matrix_tC2ERKS0_(ptr noundef nonnull align 4 dereferenceable(64) %9, ptr noundef nonnull align 4 dereferenceable(64) %10)
  %11 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %12 = getelementptr inbounds %struct.anon, ptr %11, i32 0, i32 0
  %13 = call noundef float @_ZNK8ImGuizmo5vec_t6LengthEv(ptr noundef nonnull align 4 dereferenceable(16) %12)
  %14 = load ptr, ptr %8, align 8, !tbaa !5
  %15 = getelementptr inbounds float, ptr %14, i64 0
  store float %13, ptr %15, align 4, !tbaa !9
  %16 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %17 = getelementptr inbounds %struct.anon, ptr %16, i32 0, i32 1
  %18 = call noundef float @_ZNK8ImGuizmo5vec_t6LengthEv(ptr noundef nonnull align 4 dereferenceable(16) %17)
  %19 = load ptr, ptr %8, align 8, !tbaa !5
  %20 = getelementptr inbounds float, ptr %19, i64 1
  store float %18, ptr %20, align 4, !tbaa !9
  %21 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %22 = getelementptr inbounds %struct.anon, ptr %21, i32 0, i32 2
  %23 = call noundef float @_ZNK8ImGuizmo5vec_t6LengthEv(ptr noundef nonnull align 4 dereferenceable(16) %22)
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds float, ptr %24, i64 2
  store float %23, ptr %25, align 4, !tbaa !9
  call void @_ZN8ImGuizmo8matrix_t14OrthoNormalizeEv(ptr noundef nonnull align 4 dereferenceable(64) %9)
  %26 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %27 = getelementptr inbounds [4 x [4 x float]], ptr %26, i64 0, i64 1
  %28 = getelementptr inbounds [4 x float], ptr %27, i64 0, i64 2
  %29 = load float, ptr %28, align 4, !tbaa !11
  %30 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %31 = getelementptr inbounds [4 x [4 x float]], ptr %30, i64 0, i64 2
  %32 = getelementptr inbounds [4 x float], ptr %31, i64 0, i64 2
  %33 = load float, ptr %32, align 4, !tbaa !11
  %34 = call float @atan2f(float noundef %29, float noundef %33) #6
  %35 = fmul float 0x404CA5DC00000000, %34
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds float, ptr %36, i64 0
  store float %35, ptr %37, align 4, !tbaa !9
  %38 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %39 = getelementptr inbounds [4 x [4 x float]], ptr %38, i64 0, i64 0
  %40 = getelementptr inbounds [4 x float], ptr %39, i64 0, i64 2
  %41 = load float, ptr %40, align 4, !tbaa !11
  %42 = fneg float %41
  %43 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %44 = getelementptr inbounds [4 x [4 x float]], ptr %43, i64 0, i64 1
  %45 = getelementptr inbounds [4 x float], ptr %44, i64 0, i64 2
  %46 = load float, ptr %45, align 4, !tbaa !11
  %47 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %48 = getelementptr inbounds [4 x [4 x float]], ptr %47, i64 0, i64 1
  %49 = getelementptr inbounds [4 x float], ptr %48, i64 0, i64 2
  %50 = load float, ptr %49, align 4, !tbaa !11
  %51 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %52 = getelementptr inbounds [4 x [4 x float]], ptr %51, i64 0, i64 2
  %53 = getelementptr inbounds [4 x float], ptr %52, i64 0, i64 2
  %54 = load float, ptr %53, align 4, !tbaa !11
  %55 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %56 = getelementptr inbounds [4 x [4 x float]], ptr %55, i64 0, i64 2
  %57 = getelementptr inbounds [4 x float], ptr %56, i64 0, i64 2
  %58 = load float, ptr %57, align 4, !tbaa !11
  %59 = fmul float %54, %58
  %60 = call float @llvm.fmuladd.f32(float %46, float %50, float %59)
  %61 = call float @sqrtf(float noundef %60) #6
  %62 = call float @atan2f(float noundef %42, float noundef %61) #6
  %63 = fmul float 0x404CA5DC00000000, %62
  %64 = load ptr, ptr %7, align 8, !tbaa !5
  %65 = getelementptr inbounds float, ptr %64, i64 1
  store float %63, ptr %65, align 4, !tbaa !9
  %66 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %67 = getelementptr inbounds [4 x [4 x float]], ptr %66, i64 0, i64 0
  %68 = getelementptr inbounds [4 x float], ptr %67, i64 0, i64 1
  %69 = load float, ptr %68, align 4, !tbaa !11
  %70 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %71 = getelementptr inbounds [4 x [4 x float]], ptr %70, i64 0, i64 0
  %72 = getelementptr inbounds [4 x float], ptr %71, i64 0, i64 0
  %73 = load float, ptr %72, align 4, !tbaa !11
  %74 = call float @atan2f(float noundef %69, float noundef %73) #6
  %75 = fmul float 0x404CA5DC00000000, %74
  %76 = load ptr, ptr %7, align 8, !tbaa !5
  %77 = getelementptr inbounds float, ptr %76, i64 2
  store float %75, ptr %77, align 4, !tbaa !9
  %78 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %79 = getelementptr inbounds %struct.anon, ptr %78, i32 0, i32 3
  %80 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %79, i32 0, i32 0
  %81 = load float, ptr %80, align 4, !tbaa !11
  %82 = load ptr, ptr %6, align 8, !tbaa !5
  %83 = getelementptr inbounds float, ptr %82, i64 0
  store float %81, ptr %83, align 4, !tbaa !9
  %84 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %85 = getelementptr inbounds %struct.anon, ptr %84, i32 0, i32 3
  %86 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %85, i32 0, i32 1
  %87 = load float, ptr %86, align 4, !tbaa !11
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds float, ptr %88, i64 1
  store float %87, ptr %89, align 4, !tbaa !9
  %90 = getelementptr inbounds %"struct.ImGuizmo::matrix_t", ptr %9, i32 0, i32 0
  %91 = getelementptr inbounds %struct.anon, ptr %90, i32 0, i32 3
  %92 = getelementptr inbounds %"struct.ImGuizmo::vec_t", ptr %91, i32 0, i32 2
  %93 = load float, ptr %92, align 4, !tbaa !11
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds float, ptr %94, i64 2
  store float %93, ptr %95, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 64, ptr %9) #6
  ret void
}

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

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

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

; Function Attrs: nounwind
declare float @atan2f(float noundef, float noundef) #2

attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="64" "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 #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.ImGuizmo::matrix_t" = type { %union.anon }
%union.anon = type { [4 x [4 x float]] }

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

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN8ImGuizmo27DecomposeMatrixToComponentsEPKfPfS2_S2_(ptr noundef nonnull %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3) local_unnamed_addr #2 {
  %5 = alloca %"struct.ImGuizmo::matrix_t", align 4
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %5) #7
  call void @_ZN8ImGuizmo8matrix_tC2ERKS0_(ptr noundef nonnull align 4 dereferenceable(64) %5, ptr noundef nonnull align 4 dereferenceable(64) %0)
  %6 = call noundef float @_ZNK8ImGuizmo5vec_t6LengthEv(ptr noundef nonnull align 4 dereferenceable(16) %5)
  store float %6, ptr %3, align 4, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %5, i64 16
  %8 = call noundef float @_ZNK8ImGuizmo5vec_t6LengthEv(ptr noundef nonnull align 4 dereferenceable(16) %7)
  %9 = getelementptr inbounds i8, ptr %3, i64 4
  store float %8, ptr %9, align 4, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %5, i64 32
  %11 = call noundef float @_ZNK8ImGuizmo5vec_t6LengthEv(ptr noundef nonnull align 4 dereferenceable(16) %10)
  %12 = getelementptr inbounds i8, ptr %3, i64 8
  store float %11, ptr %12, align 4, !tbaa !5
  call void @_ZN8ImGuizmo8matrix_t14OrthoNormalizeEv(ptr noundef nonnull align 4 dereferenceable(64) %5)
  %13 = getelementptr inbounds i8, ptr %5, i64 24
  %14 = load float, ptr %13, align 4, !tbaa !9
  %15 = getelementptr inbounds i8, ptr %5, i64 40
  %16 = load float, ptr %15, align 4, !tbaa !9
  %17 = call float @atan2f(float noundef %14, float noundef %16) #7
  %18 = fmul float %17, 0x404CA5DC00000000
  store float %18, ptr %2, align 4, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %5, i64 8
  %20 = load float, ptr %19, align 4, !tbaa !9
  %21 = fneg float %20
  %22 = load float, ptr %13, align 4, !tbaa !9
  %23 = load float, ptr %15, align 4, !tbaa !9
  %24 = fmul float %23, %23
  %25 = call float @llvm.fmuladd.f32(float %22, float %22, float %24)
  %sqrt = call float @llvm.sqrt.f32(float %25)
  %26 = call float @atan2f(float noundef %21, float noundef %sqrt) #7
  %27 = fmul float %26, 0x404CA5DC00000000
  %28 = getelementptr inbounds i8, ptr %2, i64 4
  store float %27, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %5, i64 4
  %30 = load float, ptr %29, align 4, !tbaa !9
  %31 = load float, ptr %5, align 4, !tbaa !9
  %32 = call float @atan2f(float noundef %30, float noundef %31) #7
  %33 = fmul float %32, 0x404CA5DC00000000
  %34 = getelementptr inbounds i8, ptr %2, i64 8
  store float %33, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %5, i64 48
  %36 = load <2 x float>, ptr %35, align 4, !tbaa !9
  store <2 x float> %36, ptr %1, align 4, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %5, i64 56
  %38 = load float, ptr %37, align 4, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %1, i64 8
  store float %38, ptr %39, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %5) #7
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8ImGuizmo8matrix_tC2ERKS0_(ptr noundef nonnull align 4 dereferenceable(64), ptr noundef nonnull align 4 dereferenceable(64)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK8ImGuizmo5vec_t6LengthEv(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare float @atan2f(float noundef, float noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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"="64" "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 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!7, !7, i64 0}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass