//
// SetupCoinLayer::init from 0x1005af590 to 0x1005af8ab (795 bytes)
//
// 1 xrefs:
// > SetupCoinLayer::create @ 0x1005af547
//
// 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:32:38 +0000
//
__int64 __fastcall SetupCoinLayer::init(_BYTE *a1, __int64 a2, __int64 a3)
{
__int64 result; // rax
unsigned int v4; // r15d
__int64 v5; // rax
unsigned __int64 v6; // [rsp+38h] [rbp-C8h] BYREF
char v7; // [rsp+40h] [rbp-C0h] BYREF
char v8[15]; // [rsp+41h] [rbp-BFh] BYREF
void *v9; // [rsp+50h] [rbp-B0h]
__int128 v10; // [rsp+58h] [rbp-A8h] BYREF
void *v11; // [rsp+68h] [rbp-98h]
__int128 v12; // [rsp+70h] [rbp-90h] BYREF
void *v13; // [rsp+80h] [rbp-80h]
__int64 v14; // [rsp+88h] [rbp-78h] BYREF
unsigned __int64 v15; // [rsp+90h] [rbp-70h] BYREF
char v16; // [rsp+98h] [rbp-68h] BYREF
_BYTE v17[23]; // [rsp+99h] [rbp-67h] BYREF
std::string v18; // [rsp+B0h] [rbp-50h] BYREF
double v19[3]; // [rsp+C8h] [rbp-38h] BYREF
unsigned __int64 v20[4]; // [rsp+E0h] [rbp-20h] BYREF
result = SetupTriggerPopup::init((__int64)a1, a2, a3, 1, 300.0, 220.0, 0.0);
if ( (_BYTE)result )
{
v4 = result;
SetupTriggerPopup::preSetup(a1);
v16 = 20;
strcpy(v17, "Setup Coin");
SetupTriggerPopup::addTitle((__int64)a1, (__int64)&v16);
if ( (v16 & 1) != 0 )
operator delete(*(void **)&v17[15]);
v7 = 4;
strcpy(v8, "OK");
SetupTriggerPopup::addCloseButton((__int64)a1, (__int64)&v7);
if ( (v7 & 1) != 0 )
operator delete(v9);
LOBYTE(v10) = 8;
strcpy((char *)&v10 + 1, "Help");
v13 = operator new(0x38u);
*(_QWORD *)&v12 = 57;
*((_QWORD *)&v12 + 1) = 49;
strcpy((char *)v13, "Target ID will be spawn triggered when collected.");
SetupTriggerPopup::addHelpButton((__int64)a1, &v10, &v12, 1.0);
if ( (v12 & 1) != 0 )
operator delete(v13);
if ( (v10 & 1) != 0 )
operator delete(v11);
v5 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(&v14, v5);
sub_100278250((float *)&v15, *(float *)&v14 * 0.5, 0.5 * *((float *)&v14 + 1));
LOBYTE(v19[0]) = 20;
strcpy((char *)v19 + 1, "Target ID:");
sub_100278250((float *)&v6, 0.0, 30.0);
sub_100278350((double *)v20, &v15, &v6);
IDNameInput::create((_DWORD)a1, (_DWORD)a1 + 544, 1, 51, (unsigned int)v19, (unsigned int)v20, 6, 0, 0, 0);
if ( (LOBYTE(v19[0]) & 1) != 0 )
operator delete(*(void **)&v19[2]);
if ( a2 && *(_DWORD *)(a2 + 1028) == 142 )
{
v18.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)20;
strcpy(v18.__r_.__value_.__s.__data_, "Unique ID:");
sub_100278250((float *)v20, 0.0, -30.0);
sub_100278350(v19, &v15, v20);
SetupTriggerPopup::createValueControlAdvanced(
(__int64)a1,
12,
&v18,
(__int64)v19,
1,
2u,
0.80000001,
0.0,
9999.0,
0xAu,
1,
0,
0,
0,
0,
0);
if ( (*(_BYTE *)&v18.__r_.__value_.__s.0 & 1) != 0 )
operator delete(v18.__r_.__value_.__l.__data_);
}
SetupTriggerPopup::postSetup(a1);
return v4;
}
return result;
}