//
// cocos2d::CCTMXTiledMap::tilesetForLayer from 0x100519b50 to 0x100519c62 (274 bytes)
//
// 0 xrefs:
//
// 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 12:31:41 +0000
//
__int64 __fastcall cocos2d::CCTMXTiledMap::tilesetForLayer(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v4; // rax
__int64 v5; // r14
unsigned int *v6; // rcx
__int64 v7; // rdx
__int64 result; // rax
unsigned __int64 v9; // rcx
unsigned __int64 v10; // rdx
int v11; // r8d
float v12; // xmm2_4
int v13; // r9d
float v14; // xmm2_4
float v15; // xmm3_4
int v16; // r10d
__int64 v17; // [rsp+8h] [rbp-18h] BYREF
sub_100278630(&v17, (_QWORD *)(a2 + 88));
v4 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a3 + 96LL))(a3);
if ( !v4 )
return 0;
v5 = v4;
if ( !(unsigned int)sub_1007FEF90(v4) )
return 0;
v6 = *(unsigned int **)(v5 + 56);
v7 = *v6;
if ( !*v6 )
return 0;
result = 0;
if ( *((float *)&v17 + 1) > 0.0 && *(float *)&v17 > 0.0 )
{
v9 = *((_QWORD *)v6 + 2);
v10 = v9 + 8 * v7 - 8;
if ( v10 >= v9 )
{
result = 0;
do
{
if ( !*(_QWORD *)v10 )
break;
v11 = 0;
v12 = 0.0;
while ( 2 )
{
v13 = 1;
v14 = v12 * *(float *)&v17;
v15 = 0.0;
do
{
v16 = *(_DWORD *)(*(_QWORD *)(a2 + 96) + 4LL * (unsigned int)(int)(float)(v15 + v14));
if ( v16 && (v16 & 0x1FFFFFFFu) >= *(_DWORD *)(*(_QWORD *)v10 + 80LL) )
return *(_QWORD *)v10;
v15 = (float)v13++;
}
while ( *(float *)&v17 > v15 );
v12 = (float)++v11;
if ( *((float *)&v17 + 1) > (float)v11 )
continue;
break;
}
v10 -= 8LL;
}
while ( v10 >= v9 );
}
}
return result;
}