//
// LabelGameObject::setupCustomSprites from 0x761f94 to 0x76212c (408 bytes)
//
// 2 xrefs:
// > ??> @ 0x3c810
// > ??> @ 0x116b338
//
// 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 LabelGameObject::setupCustomSprites(LabelGameObject *a1)
{
void *v2; // x0
void *v4; // x21
unsigned int *v5; // x20
int v6; // w0
unsigned int *v7; // x1
int v8; // w2
__int64 v9; // [xsp+40h] [xbp+40h] BYREF
sub_D18D28(&v9);
GameObject::setupCustomSprites(a1);
v2 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v2);
}
if ( a1->m_objectID == 1615 )
{
a1->m_bDontDraw = 1;
sub_D153B8((int)&v9, "0");
LabelGameObject::createLabel(a1);
v4 = (void *)(v9 - 24);
if ( (__int64 *)(v9 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v5 = (unsigned int *)(v9 - 8);
do
v6 = __ldaxr(v5);
while ( __stlxr(v6 - 1, v5) );
}
else
{
v6 = *(_DWORD *)(v9 - 8);
*(_DWORD *)(v9 - 8) = v6 - 1;
}
if ( v6 <= 0 )
operator delete(v4);
}
}
return _stack_chk_guard;
}