//
// sub_140355470 from 0x140355470 to 0x140355557 (231 bytes)
//
// 2 xrefs:
// > GJBaseGameLayer::generateTargetGroups @ 0x14032deeb
// > ??> @ 0x140920894
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:30:49 +0000
//
__int64 __fastcall sub_140355470(float *a1, __int64 a2)
{
float v3; // xmm0_4
float v4; // xmm0_4
unsigned __int64 v5; // rax
__int64 v6; // rcx
unsigned __int64 v7; // rdi
float v8; // xmm0_4
__int64 v9; // rax
float v10; // xmm0_4
__int64 result; // rax
unsigned __int64 v12; // rdx
if ( a2 < 0 )
v3 = (float)(a2 & 1 | (unsigned int)((unsigned __int64)a2 >> 1))
+ (float)(a2 & 1 | (unsigned int)((unsigned __int64)a2 >> 1));
else
v3 = (float)(int)a2;
v4 = ceilf(v3 / *a1);
v5 = 0;
if ( v4 >= 9.223372e18 )
{
v4 = v4 - 9.223372e18;
if ( v4 < 9.223372e18 )
v5 = 0x8000000000000000uLL;
}
v6 = *((_QWORD *)a1 + 2);
v7 = v5 + (unsigned int)(int)v4;
if ( v6 < 0 )
{
v9 = *((_QWORD *)a1 + 2) & 1LL | (*((_QWORD *)a1 + 2) >> 1);
v8 = (float)(int)v9 + (float)(int)v9;
}
else
{
v8 = (float)(int)v6;
}
v10 = ceilf(v8 / *a1);
result = 0;
if ( v10 >= 9.223372e18 )
{
v10 = v10 - 9.223372e18;
if ( v10 < 9.223372e18 )
result = 0x8000000000000000uLL;
}
v12 = result + (unsigned int)(int)v10;
if ( v12 < v7 )
v12 = v7;
if ( v12 > *((_QWORD *)a1 + 7) )
return sub_14003F310(a1, v12);
return result;
}