//
// sub_72DF4 from 0x72df4 to 0x72f48 (340 bytes)
//
// 1 xrefs:
// > sub_753C4 @ 0x7718a
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:41:03 +0000
//
int __fastcall sub_72DF4(int a1, const void **a2, int a3, int a4, int a5, int a6)
{
int result; // r0
const void **v8; // r8
unsigned int v10; // r8
unsigned int v11; // r9
int v12; // r0
unsigned int v13; // r10
unsigned int v14; // r4
int v15; // r0
char v16; // r0
unsigned int v17; // r2
unsigned int v18; // r1
int v19; // r1
__int16 v20; // r2
__int16 v21; // r0
int v23; // [sp+4h] [bp-34h]
int v24; // [sp+8h] [bp-30h]
int v25; // [sp+Ch] [bp-2Ch]
int v26; // [sp+10h] [bp-28h]
int v27; // [sp+14h] [bp-24h]
unsigned int v28; // [sp+18h] [bp-20h] BYREF
result = 31;
if ( a2 && a3 )
{
v8 = a2;
if ( *a2 )
{
v24 = a3;
LABEL_5:
if ( a4 )
{
result = sub_72BF8(a1, v8);
if ( !result )
{
v23 = a4;
if ( a4 >= 0x4000 )
LOWORD(a4) = 0x4000;
v27 = 0;
v26 = 0;
v10 = (unsigned __int16)a4;
LOBYTE(v11) = 17;
v12 = 0;
LABEL_10:
v13 = (unsigned __int16)v12;
v25 = v12;
while ( 1 )
{
while ( 1 )
{
while ( 1 )
{
if ( v10 <= v13 )
{
sub_72C6C(a1);
a4 = v23 - v10;
v8 = a2;
goto LABEL_5;
}
v14 = (unsigned __int8)v11;
sub_72B92(a1, (unsigned __int8)v11, (int *)&v28);
if ( (unsigned __int8)v11 > 6u )
break;
v15 = v28;
if ( v28 != 1 << (v11 - 1) )
goto LABEL_27;
sub_72B92(a1, 4u, (int *)&v28);
v16 = v28;
v11 = v28 + 1;
v28 = v11;
if ( v11 >= v14 )
LOBYTE(v11) = v16 + 2;
}
if ( (unsigned __int8)v11 > 0x10u )
break;
v17 = 0xFFFFu >> (17 - v11);
v18 = (unsigned __int16)(v17 - 8);
v15 = v28;
if ( v28 <= v18 || v28 > (unsigned __int16)(v17 + 8) )
{
if ( (unsigned __int8)v11 <= 0xFu )
LABEL_27:
v15 = (__int16)(v15 << (16 - v11)) >> (16 - v11);
LABEL_28:
v19 = v27 + v15;
v20 = v26 + v27 + v15;
v21 = v27 + v15;
v26 += v19;
v27 = v19;
if ( a5 )
v21 = v20;
*(_WORD *)(v24 + 2 * a6) = v21;
v24 += 2 * a6;
v12 = v25 + 1;
goto LABEL_10;
}
LOBYTE(v11) = v28 - (v17 - 8);
v28 -= v18;
if ( v15 - v18 >= v14 )
LOBYTE(v11) = v11 + 1;
}
if ( (unsigned __int8)v11 != 17 )
break;
v15 = v28;
if ( (v28 & 0x10000) == 0 )
goto LABEL_28;
LOBYTE(v11) = v28 + 1;
}
sub_72C6C(a1);
return 19;
}
}
else
{
return 0;
}
}
else
{
return 31;
}
}
return result;
}