//
// sub_100526004 from 0x100526004 to 0x100526140 (316 bytes)
//
// 2 xrefs:
// > sub_100526140 @ 0x10052619c
// > sub_1005262B0 @ 0x100526388
//
// 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 11:07:15 +0000
//
_DWORD *__fastcall sub_100526004(__int64 a1, int a2)
{
__int64 v3; // x9
__int64 v4; // x8
_DWORD *v5; // x20
__int64 v6; // x0
float v7; // s0
float v8; // s1
signed int v9; // w8
_BOOL8 v11; // x1
int v13; // [xsp+0h] [xbp-20h] BYREF
int *v14; // [xsp+8h] [xbp-18h] BYREF
v13 = a2;
v3 = *(_QWORD *)(a1 + 536);
if ( !v3 )
goto LABEL_8;
v4 = a1 + 536;
do
{
if ( *(_DWORD *)(v3 + 32) >= a2 )
v4 = v3;
v3 = *(_QWORD *)(v3 + 8LL * (*(_DWORD *)(v3 + 32) < a2));
}
while ( v3 );
if ( v4 != a1 + 536 && *(_DWORD *)(v4 + 32) <= a2 )
return *(_DWORD **)(v4 + 40);
LABEL_8:
v5 = cocos2d::CCNode::create();
sub_1000262BC((float *)&v14, 0.0, 0.0);
(*(void (__fastcall **)(_DWORD *, int **))(*(_QWORD *)v5 + 296LL))(v5, &v14);
(*(void (__fastcall **)(_DWORD *, void *))(*(_QWORD *)v5 + 184LL))(v5, &unk_1009F8580);
v14 = &v13;
*((_QWORD *)sub_1001E7E7C(a1 + 528, &v13, (__int64)&unk_1007705D3, &v14) + 5) = v5;
v6 = *(_QWORD *)(a1 + 416);
if ( v6 )
cocos2d::CCNode::addChild(v6, v5, 0, 0);
v7 = *(float *)(a1 + 436);
v8 = *(float *)(a1 + 520);
v9 = vcvtms_s32_f32((float)(v7 + *(float *)(a1 + 428)) / v8) + 1;
v11 = v13 >= (int)(vcvtms_s32_f32(v7 / v8) - 1) && v13 <= v9;
(*(void (__fastcall **)(_DWORD *, _BOOL8))(*(_QWORD *)v5 + 344LL))(v5, v11);
return v5;
}