//
// OptionsObject::create from 0x8d4b88 to 0x8d4d1c (404 bytes)
//
// 3 xrefs:
// > MusicDownloadManager::getAllMusicTags @ 0x82a998
// > MusicDownloadManager::getAllMusicArtists @ 0x82ab34
// > ??> @ 0x960a8
//
// 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 OptionsObject::create(int a1, char a2, __int64 a3, __int64 a4)
{
__int64 v7; // x19
int v8; // w22
void *v9; // x0
__int64 v10; // x1
__int64 v11; // x0
unsigned int *v13; // x2
int v14; // w1
__int64 v15; // [xsp+70h] [xbp+70h] BYREF
v7 = operator new(0x58u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v7);
*(_DWORD *)(v7 + 56) = 0;
*(_BYTE *)(v7 + 60) = 0;
*(_QWORD *)v7 = &off_119CF40;
*(_QWORD *)(v7 + 72) = 0;
*(_DWORD *)(v7 + 80) = 0;
*(_QWORD *)(v7 + 64) = &byte_124B6C8;
sub_D18D28(&v15);
v8 = (unsigned __int8)OptionsObject::init(v7, a1, a2, (__int64)&v15, a4);
v9 = (void *)(v15 - 24);
if ( (__int64 *)(v15 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v13 = (unsigned int *)(v15 - 8);
do
v14 = __ldaxr(v13);
while ( __stlxr(v14 - 1, v13) );
}
else
{
v14 = *(_DWORD *)(v15 - 8);
*(_DWORD *)(v15 - 8) = v14 - 1;
}
if ( v14 <= 0 )
operator delete(v9);
}
if ( v8 )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v7);
}
else
{
v10 = *(_QWORD *)v7;
v11 = v7;
v7 = 0;
(*(void (__fastcall **)(__int64))(v10 + 16))(v11);
}
return v7;
}