//
// sub_E0064 from 0xe0064 to 0xe0114 (176 bytes)
//
// 2 xrefs:
// > sub_E0114 @ 0xe02d4
// > sub_E03B0 @ 0xe0548
//
// 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_E0064(__int64 a1)
{
__int64 v1; // x19
__int64 v2; // x0
int v3; // w8
unsigned int v4; // w8
unsigned int v5; // w9
unsigned int v6; // w20
__int64 v7; // x0
unsigned int v8; // w21
__int64 v9; // x0
__int64 v10; // x8
v1 = a1;
if ( (*(_DWORD *)(a1 + 404) & 8) != 0 )
{
while ( 1 )
{
v2 = sub_E0D10(a1);
if ( !v3 )
break;
a1 = sub_E0CCC(v2);
}
}
v4 = *(_DWORD *)(v1 + 364);
v5 = *(_DWORD *)(v1 + 348);
*(_DWORD *)(v1 + 360) = 0;
*(_DWORD *)(v1 + 352) = 0;
*(_DWORD *)(v1 + 472) = 0;
v6 = v4 / v5 * v5;
*(_DWORD *)(v1 + 368) = v6;
*(_DWORD *)(v1 + 372) = v6;
*(_DWORD *)(v1 + 344) = v4 % v5;
*(_DWORD *)(v1 + 404) &= ~0x40u;
*(_DWORD *)(v1 + 404) &= ~0x80u;
v7 = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v1 + 64LL))(v1, v6);
v8 = v7;
if ( *(_QWORD *)(v1 + 408) )
{
v9 = sub_E0CB0(v7);
if ( v10 )
sub_E0CE4(v9);
}
return v8;
}