//
// cocos2d::CCTMXLayer::tileAt from 0x804464 to 0x8045f4 (400 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:01:22 +0000
//
cocos2d::CCSprite *__fastcall cocos2d::CCTMXLayer::tileAt(cocos2d::CCTMXLayer *this, const cocos2d::CCPoint *a2)
{
cocos2d::CCSprite *v4; // r4
cocos2d::CCDirector *v5; // r0
float v6; // s18
cocos2d::CCDirector *v7; // r0
float v8; // r0
float v9; // s17
float v10; // s18
cocos2d::CCDirector *v11; // r0
float v12; // r0
float v13; // s16
float v14; // s17
cocos2d::CCDirector *v15; // r0
float v16; // r0
float v17; // s19
float v18; // s16
cocos2d::CCDirector *v19; // r0
float v20; // r0
void (__fastcall *v21)(cocos2d::CCSprite *, int, float *); // r10
int v22; // r0
void (__fastcall *v23)(cocos2d::CCSprite *, float *); // r9
void (__fastcall *v24)(cocos2d::CCSprite *, float); // r6
int v25; // r0
unsigned int v26; // r0
int v28; // [sp+Ch] [bp-2Ch]
float v29[4]; // [sp+14h] [bp-24h] BYREF
float v30[4]; // [sp+24h] [bp-14h] BYREF
if ( !cocos2d::CCTMXLayer::tileGIDAt(this, a2) )
return nullptr;
v28 = (int)(float)(*(float *)a2 + (float)(*((float *)a2 + 1) * *((float *)this + 72)));
v4 = (cocos2d::CCSprite *)(*(int (__fastcall **)(cocos2d::CCTMXLayer *, int))(*(_DWORD *)this + 240))(this, v28);
if ( !v4 )
{
v5 = (cocos2d::CCDirector *)cocos2d::CCTMXTilesetInfo::rectForGID(
(cocos2d::CCTMXTilesetInfo *)v29,
*((_DWORD *)this + 77));
v6 = v29[0];
v7 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v5);
v8 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v7));
v9 = v29[1];
v10 = v6 / v8;
v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v8));
v12 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v11));
v13 = v29[2];
v14 = v9 / v12;
v15 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v12));
v16 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v15));
v17 = v29[3];
v18 = v13 / v16;
v19 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)LODWORD(v16));
v20 = COERCE_FLOAT(cocos2d::CCDirector::getContentScaleFactor(v19));
cocos2d::CCRect::CCRect((cocos2d::CCRect *)v30, v10, v14, v18, v17 / v20);
cocos2d::CCRect::operator=(v29, v30);
v4 = (cocos2d::CCSprite *)operator new(0x1FCu);
cocos2d::CCSprite::CCSprite(v4);
v21 = *(void (__fastcall **)(cocos2d::CCSprite *, int, float *))(*(_DWORD *)v4 + 508);
v22 = (*(int (__fastcall **)(cocos2d::CCTMXLayer *))(*(_DWORD *)this + 448))(this);
v21(v4, v22, v29);
(*(void (__fastcall **)(cocos2d::CCSprite *, cocos2d::CCTMXLayer *))(*(_DWORD *)v4 + 560))(v4, this);
v23 = *(void (__fastcall **)(cocos2d::CCSprite *, float *))(*(_DWORD *)v4 + 92);
cocos2d::CCTMXLayer::positionAt((cocos2d::CCTMXLayer *)v30, this, (float *)a2);
v23(v4, v30);
v24 = *(void (__fastcall **)(cocos2d::CCSprite *, float))(*(_DWORD *)v4 + 56);
v25 = cocos2d::CCTMXLayer::vertexZForPos(this, a2);
((void (__fastcall *)(_DWORD, _DWORD))v24)(v4, (float)v25);
(*(void (__fastcall **)(cocos2d::CCSprite *, void *))(*(_DWORD *)v4 + 148))(v4, &unk_D31288);
(*(void (__fastcall **)(cocos2d::CCSprite *, _DWORD))(*(_DWORD *)v4 + 456))(v4, *((unsigned __int8 *)this + 332));
v26 = cocos2d::CCTMXLayer::atlasIndexForExistantZ(this, v28);
cocos2d::CCSpriteBatchNode::addSpriteWithoutQuad(this, v4, v26, v28);
cocos2d::CCObject::release(v4);
}
return v4;
}