//
// GJPromoPopup::create from 0x8d9adc to 0x8d9cb4 (472 bytes)
//
// 2 xrefs:
// > CreatorLayer::onAdventureMap @ 0x6ca834
// > ??> @ 0x7eaf8
//
// 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 GJPromoPopup::create()
{
__int64 v0; // x19
int v1; // w22
void *v2; // x0
__int64 v3; // x1
__int64 v4; // x0
unsigned int *v6; // x2
int v7; // w1
__int64 v8; // [xsp+50h] [xbp+50h] BYREF
v0 = operator new(0x280u);
cocos2d::CCLayerColor::CCLayerColor((cocos2d::CCLayerColor *)v0);
*(_DWORD *)(v0 + 616) = -1;
*(_DWORD *)(v0 + 624) = -1;
*(_QWORD *)(v0 + 544) = 0;
*(_QWORD *)(v0 + 552) = 0;
*(_QWORD *)(v0 + 560) = 0;
*(_BYTE *)(v0 + 568) = 0;
*(_QWORD *)(v0 + 576) = 0;
*(_DWORD *)(v0 + 584) = 0;
*(_BYTE *)(v0 + 588) = 0;
*(_QWORD *)(v0 + 592) = 0;
*(_QWORD *)(v0 + 600) = 0;
*(_QWORD *)(v0 + 608) = 0;
*(_BYTE *)(v0 + 620) = 0;
*(_BYTE *)(v0 + 621) = 0;
*(_BYTE *)(v0 + 628) = 0;
*(_QWORD *)v0 = &off_119F200;
*(_QWORD *)(v0 + 320) = off_119F720;
*(_QWORD *)(v0 + 328) = &off_119F790;
*(_QWORD *)(v0 + 336) = &off_119F7A8;
*(_QWORD *)(v0 + 344) = &off_119F7C8;
*(_QWORD *)(v0 + 352) = off_119F7E8;
*(_QWORD *)(v0 + 408) = &off_119F810;
*(_QWORD *)(v0 + 432) = &off_119F890;
*(_QWORD *)(v0 + 632) = &byte_124B6C8;
sub_D18D28(&v8);
v1 = (unsigned __int8)GJPromoPopup::init(v0, (__int64)&v8);
v2 = (void *)(v8 - 24);
if ( (__int64 *)(v8 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v6 = (unsigned int *)(v8 - 8);
do
v7 = __ldaxr(v6);
while ( __stlxr(v7 - 1, v6) );
}
else
{
v7 = *(_DWORD *)(v8 - 8);
*(_DWORD *)(v8 - 8) = v7 - 1;
}
if ( v7 <= 0 )
operator delete(v2);
}
if ( v1 )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v0);
}
else
{
v3 = *(_QWORD *)v0;
v4 = v0;
v0 = 0;
(*(void (__fastcall **)(__int64))(v3 + 16))(v4);
}
return v0;
}