; LLVM IR from ashishzero/karma :: src/modules/core/lin_maths.ll (Z13rotate_toward4QuatS_f)

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

%union.Quat = type { [4 x float] }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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 @acosf(float noundef) #2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z8quat_dot4QuatS_(<2 x float>, <2 x float>, <2 x float>, <2 x float>) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZngR4Quat(ptr noundef nonnull align 4 dereferenceable(16)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_Zpl4QuatS_(<2 x float>, <2 x float>, <2 x float>, <2 x float>) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_Zmlf4Quat(float noundef, <2 x float>, <2 x float>) #4

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @_Z13rotate_toward4QuatS_f(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, float noundef %4) #5 {
  %6 = alloca %union.Quat, align 4
  %7 = alloca %union.Quat, align 4
  %8 = alloca %union.Quat, align 4
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca %union.Quat, align 4
  %12 = alloca %union.Quat, align 4
  %13 = alloca %union.Quat, align 4
  %14 = alloca %union.Quat, align 4
  %15 = alloca %union.Quat, align 4
  %16 = alloca %union.Quat, align 4
  %17 = alloca %union.Quat, align 4
  %18 = alloca %union.Quat, align 4
  %19 = alloca %union.Quat, align 4
  %20 = alloca float, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca float, align 4
  %25 = alloca float, align 4
  %26 = alloca float, align 4
  %27 = alloca float, align 4
  %28 = alloca %union.Quat, align 4
  %29 = alloca %union.Quat, align 4
  %30 = alloca %union.Quat, align 4
  %31 = alloca %union.Quat, align 4
  %32 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 0
  store <2 x float> %0, ptr %32, align 4
  %33 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %7, i32 0, i32 1
  store <2 x float> %1, ptr %33, align 4
  %34 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 0
  store <2 x float> %2, ptr %34, align 4
  %35 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %8, i32 0, i32 1
  store <2 x float> %3, ptr %35, align 4
  store float %4, ptr %9, align 4, !tbaa !5
  %36 = load float, ptr %9, align 4, !tbaa !5
  %37 = fcmp une float %36, 0.000000e+00
  br i1 %37, label %38, label %168

38:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %11, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %12, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !9
  %39 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %11, i32 0, i32 0
  %40 = load <2 x float>, ptr %39, align 4
  %41 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %11, i32 0, i32 1
  %42 = load <2 x float>, ptr %41, align 4
  %43 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 0
  %44 = load <2 x float>, ptr %43, align 4
  %45 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %12, i32 0, i32 1
  %46 = load <2 x float>, ptr %45, align 4
  %47 = call noundef float @_Z8quat_dot4QuatS_(<2 x float> %40, <2 x float> %42, <2 x float> %44, <2 x float> %46)
  %48 = fcmp ogt float -1.000000e+00, %47
  br i1 %48, label %49, label %50

49:                                               ; preds = %38
  br label %60

50:                                               ; preds = %38
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !9
  %51 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 0
  %52 = load <2 x float>, ptr %51, align 4
  %53 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %13, i32 0, i32 1
  %54 = load <2 x float>, ptr %53, align 4
  %55 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 0
  %56 = load <2 x float>, ptr %55, align 4
  %57 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %14, i32 0, i32 1
  %58 = load <2 x float>, ptr %57, align 4
  %59 = call noundef float @_Z8quat_dot4QuatS_(<2 x float> %52, <2 x float> %54, <2 x float> %56, <2 x float> %58)
  br label %60

60:                                               ; preds = %50, %49
  %61 = phi float [ -1.000000e+00, %49 ], [ %59, %50 ]
  %62 = fcmp olt float 1.000000e+00, %61
  br i1 %62, label %63, label %64

63:                                               ; preds = %60
  br label %88

64:                                               ; preds = %60
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !9
  %65 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %15, i32 0, i32 0
  %66 = load <2 x float>, ptr %65, align 4
  %67 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %15, i32 0, i32 1
  %68 = load <2 x float>, ptr %67, align 4
  %69 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %16, i32 0, i32 0
  %70 = load <2 x float>, ptr %69, align 4
  %71 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %16, i32 0, i32 1
  %72 = load <2 x float>, ptr %71, align 4
  %73 = call noundef float @_Z8quat_dot4QuatS_(<2 x float> %66, <2 x float> %68, <2 x float> %70, <2 x float> %72)
  %74 = fcmp ogt float -1.000000e+00, %73
  br i1 %74, label %75, label %76

