//
// sub_730C68 from 0x730c68 to 0x730de2 (378 bytes)
//
// 1 xrefs:
// > sub_7319C0 @ 0x731b98
//
// 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_730C68(int *a1, int a2, unsigned int a3, int a4, _DWORD *a5, int a6, int a7, int a8, int a9)
{
int v13; // r0
unsigned __int8 *v14; // r9
int v15; // r6
unsigned int v16; // r3
_DWORD *v17; // r2
int v18; // t1
_DWORD *v19; // r5
int i; // r3
int v21; // t1
int v22; // r7
int v23; // r11
int j; // r5
unsigned __int8 *v25; // r1
int *v26; // r2
int v27; // t1
unsigned __int8 v29; // r11
int v30; // r9
int *v31; // r0
unsigned __int8 *v32; // lr
int v33; // r1
int v34; // t1
_DWORD *v35; // r2
int v36; // r3
int v37; // t1
unsigned __int8 v38; // r2
unsigned __int8 *v39; // [sp+0h] [bp-114h]
int v40; // [sp+4h] [bp-110h]
_BYTE v41[260]; // [sp+10h] [bp-104h] BYREF
v13 = WebPSafeMalloc(a7, a7 >> 31, 1);
v14 = (unsigned __int8 *)v13;
if ( !v13 )
return 1;
if ( a6 > 0 )
{
v15 = *a5;
v16 = *a5 & 0xFFFF00FF;
if ( !v16 )
{
v17 = a5;
while ( ++v16 != a6 )
{
v18 = v17[1];
++v17;
if ( (v18 & 0xFFFF00FF) != 0 )
goto LABEL_16;
}
v19 = a5 - 1;
memset(v41, 0, 0x100u);
for ( i = 0; i != a6; ++i )
{
v21 = v19[1];
++v19;
v41[BYTE1(v21)] = i;
}
goto LABEL_9;
}
LABEL_16:
if ( a8 <= 0 )
goto LABEL_15;
v40 = 4 * a4;
v39 = (unsigned __int8 *)v13;
v29 = 0;
v30 = 0;
while ( a7 <= 0 )
{
LABEL_28:
++v30;
sub_712220(v39, a7, a9, a3);
a1 += a2;
a3 += v40;
if ( v30 == a8 )
{
v14 = v39;
goto LABEL_15;
}
}
v31 = a1;
v32 = v39 - 1;
while ( 1 )
{
v34 = *v31++;
v33 = v34;
if ( v34 == v15 )
goto LABEL_26;
if ( v33 != *a5 )
break;
v29 = 0;
v15 = v33;
v38 = 0;
LABEL_27:
*++v32 = v38;
if ( v31 == &a1[a7] )
goto LABEL_28;
}
v35 = a5;
v36 = 0;
while ( ++v36 != a6 )
{
v37 = v35[1];
++v35;
if ( v33 == v37 )
{
v38 = v36;
v29 = v36;
v15 = v33;
goto LABEL_27;
}
}
LABEL_26:
v38 = v29;
goto LABEL_27;
}
memset(v41, 0, 0x100u);
LABEL_9:
if ( a8 > 0 )
{
v22 = 4 * a2;
v23 = 4 * a4;
for ( j = 0; j != a8; ++j )
{
if ( a7 > 0 )
{
v25 = v14 - 1;
v26 = a1;
do
{
v27 = *v26++;
*++v25 = v41[BYTE1(v27)];
}
while ( &a1[a7] != v26 );
}
sub_712220(v14, a7, a9, a3);
a1 = (int *)((char *)a1 + v22);
a3 += v23;
}
}
LABEL_15:
WebPSafeFree(v14);
return 0;
}