//
// sub_14006C4D0 from 0x14006c4d0 to 0x14006c73c (620 bytes)
//
// 9 xrefs:
// > MessageThreadsPage::init @ 0x1400d5124
// > NewThreadPopup::init @ 0x1400ef81a
// > NewThreadPopup::init @ 0x1400ef8f8
// > FRequestProfilePage::updateModeButtons @ 0x140211c9a
// > FriendsProfilePage::init @ 0x140213c8e
// > LevelBrowserLayer::init @ 0x1403e3a58
// > LevelBrowserLayer::init @ 0x1403e3aed
// > LevelBrowserLayer::init @ 0x1403e3b85
// > ??> @ 0x1409115b8
//
// 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:25:48 +0000
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall sub_14006C4D0(const char *a1, unsigned __int8 a2, __int64 a3)
{
struct cocos2d::CCSprite *v6; // r15
size_t v7; // r8
cocos2d::CCSprite *v8; // rsi
__int64 v9; // rdx
void *v10; // r8
__int64 v11; // r14
__int64 v12; // rbx
__int64 v13; // rax
float *v14; // rbx
__int64 v15; // rax
__int64 v16; // rsi
__int64 v17; // rbx
_BYTE v19[8]; // [rsp+30h] [rbp-58h] BYREF
void *Block[2]; // [rsp+38h] [rbp-50h] BYREF
__m128i si128; // [rsp+48h] [rbp-40h]
v6 = cocos2d::CCSprite::createWithSpriteFrameName(a1);
*(_OWORD *)Block = 0;
si128 = 0;
v7 = -1;
do
++v7;
while ( a1[v7] );
sub_14003D230(Block, a1, v7);
v8 = CCSpriteGrayscale::createWithSpriteFrameName((__int64)Block);
v9 = si128.m128i_i64[1];
if ( si128.m128i_i64[1] > 0xFuLL )
{
v10 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v10 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v10);
}
si128 = _mm_load_si128((const __m128i *)&Size);
LOBYTE(Block[0]) = 0;
LOBYTE(v9) = -41;
(*(void (__fastcall **)(__int64, __int64))(*((_QWORD *)v8 + 40) + 40LL))((__int64)v8 + 320, v9);
(**((void (__fastcall ***)(__int64, __int64))v8 + 40))((__int64)v8 + 320, a3);
*((_DWORD *)v8 + 151) = 1048005574;
*((_DWORD *)v8 + 152) = 1062467535;
*((_DWORD *)v8 + 153) = 1034214703;
v11 = cocos2d::CCNode::create();
v12 = *(_QWORD *)v11;
v13 = (*(__int64 (__fastcall **)(struct cocos2d::CCSprite *))(*(_QWORD *)v6 + 320LL))(v6);
(*(void (__fastcall **)(__int64, __int64))(v12 + 312))(v11, v13);
v14 = (float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 320LL))(v11);
v15 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 320LL))(v11);
cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v19, *v14 * 0.5, *(float *)(v15 + 4) * 0.5);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, _BYTE *))(*(_QWORD *)v6 + 184LL))(v6, v19);
(*(void (__fastcall **)(struct cocos2d::CCSprite *, __int64))(*(_QWORD *)v6 + 64LL))(v6, 1);
(*(void (__fastcall **)(__int64, struct cocos2d::CCSprite *))(*(_QWORD *)v11 + 464LL))(v11, v6);
(*(void (__fastcall **)(cocos2d::CCSprite *, _BYTE *))(*(_QWORD *)v8 + 184LL))(v8, v19);
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(*(_QWORD *)v8 + 64LL))(v8, 2);
(*(void (__fastcall **)(__int64, cocos2d::CCSprite *))(*(_QWORD *)v11 + 464LL))(v11, v8);
v16 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 472LL))(v11, 1);
v17 = (*(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)v11 + 472LL))(v11, 2);
if ( v16 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v16 + 336LL))(v16, a2);
if ( v17 )
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v17 + 336LL))(v17, a2 ^ 1u);
return v11;
}