//
// sub_1004CF8A0 from 0x1004cf8a0 to 0x1004cf920 (128 bytes)
//
// 1 xrefs:
// > sub_100448ED8 @ 0x100448f24
//
// 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
//
__int64 __fastcall sub_1004CF8A0(__int64 a1, __int64 *a2, __int64 *a3)
{
int v3; // w8
__int64 v4; // x9
__int64 v5; // x10
unsigned int v6; // w8
__int64 v7; // x9
__int64 v8; // x8
__int128 v9; // q0
__int128 v10; // q1
v3 = *(_DWORD *)(a1 + 1756) / *(_DWORD *)(a1 + 1752);
v4 = *(unsigned __int16 *)(a1 + 74072);
v5 = *a2;
v6 = (unsigned __int16)((v3 + (int)v4 - 1) % v3);
v7 = *a2 + 88 * v4;
*(_BYTE *)v7 = 1;
v8 = v5 + 88LL * v6;
*(_QWORD *)(v7 + 4) = *(_QWORD *)(v8 + 4);
*(_DWORD *)(v7 + 12) = *(_DWORD *)(v8 + 12);
LODWORD(v5) = *(_DWORD *)(v8 + 72);
*(_QWORD *)(v7 + 64) = *(_QWORD *)(v8 + 64);
*(_DWORD *)(v7 + 72) = v5;
v10 = *(_OWORD *)(v8 + 32);
v9 = *(_OWORD *)(v8 + 48);
*(_OWORD *)(v7 + 16) = *(_OWORD *)(v8 + 16);
*(_OWORD *)(v7 + 32) = v10;
*(_OWORD *)(v7 + 48) = v9;
*a3 = v7;
return 0;
}