; LLVM IR from dtecta/motion-toolkit :: jointlimits (SwingTwistJointLimits)

; 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.mt::Vector4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.mt::Vector3" = type { float, float, float }
%"class.mt::Vector4.0" = type { %"class.mt::Dual", %"class.mt::Dual", %"class.mt::Dual", %"class.mt::Dual" }
%"class.mt::Dual" = type { float, float }
%struct.anon = type { float, float, float, float }
%"class.ik::SwingTwistJointLimits" = type { %"class.ik::JointLimits", %"class.mt::Interval", %"class.ik::Ellipse" }
%"class.ik::JointLimits" = type { ptr }
%"class.mt::Interval" = type { float, float }
%"class.ik::Ellipse" = type { float, float }

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

; 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) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK2ik21SwingTwistJointLimits5boundERN2mt7Vector4INS1_4DualIfEEEE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(32) %1) unnamed_addr #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"class.mt::Vector4", align 16
  %6 = alloca %"class.mt::Vector3", align 4
  %7 = alloca { <2 x float>, float }, align 8
  %8 = alloca %"class.mt::Vector4", align 16
  %9 = alloca float, align 4
  %10 = alloca float, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca float, align 4
  %14 = alloca %"class.mt::Vector4", align 16
  %15 = alloca %"class.mt::Vector4", align 16
  %16 = alloca %"class.mt::Vector4", align 16
  %17 = alloca %"class.mt::Vector4.0", align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %18 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #10
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = call { double, double } @_ZN2mt8rotationIfEENS_7Vector4IT_EERKNS1_INS_4DualIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(32) %19)
  %21 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %22 = getelementptr inbounds %union.anon, ptr %21, i32 0, i32 0
  %23 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 0
  %24 = extractvalue { double, double } %20, 0
  store double %24, ptr %23, align 16
  %25 = getelementptr inbounds { double, double }, ptr %22, i32 0, i32 1
  %26 = extractvalue { double, double } %20, 1
  store double %26, ptr %25, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #10
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = call { <2 x float>, float } @_ZN2mt11translationIfEENS_7Vector3IT_EERKNS_7Vector4INS_4DualIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(32) %27)
  store { <2 x float>, float } %28, ptr %7, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %6, ptr align 8 %7, i64 12, i1 false)
  %29 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %30 = getelementptr inbounds %struct.anon, ptr %29, i32 0, i32 3
  %31 = load float, ptr %30, align 4, !tbaa !9
  %32 = call noundef zeroext i1 @_ZN2mt10isnegativeEf(float noundef %31)
  br i1 %32, label %33, label %42

33:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #10
  %34 = call { double, double } @_ZN2mtngERKNS_7Vector4IfEE(ptr noundef nonnull align 16 dereferenceable(16) %5)
  %35 = getelementptr inbounds %"class.mt::Vector4", ptr %8, i32 0, i32 0
  %36 = getelementptr inbounds %union.anon, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 0
  %38 = extractvalue { double, double } %34, 0
  store double %38, ptr %37, align 16
  %39 = getelementptr inbounds { double, double }, ptr %36, i32 0, i32 1
  %40 = extractvalue { double, double } %34, 1
  store double %40, ptr %39, align 8
  %41 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN2mt7Vector4IfEaSERKS1_(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #10
  br label %42

42:                                               ; preds = %33, %2
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #10
  %43 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %44 = getelementptr inbounds %struct.anon, ptr %43, i32 0, i32 0
  %45 = load float, ptr %44, align 16, !tbaa !9
  %46 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %47 = getelementptr inbounds %struct.anon, ptr %46, i32 0, i32 0
  %48 = load float, ptr %47, align 16, !tbaa !9
  %49 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %50 = getelementptr inbounds %struct.anon, ptr %49, i32 0, i32 3
  %51 = load float, ptr %50, align 4, !tbaa !9
  %52 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %53 = getelementptr inbounds %struct.anon, ptr %52, i32 0, i32 3
  %54 = load float, ptr %53, align 4, !tbaa !9
  %55 = fmul float %51, %54
  %56 = call float @llvm.fmuladd.f32(float %45, float %48, float %55)
  store float %56, ptr %12, align 4, !tbaa !10
  %57 = load float, ptr %12, align 4, !tbaa !10
  %58 = call noundef zeroext i1 @_ZN2mt6iszeroEf(float noundef %57)
  br i1 %58, label %59, label %66

59:                                               ; preds = %42
  store float 0.000000e+00, ptr %9, align 4, !tbaa !10
  %60 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %61 = getelementptr inbounds %struct.anon, ptr %60, i32 0, i32 1
  %62 = load float, ptr %61, align 4, !tbaa !9
  store float %62, ptr %10, align 4, !tbaa !10
  %63 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %64 = getelementptr inbounds %struct.anon, ptr %63, i32 0, i32 2
  %65 = load float, ptr %64, align 8, !tbaa !9
  store float %65, ptr %11, align 4, !tbaa !10
  br label %107

66:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  %67 = load float, ptr %12, align 4, !tbaa !10
  %68 = call noundef float @_ZN2mt5rsqrtIfEET_S1_(float noundef %67)
  store float %68, ptr %13, align 4, !tbaa !10
  %69 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %70 = getelementptr inbounds %struct.anon, ptr %69, i32 0, i32 0
  %71 = load float, ptr %70, align 16, !tbaa !9
  %72 = load float, ptr %13, align 4, !tbaa !10
  %73 = fmul float %71, %72
  store float %73, ptr %9, align 4, !tbaa !10
  %74 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %75 = getelementptr inbounds %struct.anon, ptr %74, i32 0, i32 3
  %76 = load float, ptr %75, align 4, !tbaa !9
  %77 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %78 = getelementptr inbounds %struct.anon, ptr %77, i32 0, i32 1
  %79 = load float, ptr %78, align 4, !tbaa !9
  %80 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %81 = getelementptr inbounds %struct.anon, ptr %80, i32 0, i32 0
  %82 = load float, ptr %81, align 16, !tbaa !9
  %83 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %84 = getelementptr inbounds %struct.anon, ptr %83, i32 0, i32 2
  %85 = load float, ptr %84, align 8, !tbaa !9
  %86 = fmul float %82, %85
  %87 = fneg float %86
  %88 = call float @llvm.fmuladd.f32(float %76, float %79, float %87)
  %89 = load float, ptr %13, align 4, !tbaa !10
  %90 = fmul float %88, %89
  store float %90, ptr %10, align 4, !tbaa !10
  %91 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %92 = getelementptr inbounds %struct.anon, ptr %91, i32 0, i32 3
  %93 = load float, ptr %92, align 4, !tbaa !9
  %94 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %95 = getelementptr inbounds %struct.anon, ptr %94, i32 0, i32 2
  %96 = load float, ptr %95, align 8, !tbaa !9
  %97 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %98 = getelementptr inbounds %struct.anon, ptr %97, i32 0, i32 0
  %99 = load float, ptr %98, align 16, !tbaa !9
  %100 = getelementptr inbounds %"class.mt::Vector4", ptr %5, i32 0, i32 0
  %101 = getelementptr inbounds %struct.anon, ptr %100, i32 0, i32 1
  %102 = load float, ptr %101, align 4, !tbaa !9
  %103 = fmul float %99, %102
  %104 = call float @llvm.fmuladd.f32(float %93, float %96, float %103)
  %105 = load float, ptr %13, align 4, !tbaa !10
  %106 = fmul float %104, %105
  store float %106, ptr %11, align 4, !tbaa !10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %107

107:                                              ; preds = %66, %59
  %108 = load float, ptr %9, align 4, !tbaa !10
  %109 = getelementptr inbounds %"class.ik::SwingTwistJointLimits", ptr %18, i32 0, i32 1
  %110 = call noundef float @_ZN2mt5clampIfEET_S1_RKNS_8IntervalIS1_EE(float noundef %108, ptr noundef nonnull align 4 dereferenceable(8) %109)
  store float %110, ptr %9, align 4, !tbaa !10
  %111 = getelementptr inbounds %"class.ik::SwingTwistJointLimits", ptr %18, i32 0, i32 2
  call void @_ZNK2ik7Ellipse5clampERfS1_i(ptr noundef nonnull align 4 dereferenceable(8) %111, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef 50)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #10
  %112 = load float, ptr %9, align 4, !tbaa !10
  %113 = load float, ptr %9, align 4, !tbaa !10
  %114 = load float, ptr %9, align 4, !tbaa !10
  %115 = fneg float %113
  %116 = call float @llvm.fmuladd.f32(float %115, float %114, float 1.000000e+00)
  %117 = call noundef float @_ZN2mt3maxIfEET_S1_S1_(float noundef 0.000000e+00, float noundef %116)
  %118 = call noundef float @_ZSt4sqrtf(float noundef %117)
  call void @_ZN2mt7Vector4IfEC2Effff(ptr noundef nonnull align 16 dereferenceable(16) %14, float noundef %112, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %118)
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #10
  %119 = load float, ptr %10, align 4, !tbaa !10
  %120 = load float, ptr %11, align 4, !tbaa !10
  %121 = load float, ptr %10, align 4, !tbaa !10
  %122 = load float, ptr %10, align 4, !tbaa !10
  %123 = fneg float %121
  %124 = call float @llvm.fmuladd.f32(float %123, float %122, float 1.000000e+00)
  %125 = load float, ptr %11, align 4, !tbaa !10
  %126 = load float, ptr %11, align 4, !tbaa !10
  %127 = fneg float %125
  %128 = call float @llvm.fmuladd.f32(float %127, float %126, float %124)
  %129 = call noundef float @_ZN2mt3maxIfEET_S1_S1_(float noundef 0.000000e+00, float noundef %128)
  %130 = call noundef float @_ZSt4sqrtf(float noundef %129)
  call void @_ZN2mt7Vector4IfEC2Effff(ptr noundef nonnull align 16 dereferenceable(16) %15, float noundef 0.000000e+00, float noundef %119, float noundef %120, float noundef %130)
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #10
  %131 = call { double, double } @_ZN2mt3mulIffEENS_7Vector4INS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 16 dereferenceable(16) %15, ptr noundef nonnull align 16 dereferenceable(16) %14)
  %132 = getelementptr inbounds %"class.mt::Vector4", ptr %16, i32 0, i32 0
  %133 = getelementptr inbounds %union.anon, ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds { double, double }, ptr %133, i32 0, i32 0
  %135 = extractvalue { double, double } %131, 0
  store double %135, ptr %134, align 16
  %136 = getelementptr inbounds { double, double }, ptr %133, i32 0, i32 1
  %137 = extractvalue { double, double } %131, 1
  store double %137, ptr %136, align 8
  %138 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN2mt7Vector4IfEaSERKS1_(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) %16)
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #10
  call void @llvm.lifetime.start.p0(i64 32, ptr %17) #10
  call void @_ZN2mt5rigidIfEENS_7Vector4INS_4DualIT_EEEERKNS1_IS3_EERKNS_7Vector3IS3_EE(ptr dead_on_unwind writable sret(%"class.mt::Vector4.0") align 4 %17, ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(12) %6)
  %139 = load ptr, ptr %4, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %139, ptr align 4 %17, i64 32, i1 false), !tbaa.struct !12
  call void @llvm.lifetime.end.p0(i64 32, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #10
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN2mt8rotationIfEENS_7Vector4IT_EERKNS1_INS_4DualIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(32)) #3

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2mt10isnegativeEf(float noundef) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN2mtngERKNS_7Vector4IfEE(ptr noundef nonnull align 16 dereferenceable(16)) #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN2mt7Vector4IfEaSERKS1_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #6 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2mt6iszeroEf(float noundef) #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN2mt5rsqrtIfEET_S1_(float noundef) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN2mt5clampIfEET_S1_RKNS_8IntervalIS1_EE(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) #3

