//
// sub_1002A4500 from 0x1002a4500 to 0x1002a4772 (626 bytes)
//
// 1 xrefs:
// > sub_1002A42C0 @ 0x1002a448e
//
// 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:27:55 +0000
//
__int64 __fastcall sub_1002A4500(__int64 a1, const std::string *a2)
{
std::string *v3; // rdi
__int64 v4; // rax
__int64 v5; // rsi
__int64 result; // rax
unsigned int v7; // r12d
__int64 v8; // rsi
__int64 v9; // rax
__int64 v10; // rdi
char *v11; // r14
double v12; // xmm0_8
char *v13; // rax
void *v14; // rax
int v15; // r15d
int v16; // edx
int v17; // ecx
int v18; // r8d
int v19; // r9d
__int64 v20; // r15
float v21[2]; // [rsp+4h] [rbp-3Ch] BYREF
float v22; // [rsp+Ch] [rbp-34h]
float v23; // [rsp+10h] [rbp-30h] BYREF
float v24; // [rsp+14h] [rbp-2Ch]
float v25; // [rsp+18h] [rbp-28h]
float v26; // [rsp+1Ch] [rbp-24h]
v3 = (std::string *)(a1 + 664);
std::string::operator=(v3, a2);
v4 = cocos2d::CCTextureCache::sharedTextureCache(v3);
if ( (*(_BYTE *)(a1 + 664) & 1) != 0 )
v5 = *(_QWORD *)(a1 + 680);
else
v5 = a1 + 665;
cocos2d::CCTextureCache::addImage(v4, v5, 0);
FLAlertLayer::incrementForcePrio(a1);
v23 = -1.1641532e-10;
result = cocos2d::CCLayerColor::initWithColor(a1, &v23);
if ( (_BYTE)result )
{
v7 = result;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1000LL))(a1, 1);
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 1072LL))(a1, 1);
v8 = cocos2d::CCDirector::sharedDirector(a1, 1);
cocos2d::CCDirector::getWinSize(&v23, v8);
v9 = cocos2d::CCLayer::create();
*(_QWORD *)(a1 + 584) = v9;
(*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)a1 + 456LL))(a1, v9);
if ( (*(_BYTE *)(a1 + 664) & 1) != 0 )
v10 = *(_QWORD *)(a1 + 680);
else
v10 = a1 + 665;
v11 = cocos2d::CCSprite::create_1(v10);
(*(void (__fastcall **)(_QWORD, char *, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
v11,
0xFFFFFFFFLL);
sub_100278250(v21, v23 * 0.5, v24 * 0.5);
v12 = (*(double (__fastcall **)(char *, float *))(*(_QWORD *)v11 + 184LL))(v11, v21);
*(_DWORD *)(a1 + 640) = -1;
v13 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_closeBtn_001.png", v12);
v14 = CCMenuItemSpriteExtra::create((__int64)v13, 0, a1, (__int64)GJPromoPopup::onClose, 0);
v15 = (int)v14;
CCMenuItemSpriteExtra::setSizeMult((__int64)v14, 1.6);
v20 = sub_1008735E0(v15, 0, v16, v17, v18, v19);
*(_QWORD *)(a1 + 552) = v20;
v25 = v23 * 0.5;
v26 = *(float *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v11 + 328LL))(v11);
*(float *)&v12 = (*(float (__fastcall **)(char *))(*(_QWORD *)v11 + 168LL))(v11);
v25 = (float)(v25 - (float)((float)(*(float *)&v12 * v26) * 0.5)) + 12.0;
v26 = v24 * 0.5;
v22 = *(float *)((*(__int64 (__fastcall **)(char *))(*(_QWORD *)v11 + 328LL))(v11) + 4);
*(float *)&v12 = (*(float (__fastcall **)(char *))(*(_QWORD *)v11 + 168LL))(v11);
sub_100278250(v21, v25, (float)((float)((float)(v22 * *(float *)&v12) * 0.5) + v26) + -12.0);
(*(void (__fastcall **)(__int64, float *))(*(_QWORD *)v20 + 184LL))(v20, v21);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 584) + 464LL))(
*(_QWORD *)(a1 + 584),
*(_QWORD *)(a1 + 552),
10);
return v7;
}
return result;
}