//
// sub_1000301B0 from 0x1000301b0 to 0x1000304d8 (808 bytes)
//
// 1 xrefs:
// > sub_1000300E0 @ 0x100030164
//
// 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_1000301B0(__int64 a1, __int64 a2)
{
__int64 v4; // x19
__int64 v5; // x0
__int64 v6; // x0
_QWORD *WinSize; // x0
int v8; // s0
__int64 v9; // x0
char *v10; // x0
void **v11; // x0
__int64 v12; // x0
float v13; // s8
float v14; // s9
__int64 v15; // x0
_BYTE *v16; // x21
__int64 v17; // x21
__int64 v18; // x0
__int64 CString; // x0
__int64 v20; // x0
float v21; // s8
__int64 v22; // x0
float v23; // s9
__int64 v24; // x0
_BYTE *v25; // x22
__int64 v26; // x22
__int64 v28; // [xsp+14h] [xbp-6Ch] BYREF
__int64 v29; // [xsp+1Ch] [xbp-64h] BYREF
__int64 v30; // [xsp+24h] [xbp-5Ch] BYREF
unsigned __int16 v31; // [xsp+2Ch] [xbp-54h] BYREF
unsigned __int8 v32; // [xsp+2Eh] [xbp-52h]
void *__p[2]; // [xsp+30h] [xbp-50h] BYREF
char v34; // [xsp+47h] [xbp-39h]
__int64 v35; // [xsp+48h] [xbp-38h] BYREF
v4 = cocos2d::CCLayer::init();
if ( (_DWORD)v4 )
{
v5 = (*(__int64 (__fastcall **)(__int64, void *))(*(_QWORD *)a1 + 320LL))(a1, &unk_1009F2598);
v6 = cocos2d::CCDirector::sharedDirector(v5);
WinSize = cocos2d::CCDirector::getWinSize(&v35, v6);
v8 = 0;
if ( (unsigned int)(a2 - 1) <= 2 )
v8 = dword_10075C710[(unsigned int)(a2 - 1)];
*(_DWORD *)(a1 + 484) = v8;
v9 = GameManager::sharedState(WinSize);
v10 = (char *)sub_1003B5A58(v9, a2);
sub_100009900(__p, v10);
*(_BYTE *)(a1 + 440) = 0;
v32 = -1;
v31 = 26112;
if ( v34 >= 0 )
v11 = __p;
else
v11 = (void **)__p[0];
*(_QWORD *)(a1 + 464) = cocos2d::CCSpriteBatchNode::create(v11, 29);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 464LL))(a1);
v12 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 464) + 896LL))(*(_QWORD *)(a1 + 464));
(*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)v12 + 144LL))(&v30);
v13 = *(float *)&v30;
*(_DWORD *)(a1 + 424) = v30;
v14 = *(float *)&v35;
v15 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 464) + 896LL))(*(_QWORD *)(a1 + 464));
v16 = (_BYTE *)cocos2d::CCSprite::createWithTexture(v15, &unk_1009F25A0);
*(_QWORD *)(a1 + 408) = v16;
v16[559] = 1;
sub_1000262BC((float *)&v29, 0.0, 0.0);
(*(void (__fastcall **)(_BYTE *, __int64 *))(*(_QWORD *)v16 + 184LL))(v16, &v29);
(*(void (__fastcall **)(_QWORD, unsigned __int16 *))(**(_QWORD **)(a1 + 408) + 960LL))(*(_QWORD *)(a1 + 408), &v31);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 464) + 456LL))(
*(_QWORD *)(a1 + 464),
*(_QWORD *)(a1 + 408));
v17 = (unsigned int)(int)(float)(ceilf(v14 / v13) + 1.0);
sub_100030518(a1, v17, 1);
sub_1000306D4(a1, v31 | ((unsigned __int64)v32 << 16), 1);
v18 = sub_1003065B0("fg_%02d_2_001.png", a2);
CString = cocos2d::CCString::getCString(v18);
*(_QWORD *)(a1 + 472) = cocos2d::CCSpriteBatchNode::create(CString, 29);
(*(void (__fastcall **)(__int64))(*(_QWORD *)a1 + 464LL))(a1);
v20 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 464) + 896LL))(*(_QWORD *)(a1 + 464));
(*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)v20 + 144LL))(&v29);
v21 = *((float *)&v29 + 1);
v22 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 472) + 896LL))(*(_QWORD *)(a1 + 472));
(*(void (__fastcall **)(__int64 *__return_ptr))(*(_QWORD *)v22 + 144LL))(&v28);
v23 = *((float *)&v28 + 1);
v24 = (*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 472) + 896LL))(*(_QWORD *)(a1 + 472));
v25 = (_BYTE *)cocos2d::CCSprite::createWithTexture(v24, &unk_1009F25A0);
*(_QWORD *)(a1 + 416) = v25;
v25[559] = 1;
sub_1000262BC((float *)&v29, 0.0, 0.0);
(*(void (__fastcall **)(_BYTE *, __int64 *))(*(_QWORD *)v25 + 184LL))(v25, &v29);
(*(void (__fastcall **)(_QWORD, unsigned __int16 *))(**(_QWORD **)(a1 + 416) + 960LL))(*(_QWORD *)(a1 + 416), &v31);
(*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 472) + 456LL))(
*(_QWORD *)(a1 + 472),
*(_QWORD *)(a1 + 416));
v26 = *(_QWORD *)(a1 + 472);
sub_1000262BC((float *)&v29, 0.0, v21 - v23);
(*(void (__fastcall **)(__int64, __int64 *))(*(_QWORD *)v26 + 184LL))(v26, &v29);
sub_100030518(a1, v17, 0);
sub_1000306D4(a1, v31 | ((unsigned __int64)v32 << 16), 0);
if ( v34 < 0 )
operator delete(__p[0]);
}
return v4;
}