//
// sub_C14A68 from 0xc14a68 to 0xc14b88 (288 bytes)
//
// 1 xrefs:
// > jinit_merged_upsampler @ 0xc14ddc
//
// 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_C14A68(__int64 a1, __int64 a2, _DWORD *a3, __int64 a4, int a5, int *a6, int a7)
{
__int64 v7; // x19
unsigned int v10; // w20
int v11; // w3
int v12; // w1
__int64 result; // x0
int v14; // w0
v7 = *(_QWORD *)(a1 + 640);
if ( *(_DWORD *)(v7 + 72) )
{
jcopy_sample_rows(v7 + 64, 0, a5 + 8 * *a6, 0, 1, *(unsigned int *)(v7 + 76));
v14 = *a6;
*(_DWORD *)(v7 + 72) = 0;
*a6 = v14 + 1;
--*(_DWORD *)(v7 + 80);
goto LABEL_8;
}
v10 = *(_DWORD *)(v7 + 80);
v11 = *a6;
if ( v10 <= 1 )
{
if ( v10 > a7 - v11 )
v10 = 0;
goto LABEL_4;
}
v10 = a7 - v11;
if ( (unsigned int)(a7 - v11) <= 1 )
{
LABEL_4:
*(_DWORD *)(v7 + 72) = 1;
goto LABEL_5;
}
v10 = 2;
LABEL_5:
(*(void (**)(void))(v7 + 24))();
v12 = *(_DWORD *)(v7 + 72);
*a6 += v10;
result = *(unsigned int *)(v7 + 80);
*(_DWORD *)(v7 + 80) = result - v10;
if ( !v12 )
{
LABEL_8:
result = (unsigned int)(*a3 + 1);
*a3 = result;
}
return result;
}