//
// GJChallengeItem::create from 0x1402f9900 to 0x1402f9a7c (380 bytes)
//
// 3 xrefs:
// > GJChallengeItem::createFromString @ 0x1402f9866
// > GJObjectDecoder::getDecodedObject @ 0x140391e1f
// > ??> @ 0x14091e260
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:30:05 +0000
//
// Hidden C++ exception states: #wind=3
void **__fastcall GJChallengeItem::create(int a1, int a2, int a3, int a4, __int64 a5)
{
void **v9; // rsi
__int64 v10; // rax
__int64 v11; // r14
void *v12; // rdx
float v13; // xmm0_4
float v14; // xmm0_4
_BYTE v16[32]; // [rsp+28h] [rbp-60h] BYREF
__int64 v17; // [rsp+48h] [rbp-40h]
v17 = a5;
v9 = (void **)operator new(0x90u);
cocos2d::CCObject::CCObject((cocos2d::CCObject *)v9);
*v9 = &GJChallengeItem::`vftable';
v9[7] = nullptr;
v9[8] = nullptr;
v9[9] = nullptr;
v9[10] = nullptr;
v9[11] = nullptr;
*((_DWORD *)v9 + 24) = 0;
*((_BYTE *)v9 + 100) = 0;
*((_DWORD *)v9 + 26) = 0;
*((_OWORD *)v9 + 7) = 0;
v9[16] = nullptr;
v9[17] = (void *)15;
*((_BYTE *)v9 + 112) = 0;
v10 = sub_14003F4F0((__int64)v16, a5);
v11 = v10;
*((_DWORD *)v9 + 14) = a1;
*((_DWORD *)v9 + 24) = a4;
if ( v9 + 14 != (void **)v10 )
{
v12 = (void *)v10;
if ( *(_QWORD *)(v10 + 24) > 0xFu )
v12 = *(void **)v10;
sub_1400405A0(v9 + 14, v12, *(_QWORD *)(v10 + 16));
}
*((_DWORD *)v9 + 23) = a2;
v13 = (float)((float)rand() / 32767.0) * 1000.0;
*((_DWORD *)v9 + 22) = (int)v13;
*((_DWORD *)v9 + 21) = a2 + (int)v13;
*((_DWORD *)v9 + 20) = a3;
v14 = (float)((float)rand() / 32767.0) * 1000.0;
*((_DWORD *)v9 + 19) = (int)v14;
*((_DWORD *)v9 + 18) = a3 + (int)v14;
sub_14003D310(v11);
cocos2d::CCObject::autorelease((cocos2d::CCObject *)v9);
sub_14003D310(a5);
return v9;
}