//
// cocos2d::CCTime::timersubCocos2d from 0x1003217e0 to 0x10032183b (91 bytes)
//
// 1 xrefs:
// > CCScrollLayerExt::ccTouchEnded @ 0x10042ed30
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
double __fastcall cocos2d::CCTime::timersubCocos2d(cocos2d::cc_timeval *a1, cocos2d::cc_timeval *a2)
{
__m128d v2; // xmm1
double result; // xmm0_8
__m128d v4; // xmm0
__m128d v5; // xmm0
result = 0.0;
if ( a1 != nullptr && a2 != nullptr )
{
v2.f64[0] = (double)(int)a1->tv_sec;
v4 = 0;
v4.f64[0] = (double)(int)a2->tv_sec;
v5 = _mm_add_pd(
_mm_mul_pd(_mm_unpacklo_pd(v4, v2), (__m128d)xmmword_100819A00),
_mm_div_pd(
_mm_cvtepi32_pd(_mm_insert_epi32(_mm_cvtsi32_si128(a2->tv_usec), a1->tv_usec, 1)),
(__m128d)xmmword_100819A00));
return v5.f64[0] - _mm_unpackhi_pd(v5, v5).f64[0];
}
return result;
}