//
// GJSpiderSprite::init from 0x8e3df8 to 0x8e3f08 (272 bytes)
//
// 2 xrefs:
// > GJSpiderSprite::create @ 0x8e3fb8
// > ??> @ 0x7e498
//
// 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
//
bool GJSpiderSprite::init(GJSpiderSprite *a1, int a2)
{
bool v4; // w20
char *v5; // x0
unsigned int *v7; // x2
int v8; // w1
const char *v9; // [xsp+40h] [xbp+40h] BYREF
a1->m_iconType = Spider;
sub_D153B8((int)&v9, "Spider");
v4 = GJRobotSprite::init((__int64)a1, a2, &v9);
v5 = (char *)(v9 - 24);
if ( v9 - 24 != (const char *)&qword_124B6B0 )
{
if ( &pthread_create )
{
v7 = (unsigned int *)(v9 - 8);
do
v8 = __ldaxr(v7);
while ( __stlxr(v8 - 1, v7) );
}
else
{
v8 = *((_DWORD *)v9 - 2);
*((_DWORD *)v9 - 2) = v8 - 1;
}
if ( v8 <= 0 )
operator delete(v5);
}
return v4;
}