//
// SelectPremadeLayer::init from 0x10006bfac to 0x10006c378 (972 bytes)
//
// 2 xrefs:
// > sub_10006BC2C @ 0x10006bc90
// > ??> @ 0x1008c1ed8
//
// 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:58 +0000
//
__int64 __fastcall SelectPremadeLayer::init(__int64 a1)
{
__int64 result; // x0
__int64 v3; // x0
__int64 v4; // x21
__int64 v5; // x21
__int64 v6; // x0
__int64 v7; // x0
__int64 v8; // x21
__n128 v9; // q0
__int64 v10; // x25
char v11; // w8
char v12; // w21
const std::string::value_type *v13; // x1
std::string *v14; // x0
void *v15; // x0
__int64 v16; // x26
double v17; // d0
void *v18; // x0
__int64 v19; // x21
__int64 v20; // x20
__n128 v21; // q0
unsigned int v22; // [xsp+4h] [xbp-9Ch]
float32x2_t v23; // [xsp+8h] [xbp-98h] BYREF
float32x2_t v24; // [xsp+10h] [xbp-90h] BYREF
std::string v25; // [xsp+18h] [xbp-88h] BYREF
float32x2_t v26; // [xsp+30h] [xbp-70h] BYREF
__int64 v27; // [xsp+38h] [xbp-68h] BYREF
result = FLAlertLayer::init_1(a1, 150);
if ( (_DWORD)result )
{
v22 = result;
v3 = cocos2d::CCDirector::sharedDirector(result);
cocos2d::CCDirector::getWinSize(&v27, v3);
sub_1000262CC((float *)&v25, 0.0, 0.0, 80.0, 80.0);
v4 = cocos2d::extension::CCScale9Sprite::create("GJ_square01.png", &v25);
sub_1000262C4((float *)&v25, 360.0, 260.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v4 + 320LL))(v4, &v25);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v4,
0xFFFFFFFFLL);
sub_1000262BC((float *)&v25, *(float *)&v27 * 0.5, *((float *)&v27 + 1) * 0.5);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v4 + 184LL))(v4, &v25);
v5 = cocos2d::CCLabelBMFont::create_1("Select Premade", "bigFont.fnt");
sub_1000262BC((float *)&v25, *(float *)&v27 * 0.5, (float)((float)(*((float *)&v27 + 1) * 0.5) + 130.0) + -20.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v5 + 184LL))(v5, &v25);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 584) + 456LL))(*(_QWORD *)(a1 + 584), v5);
v6 = (*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v5 + 160LL))(v5, 0.9);
v7 = cocos2d::CCMenu::create(v6);
*(_QWORD *)(a1 + 552) = v7;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(*(_QWORD *)(a1 + 584), v7, 10);
v8 = *(_QWORD *)(a1 + 552);
sub_1000262BC((float *)&v25, *(float *)&v27 * 0.5, (float)((float)(*((float *)&v27 + 1) * 0.5) + 22.5) + 50.0);
cocos2d::CCNode::convertToNodeSpace(&v26, v8, &v25, v9);
v10 = 0;
v11 = 1;
do
{
v12 = v11;
sub_100009900(&v25, "-");
if ( (v10 & 1) != 0 )
v13 = "Homing\nBall";
else
v13 = "Homing\nMissile";
std::string::assign(&v25, v13);
if ( (v25.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v14 = &v25;
else
v14 = (std::string *)v25.__r_.__value_.__r.__words[0];
v15 = ButtonSprite::create_1(
(__int64)v14,
40,
0,
1,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_04.png",
0.8,
30.0);
v16 = CCMenuItemSpriteExtra::create(v15, 0, a1, sub_10006C3A0, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v16);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v16 + 72LL))(v16, v10);
sub_1000262BC((float *)&v23, (float)(110 * v10 - 55), -0.0);
*(float32x2_t *)&v17 = sub_100026318(&v26, &v23, &v24);
(*(void (__fastcall **)(__int64, float32x2_t *, double))(*(_QWORD *)v16 + 184LL))(v16, &v24, v17);
if ( SHIBYTE(v25.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v25.__r_.__value_.__l.__data_);
v11 = 0;
v10 = 1;
}
while ( (v12 & 1) != 0 );
v18 = ButtonSprite::create_1(
(__int64)"Cancel",
40,
0,
1,
(__int64)"goldFont.fnt",
(__int64)"GJ_button_01.png",
0.8,
30.0);
v19 = CCMenuItemSpriteExtra::create(v18, 0, a1, sub_10006C410, 0);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 552) + 456LL))(*(_QWORD *)(a1 + 552), v19);
v20 = *(_QWORD *)(a1 + 552);
sub_1000262BC((float *)&v24, *(float *)&v27 * 0.5, (float)((float)(*((float *)&v27 + 1) * 0.5) + -130.0) + 25.0);
cocos2d::CCNode::convertToNodeSpace(&v25, v20, &v24, v21);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v19 + 184LL))(v19, &v25);
return v22;
}
return result;
}