declare void @_ZNK2ik7Ellipse5clampERfS1_i(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) #9

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN2mt3maxIfEET_S1_S1_(float noundef, float noundef) #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mt7Vector4IfEC2Effff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN2mt3mulIffEENS_7Vector4INS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mt5rigidIfEENS_7Vector4INS_4DualIT_EEEERKNS1_IS3_EERKNS_7Vector3IS3_EE(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector4.0") align 4, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12)) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { alwaysinline 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 = { alwaysinline 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 = { 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 #6 = { alwaysinline 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { "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 #9 = { 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 #10 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10, i64 12, i64 4, !10, i64 16, i64 4, !10, i64 20, i64 4, !10, i64 24, i64 4, !10, i64 28, i64 4, !10}


; 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.mt::Vector4" = type { %union.anon }
%union.anon = type { <4 x float> }
%"class.mt::Vector3" = type { float, float, float }
%"class.mt::Vector4.0" = type { %"class.mt::Dual", %"class.mt::Dual", %"class.mt::Dual", %"class.mt::Dual" }
%"class.mt::Dual" = type { float, float }

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

; Function Attrs: mustprogress 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) #1

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK2ik21SwingTwistJointLimits5boundERN2mt7Vector4INS1_4DualIfEEEE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 4 dereferenceable(32) %1) unnamed_addr #2 align 2 {
  %3 = alloca %"class.mt::Vector4", align 16
  %4 = alloca %"class.mt::Vector3", align 8
  %5 = alloca %"class.mt::Vector4", align 16
  %6 = alloca float, align 4
  %7 = alloca float, align 4
  %8 = alloca %"class.mt::Vector4", align 16
  %9 = alloca %"class.mt::Vector4", align 16
  %10 = alloca %"class.mt::Vector4", align 16
  %11 = alloca %"class.mt::Vector4.0", align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #11
  %12 = tail call { double, double } @_ZN2mt8rotationIfEENS_7Vector4IT_EERKNS1_INS_4DualIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(32) %1)
  %13 = extractvalue { double, double } %12, 0
  store double %13, ptr %3, align 16
  %14 = getelementptr inbounds i8, ptr %3, i64 8
  %15 = extractvalue { double, double } %12, 1
  store double %15, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #11
  %16 = tail call { <2 x float>, float } @_ZN2mt11translationIfEENS_7Vector3IT_EERKNS_7Vector4INS_4DualIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(32) %1)
  %.fca.0.extract = extractvalue { <2 x float>, float } %16, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %16, 1
  store <2 x float> %.fca.0.extract, ptr %4, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 8
  store float %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %17 = bitcast double %15 to i64
  %18 = lshr i64 %17, 32
  %19 = trunc nuw i64 %18 to i32
  %20 = bitcast i32 %19 to float
  %21 = tail call noundef zeroext i1 @_ZN2mt10isnegativeEf(float noundef %20)
  %22 = bitcast double %13 to i64
  %23 = trunc i64 %22 to i32
  %24 = bitcast i32 %23 to float
  br i1 %21, label %25, label %32

