//
// cocos2d::CCTextureCache::textureForKey from 0x1800a9d00 to 0x1800a9da4 (164 bytes)
//
// 5 xrefs:
// > sub_180063AC0 @ 0x180063ad9
// > cocos2d::CCSprite::setTexture @ 0x18008cad6
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b7efc
// > ??> @ 0x1801b7f08
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
// Hidden C++ exception states: #wind=1
struct cocos2d::CCTexture2D *__fastcall cocos2d::CCTextureCache::textureForKey(
cocos2d::CCTextureCache *this,
const char *a2)
{
struct cocos2d::CCFileUtils *v4; // rax
unsigned __int8 *v5; // rax
__int64 v6; // rbx
_BYTE *v7; // rcx
void *Block; // [rsp+20h] [rbp-38h] BYREF
unsigned __int64 v10; // [rsp+38h] [rbp-20h]
v4 = cocos2d::CCFileUtils::sharedFileUtils();
v5 = (unsigned __int8 *)((__int64 (__fastcall *)(struct cocos2d::CCFileUtils *, void **, const char *, _QWORD))v4->createCCArrayWithContentsOfFile)(
v4,
&Block,
a2,
0);
v6 = cocos2d::CCDictionary::objectForKey((__int64)this->m_pTextures, v5);
if ( v10 > 0xF )
{
v7 = Block;
if ( v10 + 1 >= 0x1000 )
{
v7 = *((_BYTE **)Block - 1);
if ( (unsigned __int64)((_BYTE *)Block - v7 - 8) > 0x1F )
invalid_parameter_noinfo_noreturn();
}
j_j_free_0(v7);
}
return (struct cocos2d::CCTexture2D *)v6;
}