//
// LevelTools::posForTimeInternal from 0x72c030 to 0x72c55c (1324 bytes)
//
// 5 xrefs:
// > LevelTools::posForTime @ 0x72c580
// > DrawGridLayer::update @ 0x7873b4
// > DrawGridLayer::draw @ 0x79185c
// > DrawGridLayer::draw @ 0x7922e0
// > ??> @ 0xd6ed0
//
// This function is hookable on this platform (idp: arm, 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 12:52:34 +0000
//
cocos2d::CCPoint *__usercall LevelTools::posForTimeInternal@(
LevelTools *this@,
float a2@,
cocos2d::CCArray *a3@,
unsigned __int8 a4@,
unsigned __int8 a5@,
unsigned __int8 a6@,
_DWORD *a7@,
cocos2d::CCPoint *a8@)
{
int v10; // w19
float v13; // s9
float v14; // s12
unsigned int *v15; // x0
float v16; // s10
char *v18; // x24
__int64 v19; // x23
__int64 v20; // x21
float i; // s13
float v22; // s11
float v23; // s8
float v24; // s1
unsigned int v25; // w28
float v26; // s8
float v27; // s14
float v28; // s15
float v29; // s15
float v30; // s0
int v31; // w1
float v32; // s2
float v33; // s8
float v34; // s1
float v35; // s11
int v36; // s3
long double v37; // q0
bool v38; // w3
int v39; // [xsp+B8h] [xbp+B8h]
int v40; // [xsp+BCh] [xbp+BCh]
char *v41; // [xsp+C0h] [xbp+C0h]
float v43; // [xsp+D0h] [xbp+D0h] BYREF
float v44; // [xsp+D4h] [xbp+D4h]
float v45; // [xsp+D8h] [xbp+D8h] BYREF
float v46; // [xsp+DCh] [xbp+DCh]
char v47[8]; // [xsp+E0h] [xbp+E0h] BYREF
float v48[2]; // [xsp+E8h] [xbp+E8h] BYREF
__int64 v49; // [xsp+F0h] [xbp+F0h] BYREF
v10 = a4;
v40 = a5;
v39 = a6;
if ( a4 )
v13 = 311.58;
else
v13 = LevelTools::valueForSpeedMod((LevelTools *)(unsigned int)a3);
if ( this && (unsigned int)cocos2d::CCArray::count(this) && !v10 )
{
v14 = 1.0;
dword_1548014 = 1.0;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v43, (const cocos2d::CCPoint *)&unk_155C5A8);
*a7 = 0;
byte_155C5A1 = 0;
v15 = *((unsigned int **)this + 7);
byte_155C5A0 = 0;
if ( *v15 )
{
v18 = *((char **)v15 + 2);
v19 = 8LL * *v15 - 8;
v41 = &v18[v19];
if ( v18 <= &v18[v19] )
{
v20 = *(_QWORD *)v18;
if ( *(_QWORD *)v18 )
{
for ( i = 0.0; ; i = v29 )
{
v22 = v13 * v14;
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, (const cocos2d::CCPoint *)(v20 + 1784));
v23 = 0.0;
if ( v48[0] > 0.0 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, (const cocos2d::CCPoint *)(v20 + 1784));
v23 = *(float *)&v49;
}
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, (const cocos2d::CCPoint *)(v20 + 1784));
v24 = 0.0;
if ( v48[1] > 0.0 )
{
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, (const cocos2d::CCPoint *)(v20 + 1784));
v24 = *((float *)&v49 + 1);
}
v25 = (unsigned __int8)byte_155C5A0;
v26 = v23 - v43;
v27 = v24 - v44;
if ( byte_155C5A1 )
{
if ( byte_155C5A0 )
{
if ( v27 > 0.0 )
goto LABEL_67;
LABEL_70:
v27 = 0.0;
LABEL_67:
if ( *(_DWORD *)(v20 + 1776) == *a7 )
{
v28 = fabsf(v27);
}
else
{
LABEL_24:
v27 = 0.0;
v28 = 0.0;
v26 = 0.0;
}
v29 = i + (float)(v28 / v22);
if ( a2 <= v29 )
goto LABEL_46;
goto LABEL_26;
}
if ( v26 < 0.0 )
{
LABEL_23:
if ( *(_DWORD *)(v20 + 1776) != *a7 )
goto LABEL_24;
goto LABEL_45;
}
}
else
{
if ( byte_155C5A0 )
{
if ( v27 >= 0.0 )
goto LABEL_70;
goto LABEL_67;
}
if ( v26 > 0.0 )
goto LABEL_23;
}
v26 = 0.0;
if ( *(_DWORD *)(v20 + 1776) != *a7 )
goto LABEL_24;
LABEL_45:
v29 = i + (float)(fabsf(v26) / v22);
if ( a2 <= v29 )
{
LABEL_46:
v35 = (float)(a2 - i) * v22;
if ( byte_155C5A1 != byte_155C5A0 )
v35 = -v35;
if ( byte_155C5A0 )
{
v44 = v35 + v44;
if ( v40 )
{
LABEL_41:
v43 = 0.0;
goto LABEL_10;
}
}
else
{
v43 = v35 + v43;
if ( v40 )
goto LABEL_9;
}
goto LABEL_10;
}
LABEL_26:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v45, (const cocos2d::CCPoint *)&unk_155C5A8);
switch ( *(_WORD *)(v20 + 1782) )
{
case 0xFFFB:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v47, (const cocos2d::CCPoint *)(v20 + 1900));
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48, (const cocos2d::CCPoint *)(v20 + 1784));
cocos2d::CCPoint::operator-(&v49, v47, v48, v37);
cocos2d::CCPoint::operator=(&v45, &v49);
if ( *(_BYTE *)(v20 + 1889) )
{
v32 = 0.0;
v45 = 0.0;
}
else
{
v32 = v45;
}
if ( *(_BYTE *)(v20 + 1890) )
{
v46 = 0.0;
v31 = (unsigned __int8)byte_155C5A0;
v30 = 0.0;
}
else
{
v30 = v46;
v31 = (unsigned __int8)byte_155C5A0;
}
break;
case 0xFFFC:
if ( *(_BYTE *)(v20 + 1861) )
{
v31 = (unsigned __int8)byte_155C5A0;
}
else
{
v31 = (unsigned int)(*(_DWORD *)(v20 + 1840) - 3) <= 1;
v38 = (*(_DWORD *)(v20 + 1844) & 0xFFFFFFFD) == 1;
byte_155C5A0 = (unsigned int)(*(_DWORD *)(v20 + 1840) - 3) <= 1;
byte_155C5A1 = v38;
}
if ( *(_BYTE *)(v20 + 1860) )
{
*a7 = *(_DWORD *)(v20 + 1864);
*(_BYTE *)(v20 + 1834) = 1;
}
v30 = v46;
v32 = v45;
break;
case 0xFFFD:
goto LABEL_27;
case 0xFFFE:
v36 = *(int *)(v20 + 1764);
v30 = v46;
v31 = (unsigned __int8)byte_155C5A0;
v32 = v45;
dword_1548014 = v36;
if ( !v39 )
v14 = *(float *)&v36;
break;
case 0xFFFF:
v31 = (unsigned __int8)byte_155C5A0;
v30 = v46;
v32 = v45;
byte_155C5A1 ^= 1u;
break;
default:
v13 = LevelTools::valueForSpeedMod((LevelTools *)(unsigned int)*(__int16 *)(v20 + 1782));
LABEL_27:
v30 = v46;
v31 = (unsigned __int8)byte_155C5A0;
v32 = v45;
break;
}
if ( v25 <= (v31 ^ v25) )
v33 = v26 + v43;
else
v33 = v43;
if ( v31 != v25 || v25 )
v34 = v27 + v44;
else
v34 = v44;
v18 += 8;
v43 = v33 + v32;
v44 = v30 + v34;
if ( v41 >= v18 )
{
v20 = *(_QWORD *)v18;
if ( *(_QWORD *)v18 )
continue;
}
v16 = (float)((float)(a2 - v29) * v13) * v14;
if ( v31 != (unsigned __int8)byte_155C5A1 )
v16 = -v16;
if ( v31 )
{
v44 = v44 + v16;
if ( !v40 )
goto LABEL_10;
goto LABEL_41;
}
goto LABEL_8;
}
}
}
}
v16 = v13 * a2;
LABEL_8:
v43 = v43 + v16;
if ( v40 )
LABEL_9:
v44 = 0.0;
LABEL_10:
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v48);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)&v49, v43, v44);
cocos2d::CCPoint::operator=(v48, &v49);
cocos2d::CCPoint::CCPoint(a8, (const cocos2d::CCPoint *)v48);
}
else
{
cocos2d::CCPoint::CCPoint(a8, a2 * v13, 0.0);
}
return a8;
}