//
// cocos2d::CCTileMapAtlas::setTile from 0x1800ab450 to 0x1800ab57b (299 bytes)
//
// 2 xrefs:
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b8070
//
// 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
//
// Hidden C++ exception states: #wind=1
void __fastcall cocos2d::CCTileMapAtlas::setTile(
cocos2d::CCTileMapAtlas *this,
const struct cocos2d::_ccColor3B *a2,
const struct cocos2d::CCPoint *a3)
{
cocos2d::sImageTGA *m_pTGAInfo; // rax
__int64 v7; // rdx
__int64 v8; // r8
cocos2d::CCString *v9; // rax
std::string *CString; // rax
__int64 v11; // rbp
void *v12; // rcx
void *Block[2]; // [rsp+28h] [rbp-40h] BYREF
__m128i si128; // [rsp+38h] [rbp-30h]
m_pTGAInfo = this->m_pTGAInfo;
v7 = (unsigned int)(int)(float)((float)((float)m_pTGAInfo->width * a3->y) + a3->x);
v8 = (__int64)&m_pTGAInfo->imageData[2 * v7];
if ( *(_BYTE *)(v7 + v8) )
{
*(_WORD *)(v7 + v8) = *(_WORD *)&a2->r;
*(_BYTE *)(v7 + v8 + 2) = a2->b;
v9 = cocos2d::CCString::createWithFormat("%ld,%ld", (int)a3->x, (int)a3->y);
CString = cocos2d::CCString::getCString(v9);
sub_180005910(Block, CString);
v11 = cocos2d::CCDictionary::objectForKey((__int64)this->m_pPosToAtlasIndex, (unsigned __int8 *)Block);
if ( si128.m128i_i64[1] > 0xFuLL )
{
v12 = Block[0];
if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )
{
v12 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v12 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v12);
}
si128 = _mm_load_si128((const __m128i *)&xmmword_1800E7160);
LOBYTE(Block[0]) = 0;
cocos2d::CCTileMapAtlas::updateAtlasValueAt(this, a3, a2, *(_DWORD *)(v11 + 56));
}
}