75:                                               ; preds = %64
  br label %86

76:                                               ; preds = %64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %18, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !9
  %77 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 0
  %78 = load <2 x float>, ptr %77, align 4
  %79 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %17, i32 0, i32 1
  %80 = load <2 x float>, ptr %79, align 4
  %81 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %18, i32 0, i32 0
  %82 = load <2 x float>, ptr %81, align 4
  %83 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %18, i32 0, i32 1
  %84 = load <2 x float>, ptr %83, align 4
  %85 = call noundef float @_Z8quat_dot4QuatS_(<2 x float> %78, <2 x float> %80, <2 x float> %82, <2 x float> %84)
  br label %86

86:                                               ; preds = %76, %75
  %87 = phi float [ -1.000000e+00, %75 ], [ %85, %76 ]
  br label %88

88:                                               ; preds = %86, %63
  %89 = phi float [ 1.000000e+00, %63 ], [ %87, %86 ]
  store float %89, ptr %10, align 4, !tbaa !5
  %90 = load float, ptr %10, align 4, !tbaa !5
  %91 = fcmp olt float %90, 0.000000e+00
  br i1 %91, label %92, label %101

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  %93 = call { <2 x float>, <2 x float> } @_ZngR4Quat(ptr noundef nonnull align 4 dereferenceable(16) %8)
  %94 = getelementptr inbounds %union.Quat, ptr %19, i32 0, i32 0
  %95 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %94, i32 0, i32 0
  %96 = extractvalue { <2 x float>, <2 x float> } %93, 0
  store <2 x float> %96, ptr %95, align 4
  %97 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %94, i32 0, i32 1
  %98 = extractvalue { <2 x float>, <2 x float> } %93, 1
  store <2 x float> %98, ptr %97, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 %19, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  %99 = load float, ptr %10, align 4, !tbaa !5
  %100 = fneg float %99
  store float %100, ptr %10, align 4, !tbaa !5
  br label %101

101:                                              ; preds = %92, %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %102 = load float, ptr %10, align 4, !tbaa !5
  %103 = call float @acosf(float noundef %102) #6
  store float %103, ptr %20, align 4, !tbaa !5
  %104 = load float, ptr %20, align 4, !tbaa !5
  %105 = load float, ptr %9, align 4, !tbaa !5
  %106 = fcmp olt float %104, %105
  br i1 %106, label %107, label %108

107:                                              ; preds = %101
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !9
  store i32 1, ptr %21, align 4
  br label %167

108:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  %109 = load float, ptr %9, align 4, !tbaa !5
  %110 = load float, ptr %20, align 4, !tbaa !5
  %111 = fdiv float %109, %110
  store float %111, ptr %22, align 4, !tbaa !5
  %112 = load float, ptr %9, align 4, !tbaa !5
  store float %112, ptr %20, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %113 = load float, ptr %20, align 4, !tbaa !5
  %114 = load float, ptr %22, align 4, !tbaa !5
  %115 = fmul float %113, %114
  store float %115, ptr %23, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %116 = load float, ptr %23, align 4, !tbaa !5
  %117 = call float @sinf(float noundef %116) #6
  store float %117, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %118 = load float, ptr %20, align 4, !tbaa !5
  %119 = call float @sinf(float noundef %118) #6
  store float %119, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %120 = load float, ptr %23, align 4, !tbaa !5
  %121 = call float @cosf(float noundef %120) #6
  %122 = load float, ptr %10, align 4, !tbaa !5
  %123 = load float, ptr %24, align 4, !tbaa !5
  %124 = fmul float %122, %123
  %125 = load float, ptr %25, align 4, !tbaa !5
  %126 = fdiv float %124, %125
  %127 = fsub float %121, %126
  store float %127, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #6
  %128 = load float, ptr %24, align 4, !tbaa !5
  %129 = load float, ptr %25, align 4, !tbaa !5
  %130 = fdiv float %128, %129
  store float %130, ptr %27, align 4, !tbaa !5
  %131 = load float, ptr %26, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %29, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !9
  %132 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %29, i32 0, i32 0
  %133 = load <2 x float>, ptr %132, align 4
  %134 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %29, i32 0, i32 1
  %135 = load <2 x float>, ptr %134, align 4
  %136 = call { <2 x float>, <2 x float> } @_Zmlf4Quat(float noundef %131, <2 x float> %133, <2 x float> %135)
  %137 = getelementptr inbounds %union.Quat, ptr %28, i32 0, i32 0
  %138 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %137, i32 0, i32 0
  %139 = extractvalue { <2 x float>, <2 x float> } %136, 0
  store <2 x float> %139, ptr %138, align 4
  %140 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %137, i32 0, i32 1
  %141 = extractvalue { <2 x float>, <2 x float> } %136, 1
  store <2 x float> %141, ptr %140, align 4
  %142 = load float, ptr %27, align 4, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %31, ptr align 4 %8, i64 16, i1 false), !tbaa.struct !9
  %143 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %31, i32 0, i32 0
  %144 = load <2 x float>, ptr %143, align 4
  %145 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %31, i32 0, i32 1
  %146 = load <2 x float>, ptr %145, align 4
  %147 = call { <2 x float>, <2 x float> } @_Zmlf4Quat(float noundef %142, <2 x float> %144, <2 x float> %146)
  %148 = getelementptr inbounds %union.Quat, ptr %30, i32 0, i32 0
  %149 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %148, i32 0, i32 0
  %150 = extractvalue { <2 x float>, <2 x float> } %147, 0
  store <2 x float> %150, ptr %149, align 4
  %151 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %148, i32 0, i32 1
  %152 = extractvalue { <2 x float>, <2 x float> } %147, 1
  store <2 x float> %152, ptr %151, align 4
  %153 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %28, i32 0, i32 0
  %154 = load <2 x float>, ptr %153, align 4
  %155 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %28, i32 0, i32 1
  %156 = load <2 x float>, ptr %155, align 4
  %157 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %30, i32 0, i32 0
  %158 = load <2 x float>, ptr %157, align 4
  %159 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %30, i32 0, i32 1
  %160 = load <2 x float>, ptr %159, align 4
  %161 = call { <2 x float>, <2 x float> } @_Zpl4QuatS_(<2 x float> %154, <2 x float> %156, <2 x float> %158, <2 x float> %160)
  %162 = getelementptr inbounds %union.Quat, ptr %6, i32 0, i32 0
  %163 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %162, i32 0, i32 0
  %164 = extractvalue { <2 x float>, <2 x float> } %161, 0
  store <2 x float> %164, ptr %163, align 4
  %165 = getelementptr inbounds { <2 x float>, <2 x float> }, ptr %162, i32 0, i32 1
  %166 = extractvalue { <2 x float>, <2 x float> } %161, 1
  store <2 x float> %166, ptr %165, align 4
  store i32 1, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %167

167:                                              ; preds = %108, %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %169

168:                                              ; preds = %5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 4 %7, i64 16, i1 false), !tbaa.struct !9
  br label %169