25:                                               ; preds = %2
  %26 = getelementptr inbounds i8, ptr %3, i64 12
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #11
  %27 = call { double, double } @_ZN2mtngERKNS_7Vector4IfEE(ptr noundef nonnull align 16 dereferenceable(16) %3)
  %28 = extractvalue { double, double } %27, 0
  store double %28, ptr %5, align 16
  %29 = getelementptr inbounds i8, ptr %5, i64 8
  %30 = extractvalue { double, double } %27, 1
  store double %30, ptr %29, align 8
  %31 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN2mt7Vector4IfEaSERKS1_(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) %5)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #11
  %.pre = load float, ptr %3, align 16, !tbaa !5
  %.pre13 = load float, ptr %26, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %25, %2
  %33 = phi float [ %.pre13, %25 ], [ %20, %2 ]
  %34 = phi float [ %.pre, %25 ], [ %24, %2 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #11
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #11
  %35 = fmul float %33, %33
  %36 = call float @llvm.fmuladd.f32(float %34, float %34, float %35)
  %37 = call noundef zeroext i1 @_ZN2mt6iszeroEf(float noundef %36)
  br i1 %37, label %38, label %41

38:                                               ; preds = %32
  %39 = getelementptr inbounds i8, ptr %3, i64 4
  %40 = load <2 x float>, ptr %39, align 4, !tbaa !5
  br label %58

41:                                               ; preds = %32
  %42 = call noundef float @_ZN2mt5rsqrtIfEET_S1_(float noundef %36)
  %43 = load float, ptr %3, align 16, !tbaa !5
  %44 = fmul float %42, %43
  %45 = load <4 x float>, ptr %3, align 16
  %46 = getelementptr inbounds i8, ptr %3, i64 4
  %47 = fneg float %43
  %48 = load <2 x float>, ptr %46, align 4, !tbaa !5
  %49 = insertelement <2 x float> poison, float %43, i64 0
  %50 = insertelement <2 x float> %49, float %47, i64 1
  %51 = fmul <2 x float> %48, %50
  %52 = shufflevector <2 x float> %51, <2 x float> poison, <2 x i32> <i32 1, i32 0>
  %53 = shufflevector <4 x float> %45, <4 x float> poison, <2 x i32> <i32 3, i32 3>
  %54 = call <2 x float> @llvm.fmuladd.v2f32(<2 x float> %53, <2 x float> %48, <2 x float> %52)
  %55 = insertelement <2 x float> poison, float %42, i64 0
  %56 = shufflevector <2 x float> %55, <2 x float> poison, <2 x i32> zeroinitializer
  %57 = fmul <2 x float> %56, %54
  br label %58

58:                                               ; preds = %41, %38
  %.0 = phi float [ 0.000000e+00, %38 ], [ %44, %41 ]
  %59 = phi <2 x float> [ %40, %38 ], [ %57, %41 ]
  %60 = extractelement <2 x float> %59, i64 0
  store float %60, ptr %6, align 4
  %61 = extractelement <2 x float> %59, i64 1
  store float %61, ptr %7, align 4, !tbaa !8
  %62 = getelementptr inbounds i8, ptr %0, i64 8
  %63 = call noundef float @_ZN2mt5clampIfEET_S1_RKNS_8IntervalIS1_EE(float noundef %.0, ptr noundef nonnull align 4 dereferenceable(8) %62)
  %64 = getelementptr inbounds i8, ptr %0, i64 16
  call void @_ZNK2ik7Ellipse5clampERfS1_i(ptr noundef nonnull align 4 dereferenceable(8) %64, ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7, i32 noundef 50)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #11
  %65 = fneg float %63
  %66 = call float @llvm.fmuladd.f32(float %65, float %63, float 1.000000e+00)
  %67 = call noundef float @_ZN2mt3maxIfEET_S1_S1_(float noundef 0.000000e+00, float noundef %66)
  %68 = call noundef float @_ZSt4sqrtf(float noundef %67)
  call void @_ZN2mt7Vector4IfEC2Effff(ptr noundef nonnull align 16 dereferenceable(16) %8, float noundef %63, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef %68)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #11
  %69 = load float, ptr %6, align 4, !tbaa !8
  %70 = load float, ptr %7, align 4, !tbaa !8
  %71 = fneg float %69
  %72 = call float @llvm.fmuladd.f32(float %71, float %69, float 1.000000e+00)
  %73 = fneg float %70
  %74 = call float @llvm.fmuladd.f32(float %73, float %70, float %72)
  %75 = call noundef float @_ZN2mt3maxIfEET_S1_S1_(float noundef 0.000000e+00, float noundef %74)
  %76 = call noundef float @_ZSt4sqrtf(float noundef %75)
  call void @_ZN2mt7Vector4IfEC2Effff(ptr noundef nonnull align 16 dereferenceable(16) %9, float noundef 0.000000e+00, float noundef %69, float noundef %70, float noundef %76)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #11
  %77 = call { double, double } @_ZN2mt3mulIffEENS_7Vector4INS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 16 dereferenceable(16) %9, ptr noundef nonnull align 16 dereferenceable(16) %8)
  %78 = extractvalue { double, double } %77, 0
  store double %78, ptr %10, align 16
  %79 = getelementptr inbounds i8, ptr %10, i64 8
  %80 = extractvalue { double, double } %77, 1
  store double %80, ptr %79, align 8
  %81 = call noundef nonnull align 16 dereferenceable(16) ptr @_ZN2mt7Vector4IfEaSERKS1_(ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 16 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #11
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #11
  call void @_ZN2mt5rigidIfEENS_7Vector4INS_4DualIT_EEEERKNS1_IS3_EERKNS_7Vector3IS3_EE(ptr dead_on_unwind nonnull writable sret(%"class.mt::Vector4.0") align 4 %11, ptr noundef nonnull align 16 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(32) %1, ptr noundef nonnull align 4 dereferenceable(32) %11, i64 32, i1 false), !tbaa.struct !10
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #11
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #11
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #11
  ret void
}

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN2mt8rotationIfEENS_7Vector4IT_EERKNS1_INS_4DualIS2_EEEE(ptr noundef nonnull align 4 dereferenceable(32)) local_unnamed_addr #3

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

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN2mt10isnegativeEf(float noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN2mtngERKNS_7Vector4IfEE(ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #5

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef nonnull align 16 dereferenceable(16) ptr @_ZN2mt7Vector4IfEaSERKS1_(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #6 align 2

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

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN2mt6iszeroEf(float noundef) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN2mt5rsqrtIfEET_S1_(float noundef) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local noundef float @_ZN2mt5clampIfEET_S1_RKNS_8IntervalIS1_EE(float noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3

declare void @_ZNK2ik7Ellipse5clampERfS1_i(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #8

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt4sqrtf(float noundef) local_unnamed_addr #9

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare dso_local noundef float @_ZN2mt3maxIfEET_S1_S1_(float noundef, float noundef) local_unnamed_addr #6

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mt7Vector4IfEC2Effff(ptr noundef nonnull align 16 dereferenceable(16), float noundef, float noundef, float noundef, float noundef) unnamed_addr #5 align 2

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local { double, double } @_ZN2mt3mulIffEENS_7Vector4INS_7PromoteIT_T0_E2RTEEERKNS1_IS3_EERKNS1_IS4_EE(ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 16 dereferenceable(16)) local_unnamed_addr #3

; Function Attrs: alwaysinline mustprogress uwtable
declare dso_local void @_ZN2mt5rigidIfEENS_7Vector4INS_4DualIT_EEEERKNS1_IS3_EERKNS_7Vector3IS3_EE(ptr dead_on_unwind noalias writable sret(%"class.mt::Vector4.0") align 4, ptr noundef nonnull align 16 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fmuladd.v2f32(<2 x float>, <2 x float>, <2 x float>) #10

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 = { alwaysinline 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 = { alwaysinline 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 = { 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 #6 = { alwaysinline 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 #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { "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 #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { 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"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !6, i64 0}
!10 = !{i64 0, i64 4, !8, i64 4, i64 4, !8, i64 8, i64 4, !8, i64 12, i64 4, !8, i64 16, i64 4, !8, i64 20, i64 4, !8, i64 24, i64 4, !8, i64 28, i64 4, !8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,MergedLoadStoreMotionPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,TailCallElimPass,VectorCombinePass