//
// FLAlertLayer::init from 0x100493e30 to 0x1004948d9 (2729 bytes)
//
// 1 xrefs:
// > FLAlertLayer::create @ 0x100493cf9
//
// This function is hookable on this platform (idp: pc, 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:30:48 +0000
//
__int64 __fastcall FLAlertLayer::init(
_QWORD *a1,
__int64 a2,
__int64 a3,
__int64 a4,
__int64 a5,
__int64 a6,
float a7,
float a8,
float a9,
char a10)
{
__int64 result; // rax
__int64 v14; // rax
__int64 v15; // rax
__int64 v16; // r14
unsigned __int8 v17; // al
__int64 v18; // rax
__int64 v19; // rax
__int64 v20; // rsi
unsigned int v21; // r13d
float *v22; // r15
double v23; // xmm0_8
float v24; // xmm2_4
__int64 v25; // rax
__int64 v26; // rcx
__int64 v27; // r14
float v28; // xmm1_4
float *v29; // r15
__int64 v30; // rax
__int64 v31; // r13
__int64 v32; // r14
__int64 v33; // rax
void *v34; // r14
__int64 v35; // r12
__int64 v36; // rax
__int64 v37; // rax
__int64 v38; // rax
__int64 v39; // rax
void *v40; // r15
__int64 v41; // rax
void *v42; // r14
float *v43; // rax
__int64 v44; // rax
__int64 v45; // r14
__int64 v46; // rax
double v47; // xmm0_8
__int64 v48; // r14
double v49; // xmm0_8
char *v50; // r12
__int64 v51; // r14
__int64 v52; // r13
unsigned int *v53; // rax
double v54; // xmm0_8
char *v55; // r14
__int64 v56; // [rsp+8h] [rbp-B8h] BYREF
__int64 v57; // [rsp+10h] [rbp-B0h]
__int64 v58; // [rsp+18h] [rbp-A8h]
__int128 v59; // [rsp+20h] [rbp-A0h] BYREF
void *v60; // [rsp+30h] [rbp-90h]
__int128 v61; // [rsp+40h] [rbp-80h] BYREF
void *__p; // [rsp+50h] [rbp-70h]
__int64 v63; // [rsp+58h] [rbp-68h]
__int64 v64; // [rsp+60h] [rbp-60h] BYREF
__int64 v65; // [rsp+68h] [rbp-58h] BYREF
__int64 v66; // [rsp+70h] [rbp-50h] BYREF
unsigned __int64 v67[2]; // [rsp+78h] [rbp-48h] BYREF
unsigned __int8 v68; // [rsp+8Bh] [rbp-35h]
float v69; // [rsp+8Ch] [rbp-34h]
float v70; // [rsp+90h] [rbp-30h]
float v71; // [rsp+94h] [rbp-2Ch]
v71 = a9;
v70 = a8;
v69 = a7;
v57 = a3;
LODWORD(v67[0]) = -1778384896;
result = cocos2d::CCLayerColor::initWithColor(a1, v67);
if ( (_BYTE)result )
{
v63 = a6;
v68 = result;
v14 = GameManager::sharedState();
if ( (unsigned __int8)GameManager::getGameVariable(v14, "0168") )
*((_BYTE *)a1 + 596) = 1;
v58 = a5;
*((float *)a1 + 162) = v69;
*((float *)a1 + 163) = v70;
*((_BYTE *)a1 + 636) = a10;
a1[70] = a2;
*((_BYTE *)a1 + 576) = 0;
if ( !*((_BYTE *)a1 + 644) )
{
*((_BYTE *)a1 + 644) = 1;
v15 = cocos2d::CCDirector::sharedDirector();
v16 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v15 + 160LL))(v15);
v17 = (*(__int64 (__fastcall **)(_QWORD *))(*a1 + 1320LL))(a1);
cocos2d::CCTouchDispatcher::registerForcePrio(v16, a1, 2, v17);
}
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1000LL))(a1, 1);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1072LL))(a1, 1);
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 1088LL))(a1, 1);
v18 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v66, v18);
v19 = cocos2d::CCLayer::create(&v66);
a1[73] = v19;
v20 = v19;
(*(void (__fastcall **)(_QWORD *, __int64))(*a1 + 456LL))(a1, v19);
v21 = EmoteSprite::maxEmotesComment(a1, v20);
if ( *((_BYTE *)a1 + 636) )
{
sub_100278260((float *)v67, 370.0, 180.0);
v70 = *(float *)v67;
sub_100278250((float *)&v64, *(float *)&v66 * 0.5, 0.5 * *((float *)&v66 + 1));
if ( (*(_BYTE *)a4 & 1) != 0 )
{
sub_10001AD30(&v61, *(const void **)(a4 + 16), *(_QWORD *)(a4 + 8));
}
else
{
__p = *(void **)(a4 + 16);
v61 = *(_OWORD *)a4;
}
sub_100278250((float *)&v65, 0.5, 1.0);
v22 = (float *)TextArea::create(
&v61,
(__int64)"chatFont.fnt",
&v65,
0,
v21,
v71,
(float)((float)(v70 + -60.0) * 1.1) / 0.80000001,
20.0);
if ( (v61 & 1) != 0 )
operator delete(__p);
sub_100278250((float *)&v65, 0.5, 0.5);
(*(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v22 + 296LL))(v22, &v65);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v22 + 160LL))(v22, 0.80000001);
(*(void (__fastcall **)(float *, __int64 *))(*(_QWORD *)v22 + 184LL))(v22, &v64);
v23 = *((float *)v67 + 1) * 0.5 + -20.0;
v71 = (float)((float)(v71 * v22[109]) * 0.5) + 10.0;
v24 = 1.2 * v71;
if ( (float)(1.2 * v71) <= v23 )
v24 = v23;
v70 = v24;
sub_100278630(&v65, v67);
sub_1002782D0(&v56, &v64);
v25 = ScrollingLayer::create(&v65, &v56, v70);
a1[78] = v25;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)a1[73] + 464LL))(a1[73], v25, 10);
v26 = a1[78];
*(_QWORD *)(v26 + 600) = a1[73];
(*(void (__fastcall **)(_QWORD, float *))(**(_QWORD **)(v26 + 592) + 456LL))(*(_QWORD *)(v26 + 592), v22);
v27 = a1[78];
sub_100278250((float *)&v65, 0.0, v71 * -0.5);
ScrollingLayer::setStartOffset(v27, &v65);
v28 = 280.0;
v29 = nullptr;
}
else
{
if ( (*(_BYTE *)a4 & 1) != 0 )
{
sub_10001AD30(&v59, *(const void **)(a4 + 16), *(_QWORD *)(a4 + 8));
}
else
{
v60 = *(void **)(a4 + 16);
v59 = *(_OWORD *)a4;
}
sub_100278250((float *)v67, 0.5, 0.5);
v29 = (float *)TextArea::create(
&v59,
(__int64)"chatFont.fnt",
v67,
0,
v21,
1.0,
(float)((float)(v69 + -60.0) * 1.1) / v71,
20.0);
if ( (v59 & 1) != 0 )
operator delete(v60);
(*(void (__fastcall **)(_QWORD, float *, __int64))(*(_QWORD *)a1[73] + 464LL))(a1[73], v29, 3);
v28 = fmaxf((float)(v29[109] * v71) + 120.0, 140.0);
if ( v71 != 1.0 )
{
v30 = *(_QWORD *)v29;
v71 = v28;
(*(void (__fastcall **)(float *))(v30 + 160))(v29);
v28 = v71;
}
}
*((float *)a1 + 163) = v28;
LODWORD(v67[0]) = -16777216;
v71 = v28;
v31 = cocos2d::CCLayerColor::create(v67, v69, v28);
sub_100278250((float *)v67, (float)(*(float *)&v66 - v69) * 0.5, (float)(*((float *)&v66 + 1) - v71) * 0.5);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v31 + 184LL))(v31, v67);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v31 + 344LL))(v31, 0);
LODWORD(v67[0]) = -6908266;
v32 = cocos2d::CCLayerColor::create(v67, v69 + 16.0, v71 + 16.0);
v70 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 192LL))(v31) + -8.0;
v33 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 192LL))(v31);
sub_100278250((float *)v67, v70, *(float *)(v33 + 4) + -8.0);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v32 + 184LL))(v32, v67);
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v32 + 344LL))(v32, 0);
sub_100278270((__int64)v67, 0.0, 0.0, (__m128)0x42BC0000u, (__m128)0x42BC0000u);
v34 = cocos2d::extension::CCScale9Sprite::create_2((__int64)"square01_001.png", v67);
sub_100278260((float *)v67, v69, v71);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v34 + 320LL))(v34, v67);
(*(void (__fastcall **)(_QWORD, void *, __int64))(*(_QWORD *)a1[73] + 464LL))(a1[73], v34, 1);
sub_100278250((float *)v67, *(float *)&v66 * 0.5, *((float *)&v66 + 1) * 0.5);
(*(void (__fastcall **)(void *, unsigned __int64 *))(*(_QWORD *)v34 + 184LL))(v34, v67);
v35 = cocos2d::CCLabelBMFont::create_3(v57, "goldFont.fnt");
sub_100278250((float *)v67, 0.5, 1.0);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v35 + 296LL))(v35, v67);
v70 = *(float *)&v66 * 0.5;
v36 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 192LL))(v31);
sub_100278250((float *)v67, v70, (float)(*(float *)(v36 + 4) + v71) + -15.0);
(*(void (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v35 + 184LL))(v35, v67);
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)a1[73] + 464LL))(a1[73], v35, 3);
cocos2d::CCLabelBMFont::limitLabelWidth(v35, v69 + -30.0, 0.89999998, COERCE_DOUBLE(1053609165));
if ( !*((_BYTE *)a1 + 636) )
{
sub_100278250((float *)v67, 0.5, 0.5);
(*(void (__fastcall **)(float *, unsigned __int64 *))(*(_QWORD *)v29 + 296LL))(v29, v67);
v70 = *(float *)&v66 * 0.5;
v37 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 192LL))(v31);
sub_100278250((float *)v67, v70, (float)((float)(v71 * 0.5) + *(float *)(v37 + 4)) + 5.0);
(*(void (__fastcall **)(float *, unsigned __int64 *))(*(_QWORD *)v29 + 184LL))(v29, v67);
}
v38 = cocos2d::CCMenu::create();
a1[69] = v38;
(*(void (__fastcall **)(_QWORD, __int64, __int64))(*(_QWORD *)a1[73] + 464LL))(a1[73], v38, 2);
v39 = sub_100059E30(v58, 90, 0, 0, 1.0);
a1[76] = v39;
v40 = CCMenuItemSpriteExtra::create(v39, 0, (__int64)a1, (__int64)FLAlertLayer::onButton, 0);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v40 + 72LL))(v40, 0);
v71 = *(float *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[76] + 328LL))(a1[76]) + 0.0;
(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)a1[69] + 456LL))(a1[69], v40);
if ( v63 )
{
v41 = sub_100059E30(v63, 90, 0, 0, 1.0);
a1[77] = v41;
v42 = CCMenuItemSpriteExtra::create(v41, 0, (__int64)a1, (__int64)FLAlertLayer::onButton, 0);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v42 + 72LL))(v42, 1);
v43 = (float *)(*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[77] + 328LL))(a1[77]);
v71 = v71 + *v43;
(*(void (__fastcall **)(_QWORD, void *))(*(_QWORD *)a1[69] + 456LL))(a1[69], v42);
}
else
{
*((_BYTE *)a1 + 637) = 1;
}
if ( (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[69] + 488LL))(a1[69]) )
{
v44 = (*(__int64 (__fastcall **)(_QWORD))(*(_QWORD *)a1[69] + 488LL))(a1[69]);
if ( (unsigned int)sub_1007FEF90(v44) >= 2 )
cocos2d::CCMenu::alignItemsHorizontallyWithPadding(a1[69], fminf((float)(v69 - v71) * 0.5, 15.0));
}
v45 = a1[69];
v69 = *(float *)&v66 * 0.5;
v46 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v31 + 192LL))(v31);
sub_100278250((float *)v67, v69, *(float *)(v46 + 4) + 30.0);
v47 = (*(double (__fastcall **)(__int64, unsigned __int64 *))(*(_QWORD *)v45 + 184LL))(v45, v67);
if ( (unsigned __int8)PlatformToolbox::isControllerConnected(v47) )
{
v48 = a1[73];
*(_QWORD *)&v49 = (unsigned int)v66;
*(float *)&v49 = *(float *)&v66 * 0.5;
sub_100278250((float *)&v64, *(float *)&v66 * 0.5, 0.5 * *((float *)&v66 + 1));
cocos2d::CCNode::convertToNodeSpace((double *)v67, v48, (unsigned int *)&v64);
v50 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_B_001.png", v49);
(*(void (__fastcall **)(_QWORD, char *, __int64))(*(_QWORD *)a1[73] + 464LL))(a1[73], v50, 10);
v51 = a1[73];
v52 = a1[69];
v53 = (unsigned int *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v40 + 192LL))(v40);
cocos2d::CCNode::convertToWorldSpace((double *)&v65, v52, v53);
cocos2d::CCNode::convertToNodeSpace((double *)&v64, v51, (unsigned int *)&v65);
*(_QWORD *)&v54 = LODWORD(v67[0]);
*(float *)&v54 = *(float *)v67 + -116.0;
sub_100278250((float *)&v65, *(float *)v67 + -116.0, *((float *)&v64 + 1));
(*(void (__fastcall **)(char *, __int64 *))(*(_QWORD *)v50 + 184LL))(v50, &v65);
if ( v63 )
{
v55 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"controllerBtn_X_001.png", v54);
(*(void (__fastcall **)(_QWORD, char *, __int64))(*(_QWORD *)a1[73] + 464LL))(a1[73], v55, 10);
sub_100278250((float *)&v65, *(float *)v67 + 116.0, *((float *)&v64 + 1));
(*(void (__fastcall **)(char *, __int64 *))(*(_QWORD *)v55 + 184LL))(v55, &v65);
}
}
*((_DWORD *)a1 + 160) = -1;
return v68;
}
return result;
}