//
// cocos2d::CCSprite::setTextureRect from 0x180090050 to 0x1800903c9 (889 bytes)
//
// 9 xrefs:
// > ??> @ 0x1800f1d48
// > ??> @ 0x1800f2230
// > ??> @ 0x1800f2de0
// > ??> @ 0x18010a220
// > ??> @ 0x18010d238
// > ??> @ 0x180146898
// > ??> @ 0x1801468b4
// > ??> @ 0x18014cf68
// > ??> @ 0x1801c00fc
//
// 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:07 +0000
//
void __fastcall cocos2d::CCSprite::setTextureRect(
cocos2d::CCSprite *this,
const struct cocos2d::CCRect *a2,
char a3,
const struct cocos2d::CCSize *a4)
{
__int64 v4; // rax
__int64 v7; // rdx
float v8; // xmm1_4
float v9; // xmm2_4
bool v10; // zf
float v11; // xmm4_4
float v12; // xmm3_4
float v13; // xmm5_4
float v14; // xmm1_4
float v15; // xmm3_4
float v16; // xmm0_4
float v17; // xmm3_4
float v18; // xmm5_4
float v19; // xmm7_4
float v20; // xmm9_4
float v21; // xmm8_4
float v22; // xmm0_4
float v23; // xmm1_4
float v24; // xmm2_4
float v25; // xmm1_4
float v26; // xmm4_4
float v27; // [rsp+70h] [rbp+8h] BYREF
float v28; // [rsp+74h] [rbp+Ch]
v4 = *(_QWORD *)this;
*((_BYTE *)this + 440) = a3;
(*(void (__fastcall **)(cocos2d::CCSprite *, const struct cocos2d::CCSize *))(v4 + 312))(this, a4);
(*(void (__fastcall **)(cocos2d::CCSprite *, const struct cocos2d::CCRect *))(*(_QWORD *)this + 1000LL))(this, a2);
(*(void (__fastcall **)(cocos2d::CCSprite *, const struct cocos2d::CCRect *))(*(_QWORD *)this + 1056LL))(this, a2);
cocos2d::cc_timeval::operator=(&v27, (_DWORD *)this + 113);
v8 = v27;
if ( *((_BYTE *)this + 557) )
{
v8 = -v27;
v27 = -v27;
}
v9 = v28;
if ( *((_BYTE *)this + 558) )
{
v9 = -v28;
v28 = -v28;
}
v10 = *((_QWORD *)this + 46) == 0;
v11 = *((float *)this + 108);
v12 = *((float *)this + 28);
v13 = (float)((float)(*((float *)this + 27) - v11) * 0.5) + v8;
v14 = *((float *)this + 109);
*((float *)this + 111) = v13;
v15 = (float)((float)(v12 - v14) * 0.5) + v9;
*((float *)this + 112) = v15;
if ( v10 )
{
v16 = *((float *)this + 143);
v17 = v15 + 0.0;
v18 = v13 + 0.0;
v19 = v17 + v14;
*((float *)this + 121) = v18;
v20 = v18 + v11;
v21 = (float)(v17 + v14) - v17;
if ( v16 == 0.0 )
{
*((float *)this + 122) = v17;
*((_DWORD *)this + 123) = 0;
}
else
{
*((float *)this + 122) = v19 - (float)((float)(1.0 - v16) * v21);
*((_DWORD *)this + 123) = 0;
*((float *)this + 126) = *((float *)this + 148)
- (float)((float)(*((float *)this + 148) - *((float *)this + 147)) * (float)(1.0 - v16));
}
v22 = *((float *)this + 144);
*((float *)this + 133) = v20;
if ( v22 == 0.0 )
{
*((float *)this + 134) = v17;
*((_DWORD *)this + 135) = 0;
}
else
{
*((float *)this + 134) = v19 - (float)((float)(1.0 - v22) * v21);
*((_DWORD *)this + 135) = 0;
*((float *)this + 138) = *((float *)this + 148)
- (float)((float)(*((float *)this + 148) - *((float *)this + 147)) * (float)(1.0 - v22));
}
v23 = *((float *)this + 141);
*((float *)this + 115) = v18;
if ( v23 == 0.0 )
{
*((float *)this + 116) = v19;
*((_DWORD *)this + 117) = 0;
}
else
{
v24 = 1.0 - v23;
*((float *)this + 116) = (float)((float)(1.0 - v23) * v21) + v17;
*((_DWORD *)this + 117) = 0;
if ( v23 >= 0.0 )
{
if ( *((_BYTE *)this + 440) )
*((float *)this + 119) = (float)((float)(*((float *)this + 146) - *((float *)this + 145)) * v24)
+ *((float *)this + 145);
else
*((float *)this + 120) = (float)((float)(*((float *)this + 148) - *((float *)this + 147)) * v24)
+ *((float *)this + 147);
}
}
v25 = *((float *)this + 142);
*((float *)this + 127) = v20;
if ( v25 == 0.0 )
{
*((float *)this + 128) = v19;
*((_DWORD *)this + 129) = 0;
}
else
{
*((float *)this + 128) = (float)((float)(1.0 - v25) * v21) + v17;
*((_DWORD *)this + 129) = 0;
if ( v25 >= 0.0 )
{
v26 = 1.0 - v25;
if ( *((_BYTE *)this + 440) )
*((float *)this + 131) = (float)((float)(*((float *)this + 146) - *((float *)this + 145)) * v26)
+ *((float *)this + 145);
else
*((float *)this + 132) = (float)((float)(*((float *)this + 148) - *((float *)this + 147)) * v26)
+ *((float *)this + 147);
}
}
}
else
{
LOBYTE(v7) = 1;
(*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(*(_QWORD *)this + 1048LL))(this, v7);
}
}