//
// cocos2d::CCTMXLayer::updateTileForGID from 0x1800b0ef0 to 0x1800b1040 (336 bytes)
//
// 3 xrefs:
// > cocos2d::CCTMXLayer::setTileGID @ 0x1800b0830
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c2550
//
// 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::updateTileForGID(
cocos2d::CCTMXLayer *this,
unsigned int a2,
const struct cocos2d::CCPoint *a3)
{
cocos2d::CCRect *v6; // rax
float v7; // xmm0_4
cocos2d::CCRect *v8; // rax
cocos2d::CCSprite *v9; // rdi
float *v10; // rax
const void **v11; // rdx
void *v12; // rax
__int64 v13; // rdx
float v15[4]; // [rsp+30h] [rbp-38h] BYREF
_BYTE v16[16]; // [rsp+40h] [rbp-28h] BYREF
int v17; // [rsp+70h] [rbp+8h] BYREF
int Key; // [rsp+78h] [rbp+10h] BYREF
cocos2d::CCTMXTilesetInfo::rectForGID(*((_QWORD *)this + 48), v15, a2);
v6 = cocos2d::CCRect::CCRect(
(cocos2d::CCRect *)v16,
v15[0] / *((float *)this + 120),
v15[1] / *((float *)this + 120),
v15[2] / *((float *)this + 120),
v15[3] / *((float *)this + 120));
cocos2d::CCRect::operator=((__int64)v15, (__int64)v6);
v7 = (float)(*((float *)this + 90) * *((float *)a3 + 1)) + *(float *)a3;
v8 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v16, (const struct cocos2d::CCRect *)v15);
v9 = (cocos2d::CCSprite *)cocos2d::CCTMXLayer::reusedTileWithRect((__int64)this, (__int64)v8);
v10 = (float *)cocos2d::cc_timeval::operator=(&v17, a3);
cocos2d::CCTMXLayer::setupTileSprite((unsigned __int8 *)this, v9, v10, a2);
v11 = *((const void ***)this + 59);
Key = (int)v7;
v12 = bsearch(&Key, v11[2], *(unsigned int *)v11, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)CompareFunction);
LOBYTE(v13) = 1;
*((_DWORD *)v9 + 90) = ((unsigned __int64)v12 - *(_QWORD *)(*((_QWORD *)this + 59) + 16LL)) >> 3;
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(*(_QWORD *)v9 + 1048LL))(v9, v13);
(*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v9 + 784LL))(v9);
*(_DWORD *)(*((_QWORD *)this + 47) + 4LL * (int)v7) = a2;
return v9;
}