//
// cocos2d::CCTextureCache::textureForKey from 0x1800ad4e0 to 0x1800ad624 (324 bytes)
//
// 4 xrefs:
// > sub_180065EE0 @ 0x180065ef9
// > cocos2d::CCSprite::setTexture @ 0x18008fcde
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c21cc
//
// 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:18 +0000
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCTexture2D *__fastcall cocos2d::CCTextureCache::textureForKey(cocos2d::CCTextureCache *this, char *a2)
{
__int64 v4; // rbx
void *v5; // r8
struct cocos2d::CCFileUtils *v6; // rax
__int64 v7; // rax
void *v8; // r8
void *Block[3]; // [rsp+30h] [rbp-38h] BYREF
unsigned __int64 v11; // [rsp+48h] [rbp-20h]
sub_180005A10(Block, a2);
v4 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 7), (__int64)Block);
if ( v11 > 0xF )
{
v5 = Block[0];
if ( v11 + 1 >= 0x1000 )
{
v5 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v5);
}
if ( !v4 )
{
v6 = cocos2d::CCFileUtils::sharedFileUtils();
v7 = (*(__int64 (__fastcall **)(struct cocos2d::CCFileUtils *, void **, char *, _QWORD))(*(_QWORD *)v6 + 40LL))(
v6,
Block,
a2,
0);
v4 = cocos2d::CCDictionary::objectForKey(*((_QWORD *)this + 7), v7);
if ( v11 > 0xF )
{
v8 = Block[0];
if ( v11 + 1 >= 0x1000 )
{
v8 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free_0(v8);
}
}
return (struct cocos2d::CCTexture2D *)v4;
}