//
// sub_7580D4 from 0x7580d4 to 0x758116 (66 bytes)
//
// 0 xrefs:
//
// 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
//
int __fastcall sub_7580D4(int a1, int a2, int a3)
{
int v6; // r5
int v7; // r4
wint_t v8; // r0
if ( a3 )
{
v6 = a2 - 4;
v7 = 0;
while ( 1 )
{
v8 = getwc(*(__FILE **)(a1 + 32));
if ( v8 == -1 )
break;
++v7;
*(_DWORD *)(v6 + 4) = v8;
v6 += 4;
if ( a3 == v7 )
goto LABEL_6;
}
if ( !v7 )
goto LABEL_7;
LABEL_6:
v8 = *(_DWORD *)(a2 + 4 * (v7 + 0x3FFFFFFF));
}
else
{
v7 = 0;
v8 = -1;
}
LABEL_7:
*(_DWORD *)(a1 + 36) = v8;
return v7;
}