//
// sub_680674 from 0x680674 to 0x6806fe (138 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
//
_DWORD *__fastcall sub_680674(_DWORD *result, int a2, int a3, int *a4)
{
int v4; // r5
size_t v5; // r4
int v6; // r9
int v7; // r8
_DWORD *v8; // r6
int v9; // r5
unsigned __int8 *v10; // r10
unsigned __int8 *v11; // t1
char *v12; // r11
char *v13; // r7
void *v14; // r0
int v15; // t1
int v16; // [sp+8h] [bp-Ch]
v4 = result[119] + *(_DWORD *)(a2 + 4);
v5 = *(unsigned __int8 *)(v4 + 140);
v16 = *a4;
v6 = *(unsigned __int8 *)(v4 + 150);
if ( (int)result[80] > 0 )
{
v7 = a3 - 4;
v8 = result;
v9 = 0;
do
{
v11 = *(unsigned __int8 **)(v7 + 4);
v7 += 4;
v10 = v11;
v12 = *(char **)(v16 + 4 * v9);
v13 = &v12[v8[28]];
if ( v12 < v13 )
{
if ( v5 )
{
do
{
v14 = v12;
v15 = *v10++;
v12 += v5;
result = memset(v14, v15, v5);
}
while ( v13 > v12 );
}
else
{
while ( v13 > v12 )
;
}
}
if ( v6 > 1 )
result = (_DWORD *)jcopy_sample_rows(v16, v9, v16, v9 + 1, v6 - 1, v8[28]);
v9 += v6;
}
while ( v8[80] > v9 );
}
return result;
}