//
// CCURLObject::create from 0x5e874c to 0x5e8988 (572 bytes)
//
// 24 xrefs:
// > SupportLayer::onSFX @ 0x7db8e4
// > SupportLayer::onSFX @ 0x7db950
// > SupportLayer::onSFX @ 0x7db9b8
// > SupportLayer::onSFX @ 0x7dba20
// > SupportLayer::onSFX @ 0x7dba88
// > SupportLayer::onSFX @ 0x7dbaf0
// > SupportLayer::onLinks @ 0x7dc074
// > SupportLayer::onLinks @ 0x7dc0e0
// > SupportLayer::onLinks @ 0x7dc148
// > SupportLayer::onLinks @ 0x7dc1b0
// > SupportLayer::onLinks @ 0x7dc218
// > SupportLayer::onLinks @ 0x7dc280
// > SupportLayer::onLinks @ 0x7dc2e8
// > SupportLayer::onLinks @ 0x7dc350
// > SupportLayer::onLinks @ 0x7dc3b8
// > SupportLayer::onLinks @ 0x7dc420
// > MusicDownloadManager::parseSFXLibrary @ 0x830ac8
// > LevelAreaInnerLayer::onInfo @ 0xa2e484
// > LevelAreaInnerLayer::onInfo @ 0xa2e4f0
// > LevelAreaInnerLayer::onInfo @ 0xa2e558
// > LevelAreaInnerLayer::onInfo @ 0xa2e5c0
// > LevelAreaInnerLayer::onInfo @ 0xa2e628
// > LevelAreaInnerLayer::onInfo @ 0xa2e690
// > ??> @ 0x47bf8
//
// 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 CCURLObject::create(__int64 a1, __int64 a2)
{
__int64 v4; // x0
__int64 v5; // x19
int v6; // w22
void *v7; // x0
void *v8; // x0
__int64 v9; // x1
__int64 v10; // x0
unsigned int *v12; // x2
int v13; // w1
unsigned int *v14; // x1
int v15; // w2
__int64 v16; // [xsp+48h] [xbp+48h] BYREF
__int64 v17; // [xsp+50h] [xbp+50h] BYREF
v4 = operator new(0x48u);
*(_QWORD *)v4 = 0;
*(_DWORD *)(v4 + 8) = 0;
v5 = v4;
*(_DWORD *)(v4 + 12) = 0;
*(_DWORD *)(v4 + 16) = 0;
*(_DWORD *)(v4 + 20) = 0;
*(_DWORD *)(v4 + 24) = 0;
*(_DWORD *)(v4 + 28) = 0;
*(_DWORD *)(v4 + 32) = 0;
*(_DWORD *)(v4 + 36) = 0;
*(_DWORD *)(v4 + 40) = 0;
*(_DWORD *)(v4 + 44) = 0;
*(_DWORD *)(v4 + 48) = 0;
*(_DWORD *)(v4 + 52) = 0;
*(_QWORD *)(v4 + 56) = 0;
*(_QWORD *)(v4 + 64) = 0;
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v4);
*(_QWORD *)v5 = &off_1149990;
*(_QWORD *)(v5 + 56) = &byte_124B6C8;
*(_QWORD *)(v5 + 64) = &byte_124B6C8;
sub_D18D28(&v16, a1);
sub_D18D28(&v17, a2);
v6 = (unsigned __int8)CCURLObject::init(v5, (__int64)&v16, (__int64)&v17);
v7 = (void *)(v17 - 24);
if ( (__int64 *)(v17 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v17 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *(_DWORD *)(v17 - 8);
*(_DWORD *)(v17 - 8) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v7);
}
v8 = (void *)(v16 - 24);
if ( (__int64 *)(v16 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v12 = (unsigned int *)(v16 - 8);
do
v13 = __ldaxr(v12);
while ( __stlxr(v13 - 1, v12) );
}
else
{
v13 = *(_DWORD *)(v16 - 8);
*(_DWORD *)(v16 - 8) = v13 - 1;
}
if ( v13 <= 0 )
operator delete(v8);
}
if ( v6 )
{
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v5);
}
else
{
v9 = *(_QWORD *)v5;
v10 = v5;
v5 = 0;
(*(void (__fastcall **)(__int64))(v9 + 16))(v10);
}
return v5;
}