//
// sub_1401A2F00 from 0x1401a2f00 to 0x1401a30f1 (497 bytes)
//
// 3 xrefs:
// > GameObject::setupCustomSprites @ 0x1401b4c74
// > GameObject::setupCustomSprites @ 0x1401bbaf6
// > ??> @ 0x1406cc03c
//
// 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
//
__int64 __fastcall sub_1401A2F00(__int64 a1, char a2)
{
__int64 result; // rax
__int128 *v4; // rdx
char *v5; // rax
size_t v6; // r8
void **v7; // rcx
struct cocos2d::CCSprite *v8; // rbx
void *v9; // rcx
struct cocos2d::CCPoint v10; // [rsp+20h] [rbp-29h] BYREF
__int128 v11; // [rsp+28h] [rbp-21h] BYREF
__int64 v12; // [rsp+38h] [rbp-11h]
unsigned __int64 v13; // [rsp+40h] [rbp-9h]
__int128 *v14; // [rsp+48h] [rbp-1h]
void *Block[2]; // [rsp+50h] [rbp+7h] BYREF
__m128i si128; // [rsp+60h] [rbp+17h]
char v17[32]; // [rsp+70h] [rbp+27h] BYREF
result = *(_QWORD *)(a1 + 752);
if ( result )
{
if ( a2 )
*(_BYTE *)(result + 559) = 1;
v11 = 0;
*(_QWORD *)&v11 = sub_14003AA10(0x20u);
v12 = 26;
v13 = 31;
strcpy((char *)v11, "blockOutline_15new_001.png");
v14 = &v11;
v4 = &v11;
if ( v13 > 0xF )
v4 = (__int128 *)v11;
v5 = sub_140049190(v17, v4, "_001.png", "_glow_001.png");
if ( *((_QWORD *)v5 + 3) > 0xFu )
v5 = *(char **)v5;
*(_OWORD *)Block = 0;
si128 = 0;
v6 = -1;
do
++v6;
while ( v5[v6] );
sub_14003A930(Block, v5, v6);
sub_14003A830((__int64)v17);
sub_14003A830((__int64)&v11);
v7 = Block;
if ( si128.m128i_i64[1] > 0xFuLL )
v7 = (void **)Block[0];
v8 = cocos2d::CCSprite::createWithSpriteFrameName((const char *)v7);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v9 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v9 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v9 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free(v9);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);
LOBYTE(Block[0]) = 0;
((void (__fastcall *)(struct cocos2d::CCSprite *))v8->setRotation)(v8);
(*(void (__fastcall **)(_QWORD, struct cocos2d::CCSprite *))(**(_QWORD **)(a1 + 752) + 448LL))(
*(_QWORD *)(a1 + 752),
v8);
cocos2d::CCNode::convertToNodeSpace(*(cocos2d::CCNode **)(a1 + 752), &v10);
return ((__int64 (__fastcall *)(struct cocos2d::CCSprite *, struct cocos2d::CCPoint *))v8->setPosition_0)(v8, &v10);
}
return result;
}