//
// cocos2d::CCTMXLayer::appendTileForGID from 0x1800abde0 to 0x1800abf4b (363 bytes)
//
// 3 xrefs:
// > cocos2d::CCTMXLayer::setupTiles @ 0x1800ad347
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b80b8
//
// 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
//
struct cocos2d::CCSprite *__fastcall cocos2d::CCTMXLayer::appendTileForGID(
cocos2d::CCTMXLayer *this,
unsigned int a2,
struct cocos2d::CCPoint *a3)
{
cocos2d::CCDirector *v6; // rax
float ContentScaleFactor; // xmm0_4
float v8; // xmm8_4
cocos2d::CCDirector *v9; // rax
float v10; // xmm0_4
float v11; // xmm7_4
cocos2d::CCDirector *v12; // rax
float v13; // xmm0_4
float v14; // xmm6_4
cocos2d::CCDirector *v15; // rax
float v16; // xmm0_4
cocos2d::CCRect *v17; // rax
__int64 v18; // rsi
struct cocos2d::CCRect *v19; // rax
cocos2d::CCSprite *v20; // rdi
_DWORD *v21; // rax
struct cocos2d::CCRect v23; // [rsp+30h] [rbp-68h] BYREF
cocos2d::CCRect v24; // [rsp+40h] [rbp-58h] BYREF
int v25; // [rsp+A0h] [rbp+8h] BYREF
cocos2d::CCTMXTilesetInfo::rectForGID(*((struct cocos2d::CCRect **)this + 48), (unsigned int)&v23);
v6 = cocos2d::CCDirector::sharedDirector();
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v6);
v8 = v23.size.height / ContentScaleFactor;
v9 = cocos2d::CCDirector::sharedDirector();
v10 = cocos2d::CCDirector::getContentScaleFactor(v9);
v11 = v23.size.width / v10;
v12 = cocos2d::CCDirector::sharedDirector();
v13 = cocos2d::CCDirector::getContentScaleFactor(v12);
v14 = v23.origin.y / v13;
v15 = cocos2d::CCDirector::sharedDirector();
v16 = cocos2d::CCDirector::getContentScaleFactor(v15);
v17 = cocos2d::CCRect::CCRect(&v24, v23.origin.x / v16, v14, v11, v8);
cocos2d::CCRect::operator=((float *)&v23.origin, (float *)&v17->origin);
v18 = (unsigned int)(int)(float)((float)(*((float *)this + 90) * a3->y) + a3->x);
v19 = cocos2d::CCRect::CCRect(&v24, &v23);
v20 = cocos2d::CCTMXLayer::reusedTileWithRect(this, v19);
v21 = cocos2d::cc_timeval::operator=(&v25, a3);
cocos2d::CCTMXLayer::setupTileSprite(this, v20, (struct cocos2d::CCPoint)v21, a2);
LODWORD(a3) = **((_DWORD **)this + 59);
cocos2d::CCSpriteBatchNode::insertQuadFromSprite(this, v20, (unsigned int)a3);
sub_18009E210(*((int **)this + 59), v18, (unsigned int)a3);
return v20;
}