//
// UpdateAccountSettingsPopup::create from 0x8caa10 to 0x8cb064 (1620 bytes)
//
// 2 xrefs:
// > GJAccountSettingsLayer::onUpdate @ 0x8dcab0
// > ??> @ 0x51cc0
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall UpdateAccountSettingsPopup::create(__int64 a1, unsigned int a2, unsigned int a3, unsigned int a4)
{
__int64 v5; // x19
int v6; // w21
void *v7; // x0
void *v8; // x0
void *v9; // x0
void *v10; // x0
void *v11; // x0
void *v12; // x0
void *v13; // x0
__int64 v14; // x1
__int64 v15; // x0
unsigned int *v17; // x1
int v18; // w2
unsigned int *v19; // x1
int v20; // w2
unsigned int *v21; // x1
int v22; // w2
unsigned int *v23; // x1
int v24; // w2
unsigned int *v25; // x1
int v26; // w2
unsigned int *v27; // x1
int v28; // w2
unsigned int *v29; // x1
int v30; // w2
__int64 v34; // [xsp+B0h] [xbp+90h] BYREF
__int64 v35; // [xsp+B8h] [xbp+98h] BYREF
__int64 v36; // [xsp+C0h] [xbp+A0h] BYREF
__int64 v37; // [xsp+C8h] [xbp+A8h] BYREF
__int64 v38; // [xsp+D0h] [xbp+B0h] BYREF
__int64 v39; // [xsp+D8h] [xbp+B8h] BYREF
__int64 v40; // [xsp+E0h] [xbp+C0h] BYREF
v5 = operator new(0x2A8u);
cocos2d::CCLayerColor::CCLayerColor((cocos2d::CCLayerColor *)v5);
*(_DWORD *)(v5 + 616) = -1;
*(_DWORD *)(v5 + 624) = -1;
*(_QWORD *)(v5 + 544) = 0;
*(_QWORD *)(v5 + 552) = 0;
*(_QWORD *)(v5 + 560) = 0;
*(_BYTE *)(v5 + 568) = 0;
*(_QWORD *)(v5 + 576) = 0;
*(_DWORD *)(v5 + 584) = 0;
*(_BYTE *)(v5 + 588) = 0;
*(_QWORD *)(v5 + 592) = 0;
*(_QWORD *)(v5 + 600) = 0;
*(_QWORD *)(v5 + 608) = 0;
*(_BYTE *)(v5 + 620) = 0;
*(_BYTE *)(v5 + 621) = 0;
*(_BYTE *)(v5 + 628) = 0;
*(_BYTE *)(v5 + 640) = 0;
*(_QWORD *)v5 = &off_1197990;
*(_QWORD *)(v5 + 320) = off_1197EC0;
*(_QWORD *)(v5 + 328) = &off_1197F30;
*(_QWORD *)(v5 + 336) = &off_1197F48;
*(_QWORD *)(v5 + 344) = &off_1197F68;
*(_QWORD *)(v5 + 352) = off_1197F88;
*(_QWORD *)(v5 + 408) = &off_1197FB0;
*(_QWORD *)(v5 + 432) = &off_1198030;
*(_QWORD *)(v5 + 632) = off_1198050;
*(_QWORD *)(v5 + 656) = 0;
*(_QWORD *)(v5 + 664) = 0;
*(_QWORD *)(v5 + 672) = 0;
sub_D18D28(&v34);
sub_D18D28(&v35);
sub_D18D28(&v36);
sub_D18D28(&v37);
sub_D18D28(&v38);
sub_D18D28(&v39);
sub_D18D28(&v40);
v6 = (unsigned __int8)UpdateAccountSettingsPopup::init(v5, a1, a2, a3, a4);
v7 = (void *)(v40 - 24);
if ( (__int64 *)(v40 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v19 = (unsigned int *)(v40 - 8);
do
v20 = __ldaxr(v19);
while ( __stlxr(v20 - 1, v19) );
}
else
{
v20 = *(_DWORD *)(v40 - 8);
*(_DWORD *)(v40 - 8) = v20 - 1;
}
if ( v20 <= 0 )
operator delete(v7);
}
v8 = (void *)(v39 - 24);
if ( (__int64 *)(v39 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v21 = (unsigned int *)(v39 - 8);
do
v22 = __ldaxr(v21);
while ( __stlxr(v22 - 1, v21) );
}
else
{
v22 = *(_DWORD *)(v39 - 8);
*(_DWORD *)(v39 - 8) = v22 - 1;
}
if ( v22 <= 0 )
operator delete(v8);
}
v9 = (void *)(v38 - 24);
if ( (__int64 *)(v38 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v23 = (unsigned int *)(v38 - 8);
do
v24 = __ldaxr(v23);
while ( __stlxr(v24 - 1, v23) );
}
else
{
v24 = *(_DWORD *)(v38 - 8);
*(_DWORD *)(v38 - 8) = v24 - 1;
}
if ( v24 <= 0 )
operator delete(v9);
}
v10 = (void *)(v37 - 24);
if ( (__int64 *)(v37 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v25 = (unsigned int *)(v37 - 8);
do
v26 = __ldaxr(v25);
while ( __stlxr(v26 - 1, v25) );
}
else
{
v26 = *(_DWORD *)(v37 - 8);
*(_DWORD *)(v37 - 8) = v26 - 1;
}
if ( v26 <= 0 )
operator delete(v10);
}
v11 = (void *)(v36 - 24);
if ( (__int64 *)(v36 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v27 = (unsigned int *)(v36 - 8);
do
v28 = __ldaxr(v27);
while ( __stlxr(v28 - 1, v27) );
}
else
{
v28 = *(_DWORD *)(v36 - 8);
*(_DWORD *)(v36 - 8) = v28 - 1;
}
if ( v28 <= 0 )
operator delete(v11);
}
v12 = (void *)(v35 - 24);
if ( (__int64 *)(v35 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v29 = (unsigned int *)(v35 - 8);
do
v30 = __ldaxr(v29);
while ( __stlxr(v30 - 1, v29) );
}
else
{
v30 = *(_DWORD *)(v35 - 8);
*(_DWORD *)(v35 - 8) = v30 - 1;
}
if ( v30 <= 0 )
operator delete(v12);
}
v13 = (void *)(v34 - 24);
if ( (__int64 *)(v34 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v17 = (unsigned int *)(v34 - 8);
do
v18 = __ldaxr(v17);
while ( __stlxr(v18 - 1, v17) );
}
else
{
v18 = *(_DWORD *)(v34 - 8);
*(_DWORD *)(v34 - 8) = v18 - 1;
}
if ( v18 <= 0 )
operator delete(v13);
}
if ( v6 )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v5);
}
else
{
v14 = *(_QWORD *)v5;
v15 = v5;
v5 = 0;
(*(void (__fastcall **)(__int64))(v14 + 16))(v15);
}
return v5;
}