169:                                              ; preds = %168, %167
  %170 = getelementptr inbounds %union.Quat, ptr %6, i32 0, i32 0
  %171 = load { <2 x float>, <2 x float> }, ptr %170, align 4
  ret { <2 x float>, <2 x float> } %171
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 nounwind 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 #4 = { inlinehint 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 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 16, !10}
!10 = !{!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"

%union.Quat = type { [4 x float] }

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_Z8quat_dot4QuatS_(<2 x float>, <2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_ZngR4Quat(ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_Zpl4QuatS_(<2 x float>, <2 x float>, <2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local { <2 x float>, <2 x float> } @_Zmlf4Quat(float noundef, <2 x float>, <2 x float>) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @_Z13rotate_toward4QuatS_f(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3, float noundef %4) local_unnamed_addr #3 {
  %6 = alloca %union.Quat, align 8
  store <2 x float> %2, ptr %6, align 8
  %7 = getelementptr inbounds i8, ptr %6, i64 8
  store <2 x float> %3, ptr %7, align 8
  %8 = fcmp une float %4, 0.000000e+00
  br i1 %8, label %9, label %47

9:                                                ; preds = %5
  %10 = tail call noundef float @_Z8quat_dot4QuatS_(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3)
  %11 = fcmp olt float %10, -1.000000e+00
  br i1 %11, label %.critedge, label %12

12:                                               ; preds = %9
  %13 = tail call noundef float @_Z8quat_dot4QuatS_(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3)
  %14 = fcmp ogt float %13, 1.000000e+00
  br i1 %14, label %.thread58, label %.critedge

.critedge:                                        ; preds = %9, %12
  %15 = tail call noundef float @_Z8quat_dot4QuatS_(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3)
  %16 = fcmp olt float %15, -1.000000e+00
  br i1 %16, label %.thread, label %17

17:                                               ; preds = %.critedge
  %18 = tail call noundef float @_Z8quat_dot4QuatS_(<2 x float> %0, <2 x float> %1, <2 x float> %2, <2 x float> %3)
  %19 = fcmp olt float %18, 0.000000e+00
  br i1 %19, label %.thread, label %.thread58

.thread:                                          ; preds = %.critedge, %17
  %20 = phi float [ %18, %17 ], [ -1.000000e+00, %.critedge ]
  %21 = call { <2 x float>, <2 x float> } @_ZngR4Quat(ptr noundef nonnull align 4 dereferenceable(16) %6)
  %22 = extractvalue { <2 x float>, <2 x float> } %21, 0
  %23 = extractvalue { <2 x float>, <2 x float> } %21, 1
  store <2 x float> %22, ptr %6, align 8
  store <2 x float> %23, ptr %7, align 8, !tbaa !5
  %24 = fneg float %20
  br label %.thread58

.thread58:                                        ; preds = %12, %.thread, %17
  %.0 = phi float [ %24, %.thread ], [ %18, %17 ], [ 1.000000e+00, %12 ]
  %25 = call float @acosf(float noundef %.0) #4
  %26 = fcmp olt float %25, %4
  br i1 %26, label %27, label %28

27:                                               ; preds = %.thread58
  %.sroa.053.0.copyload = load <2 x float>, ptr %6, align 8
  %.sroa.454.0.copyload = load <2 x float>, ptr %7, align 8, !tbaa !5
  br label %47

28:                                               ; preds = %.thread58
  %29 = fdiv float %4, %25
  %30 = fmul float %29, %4
  %31 = call float @sinf(float noundef %30) #4
  %32 = call float @sinf(float noundef %4) #4
  %33 = call float @cosf(float noundef %30) #4
  %34 = fmul float %.0, %31
  %35 = fdiv float %34, %32
  %36 = fsub float %33, %35
  %37 = fdiv float %31, %32
  %38 = call { <2 x float>, <2 x float> } @_Zmlf4Quat(float noundef %36, <2 x float> %0, <2 x float> %1)
  %39 = extractvalue { <2 x float>, <2 x float> } %38, 0
  %40 = extractvalue { <2 x float>, <2 x float> } %38, 1
  %.sroa.0.0.copyload = load <2 x float>, ptr %6, align 8
  %.sroa.2.0.copyload = load <2 x float>, ptr %7, align 8, !tbaa !5
  %41 = call { <2 x float>, <2 x float> } @_Zmlf4Quat(float noundef %37, <2 x float> %.sroa.0.0.copyload, <2 x float> %.sroa.2.0.copyload)
  %42 = extractvalue { <2 x float>, <2 x float> } %41, 0
  %43 = extractvalue { <2 x float>, <2 x float> } %41, 1
  %44 = call { <2 x float>, <2 x float> } @_Zpl4QuatS_(<2 x float> %39, <2 x float> %40, <2 x float> %42, <2 x float> %43)
  %45 = extractvalue { <2 x float>, <2 x float> } %44, 0
  %46 = extractvalue { <2 x float>, <2 x float> } %44, 1
  br label %47

47:                                               ; preds = %5, %27, %28
  %.sroa.053.1 = phi <2 x float> [ %.sroa.053.0.copyload, %27 ], [ %45, %28 ], [ %0, %5 ]
  %.sroa.454.1 = phi <2 x float> [ %.sroa.454.0.copyload, %27 ], [ %46, %28 ], [ %1, %5 ]
  %.fca.0.insert = insertvalue { <2 x float>, <2 x float> } poison, <2 x float> %.sroa.053.1, 0
  %.fca.1.insert = insertvalue { <2 x float>, <2 x float> } %.fca.0.insert, <2 x float> %.sroa.454.1, 1
  ret { <2 x float>, <2 x float> } %.fca.1.insert
}

attributes #0 = { 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 #1 = { mustprogress nounwind 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 #2 = { inlinehint 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 #3 = { 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 #4 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass