//
// sub_1000308E0 from 0x1000308e0 to 0x1000309c8 (232 bytes)
//
// 1 xrefs:
// > GJMGLayer::scaleGround @ 0x1000308c4
//
// 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 10:57:30 +0000
//
__int64 __fastcall sub_1000308E0(__int64 a1)
{
__int64 result; // x0
__int64 v3; // x0
__int64 v4; // x0
__int64 v5; // x8
void (__fastcall **v6)(_QWORD *); // x8
_QWORD *v7; // x0
float v8; // s0
float v9; // s0
int v10; // w20
int v11; // w21
__int64 v12; // [xsp+8h] [xbp-28h] BYREF
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 512LL))(a1);
if ( result )
{
v3 = cocos2d::CCDirector::sharedDirector(result);
cocos2d::CCDirector::getWinSize(&v12, v3);
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 512LL))(a1);
v5 = *(_QWORD *)a1;
if ( v4 )
{
v6 = (void (__fastcall **)(_QWORD *))(v5 + 136);
v7 = (_QWORD *)a1;
}
else
{
v7 = (_QWORD *)(*(__int64 (__fastcall **)(__int64))(v5 + 512))(a1);
v6 = (void (__fastcall **)(_QWORD *))(*v7 + 168LL);
}
(*v6)(v7);
v8 = (*(float (__fastcall **)(__int64))(*(_QWORD *)a1 + 136LL))(a1);
v9 = (float)(*(float *)&v12 / v8) + 10.0;
*(float *)(a1 + 444) = v9;
v10 = (int)(float)(ceilf(v9 / *(float *)(a1 + 424)) + 1.0);
v11 = *(unsigned __int8 *)(a1 + 456);
sub_100030518(a1, v10 + v11, 1);
return sub_100030518(a1, v10 + v11, 0);
}
return result;
}