; LLVM IR from yangfengzzz/Arche-webgpu :: vox.animation/runtime/ik_two_bone_job.ll (ZN3vox9animation12IKTwoBoneJobC2Ev)

; 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.vox::animation::IKTwoBoneJob" = type { <4 x float>, <4 x float>, <4 x float>, float, float, float, ptr, ptr, ptr, ptr, ptr, ptr }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox9animation12IKTwoBoneJobC2Ev(ptr noundef nonnull align 16 dereferenceable(112) %0) unnamed_addr #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 0
  %5 = call noundef <4 x float> @_ZN3vox9simd_math11simd_float44zeroEv()
  store <4 x float> %5, ptr %4, align 16, !tbaa !9
  %6 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 1
  %7 = call noundef <4 x float> @_ZN3vox9simd_math11simd_float46z_axisEv()
  store <4 x float> %7, ptr %6, align 16, !tbaa !9
  %8 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 2
  %9 = call noundef <4 x float> @_ZN3vox9simd_math11simd_float46y_axisEv()
  store <4 x float> %9, ptr %8, align 16, !tbaa !9
  %10 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 3
  store float 0.000000e+00, ptr %10, align 16, !tbaa !10
  %11 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 4
  store float 1.000000e+00, ptr %11, align 4, !tbaa !13
  %12 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 5
  store float 1.000000e+00, ptr %12, align 8, !tbaa !14
  %13 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 6
  store ptr null, ptr %13, align 16, !tbaa !15
  %14 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 7
  store ptr null, ptr %14, align 8, !tbaa !16
  %15 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 8
  store ptr null, ptr %15, align 16, !tbaa !17
  %16 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 9
  store ptr null, ptr %16, align 8, !tbaa !18
  %17 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 10
  store ptr null, ptr %17, align 16, !tbaa !19
  %18 = getelementptr inbounds %"struct.vox::animation::IKTwoBoneJob", ptr %3, i32 0, i32 11
  store ptr null, ptr %18, align 8, !tbaa !20
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef <4 x float> @_ZN3vox9simd_math11simd_float44zeroEv() #1

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef <4 x float> @_ZN3vox9simd_math11simd_float46z_axisEv() #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_ZN3vox9simd_math11simd_float46y_axisEv() #2

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="128" "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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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" }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 48}
!11 = !{!"_ZTSN3vox9animation12IKTwoBoneJobE", !7, i64 0, !7, i64 16, !7, i64 32, !12, i64 48, !12, i64 52, !12, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104}
!12 = !{!"float", !7, i64 0}
!13 = !{!11, !12, i64 52}
!14 = !{!11, !12, i64 56}
!15 = !{!11, !6, i64 64}
!16 = !{!11, !6, i64 72}
!17 = !{!11, !6, i64 80}
!18 = !{!11, !6, i64 88}
!19 = !{!11, !6, i64 96}
!20 = !{!11, !6, i64 104}


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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3vox9animation12IKTwoBoneJobC2Ev(ptr nocapture noundef nonnull writeonly align 16 dereferenceable(112) %0) unnamed_addr #0 align 2 {
  %2 = tail call noundef <4 x float> @_ZN3vox9simd_math11simd_float44zeroEv()
  store <4 x float> %2, ptr %0, align 16, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 16
  %4 = tail call noundef <4 x float> @_ZN3vox9simd_math11simd_float46z_axisEv()
  store <4 x float> %4, ptr %3, align 16, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 32
  %6 = tail call noundef <4 x float> @_ZN3vox9simd_math11simd_float46y_axisEv()
  store <4 x float> %6, ptr %5, align 16, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 48
  store <2 x float> <float 0.000000e+00, float 1.000000e+00>, ptr %7, align 16, !tbaa !8
  %8 = getelementptr inbounds i8, ptr %0, i64 56
  store float 1.000000e+00, ptr %8, align 8, !tbaa !10
  %9 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %9, i8 0, i64 48, i1 false)
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef <4 x float> @_ZN3vox9simd_math11simd_float44zeroEv() local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef <4 x float> @_ZN3vox9simd_math11simd_float46z_axisEv() local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef <4 x float> @_ZN3vox9simd_math11simd_float46y_axisEv() local_unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="128" "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 = { alwaysinline mustprogress uwtable "min-legal-vector-width"="128" "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 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="128" "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 nounwind willreturn memory(argmem: write) }

!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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !6, i64 0}
!10 = !{!11, !9, i64 56}
!11 = !{!"_ZTSN3vox9animation12IKTwoBoneJobE", !6, i64 0, !6, i64 16, !6, i64 32, !9, i64 48, !9, i64 52, !9, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104}
!12 = !{!"any pointer", !6, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,TailCallElimPass