//
// sub_761174 from 0x761174 to 0x7611da (102 bytes)
//
// 1 xrefs:
// > sub_76E624 @ 0x76e716
//
// 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_761174(_DWORD *a1, wchar_t *s1, int a3)
{
int v6; // r5
int v7; // r4
int v8; // r2
const wchar_t *v9; // r1
wchar_t v10; // r0
size_t v11; // r2
int v12; // r4
if ( a3 > 0 )
{
v6 = 0;
while ( 1 )
{
v7 = a3 - v6;
v8 = a1[3];
v9 = (const wchar_t *)a1[2];
if ( (v8 - (int)v9) >> 2 )
{
if ( v7 >= (v8 - (int)v9) >> 2 )
v7 = (v8 - (int)v9) >> 2;
v6 += v7;
v11 = v7;
v12 = 4 * v7;
wmemcpy(s1, v9, v11);
a1[2] += v12;
if ( a3 <= v6 )
return v6;
s1 = (wchar_t *)((char *)s1 + v12);
}
v10 = (*(int (__fastcall **)(_DWORD *))(*a1 + 40))(a1);
if ( v10 != -1 )
{
++v6;
*s1++ = v10;
if ( a3 > v6 )
continue;
}
return v6;
}
}
return 0;
}