//
// cocos2d::CCTMXLayer::appendTileForGID from 0x1800af5d0 to 0x1800af73b (363 bytes)
//
// 3 xrefs:
// > cocos2d::CCTMXLayer::setupTiles @ 0x1800b0ba7
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c237c
//
// 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:22:19 +0000
//
struct cocos2d::CCSprite *__fastcall cocos2d::CCTMXLayer::appendTileForGID(
cocos2d::CCTMXLayer *this,
unsigned int a2,
const 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
cocos2d::CCRect *v19; // rax
struct cocos2d::CCSprite *v20; // rdi
_DWORD *v21; // rax
float v23[4]; // [rsp+30h] [rbp-68h] BYREF
_BYTE v24[16]; // [rsp+40h] [rbp-58h] BYREF
int v25; // [rsp+A0h] [rbp+8h] BYREF
cocos2d::CCTMXTilesetInfo::rectForGID(*((_QWORD *)this + 48), v23, a2);
v6 = cocos2d::CCDirector::sharedDirector();
ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v6);
v8 = v23[3] / ContentScaleFactor;
v9 = cocos2d::CCDirector::sharedDirector();
v10 = cocos2d::CCDirector::getContentScaleFactor(v9);
v11 = v23[2] / v10;
v12 = cocos2d::CCDirector::sharedDirector();
v13 = cocos2d::CCDirector::getContentScaleFactor(v12);
v14 = v23[1] / v13;
v15 = cocos2d::CCDirector::sharedDirector();
v16 = cocos2d::CCDirector::getContentScaleFactor(v15);
v17 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v24, v23[0] / v16, v14, v11, v8);
cocos2d::CCRect::operator=((__int64)v23, (__int64)v17);
v18 = (unsigned int)(int)(float)((float)(*((float *)this + 90) * *((float *)a3 + 1)) + *(float *)a3);
v19 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v24, (const struct cocos2d::CCRect *)v23);
v20 = (struct cocos2d::CCSprite *)cocos2d::CCTMXLayer::reusedTileWithRect(this, v19);
v21 = cocos2d::cc_timeval::operator=(&v25, a3);
cocos2d::CCTMXLayer::setupTileSprite(this, v20, v21, a2);
LODWORD(a3) = **((_DWORD **)this + 59);
cocos2d::CCSpriteBatchNode::insertQuadFromSprite(this, v20, (unsigned int)a3);
sub_1800A1EA0(*((int **)this + 59), v18, (unsigned int)a3);
return v20;
}