//
// sub_94760C from 0x94760c to 0x9477ae (418 bytes)
//
// 2 xrefs:
// > sub_947E68 @ 0x9482ae
// > sub_948464 @ 0x9489ce
//
// 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 12:05:12 +0000
//
int __fastcall sub_94760C(_DWORD *a1, unsigned int a2)
{
unsigned int v2; // lr
int v4; // r2
unsigned int v5; // r4
int v7; // r7
unsigned int v8; // r0
unsigned int v9; // lr
unsigned int v10; // r3
int v11; // r5
unsigned int v12; // r1
unsigned int v13; // r1
int v14; // r12
int v15; // r10
int v16; // r8
int v17; // r4
unsigned int v18; // r1
unsigned __int8 *v19; // r2
int result; // r0
int v21; // r9
unsigned __int8 *v22; // r2
unsigned __int8 *v23; // r0
int v24; // r4
int v25; // t1
_BOOL4 v26; // r4
unsigned __int8 *v27; // r11
unsigned __int8 *v28; // [sp+0h] [bp-1Ch]
int v29; // [sp+4h] [bp-18h]
unsigned int v30; // [sp+8h] [bp-14h]
unsigned int v31; // [sp+Ch] [bp-10h]
unsigned __int8 *v32; // [sp+10h] [bp-Ch]
_DWORD *v33; // [sp+14h] [bp-8h]
v4 = a1[11];
v5 = a1[27];
v7 = a1[14];
v8 = a1[30];
if ( v5 > v4 - 262 )
v2 = v5 + 262;
v28 = (unsigned __int8 *)(v7 + v5);
if ( v5 <= v4 - 262 )
v9 = 0;
else
v9 = v2 - v4;
v10 = a1[31];
v11 = v8;
v12 = v7 + v5 + 258;
v30 = v12;
if ( v8 >= a1[35] )
{
v12 = v7 + v5 + 258;
v10 >>= 2;
}
v32 = (unsigned __int8 *)(v12 - 258);
v13 = a1[36];
v14 = a1[16];
v15 = v28[v8 - 1];
v16 = a1[13];
v17 = v28[v8];
if ( v13 >= a1[29] )
v13 = a1[29];
v29 = v13;
v18 = a2;
v31 = a1[29];
v33 = a1;
do
{
v19 = (unsigned __int8 *)(v7 + v18);
if ( *(unsigned __int8 *)(v7 + v18 + v11) != v17 )
goto LABEL_12;
v21 = v19[v11 - 1];
if ( v21 != v15 || *v19 != *v28 || v19[1] != v28[1] )
goto LABEL_12;
v22 = v19 + 2;
v23 = v28 + 2;
while ( 1 )
{
v27 = v22;
if ( v23[1] != v22[1] )
{
++v23;
goto LABEL_33;
}
if ( v23[2] != v22[2] )
break;
if ( v23[3] != v22[3] )
{
v23 += 3;
goto LABEL_33;
}
if ( v23[4] != v22[4] )
{
v23 += 4;
goto LABEL_33;
}
if ( v23[5] != v22[5] )
{
v23 += 5;
goto LABEL_33;
}
if ( v23[6] != v22[6] )
{
v23 += 6;
goto LABEL_33;
}
v24 = v22[7];
v22 += 8;
if ( v23[7] != v24 )
{
v23 += 7;
goto LABEL_33;
}
v25 = v23[8];
v23 += 8;
v26 = v25 == v27[8];
if ( v30 <= (unsigned int)v23 )
v26 = 0;
if ( !v26 )
goto LABEL_33;
}
v23 += 2;
LABEL_33:
result = (int)&v23[-v30 + 258];
v28 = v32;
if ( v11 >= result )
{
v17 = *(unsigned __int8 *)(v7 + v18 + v11);
v15 = v21;
LABEL_12:
result = v11;
goto LABEL_13;
}
v33[28] = v18;
if ( v29 <= result )
break;
v11 = result;
v17 = v32[result];
v15 = v32[result - 1];
LABEL_13:
v18 = *(unsigned __int16 *)(v14 + 2 * (v18 & v16));
if ( v9 >= v18 )
break;
--v10;
}
while ( v10 );
if ( result >= v31 )
return v31;
return result;
}