//
// GJChallengeItem::dataLoaded from 0x7ae08c to 0x7ae290 (516 bytes)
//
// 2 xrefs:
// > GJChallengeItem::createWithCoder @ 0x7ae2b4
// > ??> @ 0x78b40
//
// 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
//
void GJChallengeItem::dataLoaded(GJChallengeItem *a1, DS_Dictionary *a2)
{
void *v4; // x0
int IntegerForKey; // w0
int v6; // w22
int v7; // w2
int v8; // w0
int v9; // w22
int v10; // w2
int v11; // w0
int v12; // w22
int v13; // w2
unsigned int *v14; // x2
int v15; // w1
__int64 v16; // [xsp+50h] [xbp+50h] BYREF
a1->m_challengeType = DS_Dictionary::getIntegerForKey(a2, "1");
a1->m_timeLeft = DS_Dictionary::getIntegerForKey(a2, "5");
a1->m_canClaim = DS_Dictionary::getBoolForKey(a2, "6");
DS_Dictionary::getStringForKey(&v16, a2, "7");
sub_D163D4(&a1->m_name, &v16);
v4 = (void *)(v16 - 24);
if ( (__int64 *)(v16 - 24) != &qword_124B6B0 )
{
if ( &pthread_create )
{
v14 = (unsigned int *)(v16 - 8);
do
v15 = __ldaxr(v14);
while ( __stlxr(v15 - 1, v14) );
}
else
{
v15 = *(_DWORD *)(v16 - 8);
*(_DWORD *)(v16 - 8) = v15 - 1;
}
if ( v15 <= 0 )
operator delete(v4);
}
IntegerForKey = DS_Dictionary::getIntegerForKey(a2, &byte_F78BA8);
a1->m_count.value = IntegerForKey;
v6 = IntegerForKey;
v7 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_count.seed = v7;
a1->m_count.random = v6 + v7;
v8 = DS_Dictionary::getIntegerForKey(a2, "3");
a1->m_goal.value = v8;
v9 = v8;
v10 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_goal.seed = v10;
a1->m_goal.random = v9 + v10;
v11 = DS_Dictionary::getIntegerForKey(a2, &byte_F2CA20);
a1->m_reward.value = v11;
v12 = v11;
v13 = (int)(float)((float)((float)rand() * 4.6566e-10) * 1000.0);
a1->m_reward.seed = v13;
a1->m_reward.random = v12 + v13;
a1->m_position = DS_Dictionary::getIntegerForKey(a2, "8");
}