//
// sub_1003085CC from 0x1003085cc to 0x1003094ac (3808 bytes)
//
// 1 xrefs:
// > sub_100308510 @ 0x100308578
//
// This function is hookable on this platform (idp: arm, 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:03:09 +0000
//
__int64 __fastcall sub_1003085CC(__int64 a1, const char *a2, char *a3, char *a4, int a5)
{
__int64 v10; // x19
__int64 v11; // x0
_WORD *v12; // x0
__int64 v13; // x23
char *v14; // x1
int v15; // w23
void **v16; // x24
void **v17; // x0
void *v18; // x23
void *v19; // x0
void *v20; // x26
__int64 v21; // x0
float *v22; // x23
void *v23; // x25
float *v24; // x0
float v25; // s8
__int64 v26; // x27
_QWORD *v27; // x25
std::string *p_str; // x8
std::string::size_type size; // x28
std::string *v30; // x9
std::string::size_type v31; // x11
std::string *v32; // x10
__int64 v33; // x8
__int64 v34; // x22
std::string::size_type v35; // x26
std::string *v36; // x1
__int64 v37; // x24
bool v38; // zf
std::string::size_type v39; // x11
std::string *v40; // x8
_BYTE *v41; // x9
_BYTE *v42; // x10
std::string::size_type v43; // x11
__int64 v44; // x8
__int64 v45; // x0
char *CString; // x26
__int64 v47; // x0
__int64 v48; // x25
bool v49; // w27
__int64 v50; // x26
const char *v51; // x8
void *v52; // x26
float v53; // s9
char *v54; // x1
std::string *v55; // x1
__int64 v56; // x24
__n128 v57; // q0
float *v58; // x0
char *v59; // x1
void *v60; // x22
float v61; // s13
float v62; // s10
float v63; // s9
float v64; // s10
float v65; // s11
float v66; // s1
float v67; // s9
float v68; // s10
float v69; // s9
float v70; // s11
float v71; // s1
float v72; // s0
float v73; // s11
float *v74; // x0
bool v76; // w27
bool v77; // w27
bool v78; // w27
bool v79; // w27
bool v80; // w27
bool v81; // w27
bool v82; // w27
bool v83; // w27
bool v84; // w27
bool v85; // w27
bool v86; // w27
_BOOL4 v87; // w26
void *v88; // x0
char *v89; // [xsp+8h] [xbp-138h]
const char *v90; // [xsp+10h] [xbp-130h]
float v91; // [xsp+18h] [xbp-128h] BYREF
float v92; // [xsp+1Ch] [xbp-124h]
void *__p[2]; // [xsp+20h] [xbp-120h] BYREF
char v94; // [xsp+37h] [xbp-109h]
std::string __str; // [xsp+38h] [xbp-108h] BYREF
float v96; // [xsp+50h] [xbp-F0h] BYREF
void *v97[2]; // [xsp+58h] [xbp-E8h] BYREF
char v98; // [xsp+6Fh] [xbp-D1h]
__int64 v99; // [xsp+70h] [xbp-D0h] BYREF
std::allocator __a[23]; // [xsp+78h] [xbp-C8h] BYREF
char v101; // [xsp+8Fh] [xbp-B1h]
std::string v102; // [xsp+90h] [xbp-B0h] BYREF
v10 = cocos2d::CCNodeRGBA::init(a1);
if ( !(_DWORD)v10 )
return v10;
v90 = a2;
v11 = cocos2d::CCDirector::sharedDirector();
cocos2d::CCDirector::getWinSize(v11, &v99);
LODWORD(v102.__r_.__value_.__l.__data_) = 0;
v12 = cocos2d::CCLayerColor::create((__int64)&v102);
*(_QWORD *)(a1 + 344) = v12;
(*(void (__fastcall **)(__int64, _WORD *))(*(_QWORD *)a1 + 456LL))(a1, v12);
v13 = *(_QWORD *)(a1 + 344);
sub_1000262BC((float *)&v102, *(float *)&v99 * 0.5, 40.0);
(*(void (__fastcall **)(__int64, std::string *))(*(_QWORD *)v13 + 184LL))(v13, &v102);
if ( a5 )
v14 = "GJ_square02.png";
else
v14 = "GJ_square01.png";
sub_100009900(v97, v14);
v15 = v98;
v16 = (void **)v97[0];
sub_1000262CC((float *)&v102, 0.0, 0.0, 80.0, 80.0);
if ( v15 >= 0 )
v17 = v97;
else
v17 = v16;
v18 = cocos2d::extension::CCScale9Sprite::create((__int64)v17, (__int64)&v102);
sub_1000262C4((float *)&v102, 300.0, 80.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v18 + 320LL))(v18, &v102);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 344) + 464LL))(*(_QWORD *)(a1 + 344), v18, 1);
*(_QWORD *)(a1 + 368) = v18;
v19 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"achievementGlow_001.png");
*(_QWORD *)(a1 + 384) = v19;
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v19 + 160LL))(v19, 4.0);
(*(void (__fastcall **)(_QWORD, _QWORD, __int64))(**(_QWORD **)(a1 + 344) + 464LL))(
*(_QWORD *)(a1 + 344),
*(_QWORD *)(a1 + 384),
0xFFFFFFFFLL);
(*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 384) + 1080LL))(*(_QWORD *)(a1 + 384), 0x100000302LL);
sub_1000262BC(&v96, 40.0, 40.0);
sub_1000262CC((float *)&v102, 0.0, 0.0, 80.0, 80.0);
v20 = cocos2d::extension::CCScale9Sprite::create((__int64)"square02b_001.png", (__int64)&v102);
sub_1000262C4((float *)&v102, 300.0, 80.0);
(*(void (__fastcall **)(void *, std::string *))(*(_QWORD *)v20 + 320LL))(v20, &v102);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 344) + 464LL))(*(_QWORD *)(a1 + 344), v20, 100);
v21 = (*(__int64 (__fastcall **)(void *))(*(_QWORD *)v18 + 192LL))(v18);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v20 + 184LL))(v20, v21);
(*(void (__fastcall **)(void *, _QWORD))(*(_QWORD *)v20 + 912LL))(v20, 0);
cocos2d::extension::CCScale9Sprite::setBlendAdditive((__int64)v20, 1);
*(_QWORD *)(a1 + 376) = v20;
v22 = (float *)cocos2d::CCSprite::createWithSpriteFrameName((__int64)"playerSquare_001.png");
if ( a5 )
{
v23 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)a4);
v24 = (float *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v23 + 328LL))(v23);
v25 = 0.0;
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v23 + 160LL))(v23, 30.0 / *v24);
v26 = (__int64)a3;
goto LABEL_67;
}
v25 = 0.0;
if ( !a4 )
{
LABEL_65:
v26 = 0;
goto LABEL_66;
}
sub_100009900(&__str, a4);
v89 = a3;
v27 = sub_1002E736C();
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
p_str = &__str;
else
p_str = (std::string *)__str.__r_.__value_.__r.__words[0];
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
size = HIBYTE(__str.__r_.__value_.__r.__words[2]);
else
size = __str.__r_.__value_.__l.__size_;
if ( size )
{
v30 = (std::string *)((char *)p_str + size);
v31 = size;
v32 = p_str;
while ( v32->__r_.__value_.__s.__data_[0] != 95 )
{
v32 = (std::string *)((char *)v32 + 1);
if ( !--v31 )
{
v32 = (std::string *)((char *)p_str + size);
break;
}
}
v33 = (char *)v32 - (char *)p_str;
if ( v32 == v30 )
v34 = -1;
else
v34 = v33;
}
else
{
v34 = -1;
}
v35 = 0;
do
{
std::string::basic_string(&v102, &__str, v35, v34 - v35, __a);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
{
if ( v35 == size && !v102.__r_.__value_.__l.__size_ )
goto LABEL_36;
v36 = (std::string *)v102.__r_.__value_.__r.__words[0];
}
else
{
if ( v35 == size && !*((_BYTE *)&v102.__r_.__value_.__s + 23) )
goto LABEL_36;
v36 = &v102;
}
sub_100009900(__a, (char *)v36);
sub_1003064AC((__int128 *)__a);
sub_1002E74E0((__int64)v27);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
LABEL_36:
if ( v34 == -1 )
goto LABEL_37;
v35 = v34 + 1;
v39 = __str.__r_.__value_.__l.__size_;
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v40 = &__str;
else
v40 = (std::string *)__str.__r_.__value_.__r.__words[0];
if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v39 = HIBYTE(__str.__r_.__value_.__r.__words[2]);
if ( v39 <= v35 )
{
LABEL_37:
v37 = -1;
}
else
{
v41 = (char *)v40 + v39;
v42 = (char *)v40 + v35;
v43 = ~v34 + v39;
while ( *v42 != 95 )
{
++v42;
if ( !--v43 )
{
v42 = v41;
break;
}
}
v44 = v42 - (_BYTE *)v40;
if ( v42 == v41 )
v37 = -1;
else
v37 = v44;
}
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
v38 = v34 == -1;
v34 = v37;
}
while ( !v38 );
if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 )
operator delete(__str.__r_.__value_.__l.__data_);
a3 = v89;
if ( (unsigned int)sub_1002E757C((__int64)v27) < 2 )
goto LABEL_65;
v45 = sub_1002E75A0((__int64)v27, 0);
CString = (char *)cocos2d::CCString::getCString(v45);
v47 = sub_1002E75A0((__int64)v27, 1u);
v48 = cocos2d::CCString::intValue(v47);
sub_100009900(&v102, CString);
sub_100009900(__a, "ship");
v49 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
v25 = 0.0;
if ( v49 )
{
v50 = 4;
v51 = "Ship";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "ball");
v76 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v76 )
{
v50 = 5;
v51 = "Ball";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "bird");
v77 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v77 )
{
v25 = -8.0;
v50 = 6;
v51 = "UFO";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "dart");
v78 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v78 )
{
v50 = 7;
v51 = "Wave";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "robot");
v79 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v79 )
{
v50 = 8;
v51 = "Robot";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "spider");
v80 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v80 )
{
v50 = 9;
v51 = "Spider";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "death");
v81 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v81 )
{
v50 = 11;
v51 = "Death Effect";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "special");
v82 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v82 )
{
v50 = 10;
v51 = "Trail";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "color");
v83 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v83 )
{
v50 = 2;
v51 = "Main Color";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "color2");
v84 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v84 )
{
v50 = 3;
v51 = "Secondary Color";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "swing");
v85 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v85 )
{
v50 = 13;
v51 = "Swing";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "jetpack");
v86 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v86 )
{
v50 = 14;
v51 = "Jetpack";
}
else
{
sub_100009900(&v102, CString);
sub_100009900(__a, "shipfire");
v87 = sub_1000045BC(&v102, __a);
if ( v101 < 0 )
operator delete(*(void **)&__a[0].std::__non_trivial_if);
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
v51 = "Icon";
if ( v87 )
{
v51 = "Ship Fire";
v50 = 15;
}
else
{
v50 = 1;
}
}
}
a3 = v89;
}
}
}
}
}
}
}
}
}
}
v88 = sub_1003065B0("Unlocked new %s!", v51);
v26 = cocos2d::CCString::getCString((__int64)v88);
v23 = (void *)GJItemIcon::create(v50, v48, 11513775, 0xFFFFFF, 0, 0, 1, 0xFFFFFF);
if ( !v23 )
LABEL_66:
v23 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_achImage_001.png");
LABEL_67:
(*(void (__fastcall **)(void *, float *))(*(_QWORD *)v23 + 184LL))(v23, &v96);
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 344) + 464LL))(*(_QWORD *)(a1 + 344), v23, 3);
*(_QWORD *)(a1 + 392) = v23;
v52 = cocos2d::CCNode::create();
(*(void (__fastcall **)(_QWORD, void *, __int64))(**(_QWORD **)(a1 + 344) + 464LL))(*(_QWORD *)(a1 + 344), v52, 2);
if ( a5 )
v53 = 0.8;
else
v53 = 0.7;
if ( a5 )
v54 = "goldFont.fnt";
else
v54 = "bigFont.fnt";
sub_100009900(&v102, v54);
if ( (v102.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL )
v55 = &v102;
else
v55 = (std::string *)v102.__r_.__value_.__r.__words[0];
v56 = cocos2d::CCLabelBMFont::create_1(v90, v55);
(*(void (__fastcall **)(void *, __int64))(*(_QWORD *)v52 + 456LL))(v52, v56);
sub_1000262BC((float *)__a, 0.0, 0.5);
(*(void (__fastcall **)(__int64, std::allocator *))(*(_QWORD *)v56 + 296LL))(v56, __a);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v56 + 160LL))(v56, v53);
*(_QWORD *)(a1 + 400) = v56;
v57.n128_u32[0] = *(_DWORD *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v56 + 328LL))(v56);
if ( v57.n128_f32[0] > 200.0 )
{
v58 = (float *)(*(__int64 (__fastcall **)(__int64, float))(*(_QWORD *)v56 + 328LL))(v56, v57.n128_f32[0]);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v56 + 160LL))(v56, 200.0 / *v58);
}
if ( v53 > (*(float (__fastcall **)(__int64, __n128))(*(_QWORD *)v56 + 168LL))(v56, v57) )
v53 = (*(float (__fastcall **)(__int64))(*(_QWORD *)v56 + 168LL))(v56);
(*(void (__fastcall **)(__int64, float))(*(_QWORD *)v56 + 160LL))(v56, v53);
if ( v26 )
v59 = (char *)v26;
else
v59 = a3;
sub_100009900(__p, v59);
sub_1000262BC((float *)__a, 0.0, 1.0);
v60 = TextArea::create((__int64)__p, (__int64)"chatFont.fnt", (double *)__a, 0, 0, 1.0, 220.0, 20.0);
if ( v94 < 0 )
operator delete(__p[0]);
(*(void (__fastcall **)(void *, void *))(*(_QWORD *)v52 + 456LL))(v52, v60);
sub_1000262BC((float *)__a, 0.0, 0.5);
(*(void (__fastcall **)(void *, std::allocator *))(*(_QWORD *)v60 + 296LL))(v60, __a);
sub_1000262BC((float *)__a, 0.0, 5.0);
(*(void (__fastcall **)(void *, std::allocator *))(*(_QWORD *)v60 + 184LL))(v60, __a);
*((_DWORD *)v60 + 162) = 1098907648;
*(_QWORD *)(a1 + 408) = v60;
v61 = *(float *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v56 + 328LL))(v56) + 4);
v62 = *(float *)((*(__int64 (__fastcall **)(void *))(*(_QWORD *)v60 + 328LL))(v60) + 4);
sub_1000262BC((float *)&__str, 0.0, 1.0);
v63 = *(float *)&__str.__r_.__value_.__l.__data_;
sub_1000262BC(&v91, 0.0, 1.0);
v64 = v62 + 17.0;
v65 = (float)(v61 + v64) * 0.5;
v66 = 2.5;
if ( !a5 )
v66 = 0.0;
sub_1000262BC((float *)__a, v63, v66 + (float)((float)((float)(v65 - (float)(v61 * 0.5)) + v92) + 2.0));
(*(void (__fastcall **)(__int64, std::allocator *))(*(_QWORD *)v56 + 184LL))(v56, __a);
sub_1000262BC((float *)&__str, 0.0, -1.0);
v67 = *(float *)&__str.__r_.__value_.__l.__data_;
sub_1000262BC(&v91, 0.0, -1.0);
sub_1000262BC((float *)__a, v67 + 1.0, (float)((float)((float)((float)(v64 * 0.5) - v65) + 15.0) + v92) + -1.0);
(*(void (__fastcall **)(void *, std::allocator *))(*(_QWORD *)v60 + 184LL))(v60, __a);
(*(void (__fastcall **)(float *, float))(*(_QWORD *)v22 + 160LL))(v22, 1.0);
if ( (a5 & 1) == 0 )
(*(void (__fastcall **)(void *, float))(*(_QWORD *)v23 + 160LL))(v23, 1.0);
v68 = v22[108];
v69 = (*(float (__fastcall **)(float *))(*(_QWORD *)v22 + 168LL))(v22);
v70 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v56 + 328LL))(v56);
v71 = v70 * (*(float (__fastcall **)(__int64))(*(_QWORD *)v56 + 168LL))(v56);
v72 = *((float *)v60 + 170);
if ( v71 >= v72 )
{
v73 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v56 + 328LL))(v56);
v72 = v73 * (*(float (__fastcall **)(__int64))(*(_QWORD *)v56 + 168LL))(v56);
}
sub_1000262BC(
(float *)__a,
(float)((float)(v68 * v69) * 0.5)
- (float)((float)((float)((float)((float)(v68 * v69) * 0.5) + (float)(v72 + 5.0)) + 30.0) * 0.5),
v25);
(*(void (__fastcall **)(void *, std::allocator *))(*(_QWORD *)v23 + 184LL))(v23, __a);
v74 = (float *)(*(__int64 (__fastcall **)(void *))(*(_QWORD *)v23 + 192LL))(v23);
sub_1000262BC((float *)__a, *v74 + 30.0, 0.0);
(*(void (__fastcall **)(void *, std::allocator *))(*(_QWORD *)v52 + 184LL))(v52, __a);
*(_DWORD *)(a1 + 352) = 1118568448;
if ( SHIBYTE(v102.__r_.__value_.__r.__words[2]) < 0 )
operator delete(v102.__r_.__value_.__l.__data_);
if ( v98 < 0 )
operator delete(v97[0]);
return v10;
}