//
// CCPartAnimSprite::setBlendFunc from 0x14004a4a0 to 0x14004a56a (202 bytes)
//
// 4 xrefs:
// > ??> @ 0x14070abe0
// > ??> @ 0x140885ccc
// > ??> @ 0x140885cdc
// > ??> @ 0x14090fcf8
//
// 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:25:32 +0000
//
__int64 __fastcall CCPartAnimSprite::setBlendFunc(__int64 a1, __int64 a2)
{
__int64 v2; // r14
__int64 result; // rax
unsigned __int64 v5; // rdi
__int64 v6; // rsi
unsigned __int64 i; // rsi
v2 = a1 - 344;
*(_QWORD *)(a1 + 60) = a2;
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(a1 - 344) + 480LL))(a1 - 344);
if ( result )
{
result = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 480LL))(v2);
if ( **(_DWORD **)(result + 56) )
{
v5 = *(_QWORD *)(*(_QWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 480LL))(v2) + 56) + 16LL);
v6 = *(_QWORD *)(*(_QWORD *)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 480LL))(v2) + 56) + 16LL);
result = **(unsigned int **)((*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v2 + 480LL))(v2) + 56);
for ( i = v6 + 8 * result - 8; v5 <= i; v5 += 8LL )
{
if ( !*(_QWORD *)v5 )
break;
result = (**(__int64 (__fastcall ***)(__int64, __int64))(*(_QWORD *)v5 + 344LL))(*(_QWORD *)v5 + 344LL, a2);
}
}
}
return result;
}