//
// sub_91333C from 0x91333c to 0x91348c (336 bytes)
//
// 0 xrefs:
//
// 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:04:28 +0000
//
int __fastcall sub_91333C(unsigned __int8 *a1, int a2, int a3, int a4, int a5)
{
unsigned __int8 *v5; // r5
void *v6; // r11
unsigned __int8 *v8; // r3
int result; // r0
int v10; // lr
int v11; // r2
int v12; // r4
int v13; // r12
int v14; // r1
int v15; // r6
int v16; // r1
int v17; // r6
int v18; // r12
int v19; // r1
int v20; // r8
int v21; // [sp+4h] [bp-28h]
int v22; // [sp+8h] [bp-24h]
int v23; // [sp+10h] [bp-1Ch]
char *v25; // [sp+18h] [bp-14h]
char *v26; // [sp+1Ch] [bp-10h]
unsigned __int8 *v27; // [sp+20h] [bp-Ch]
unsigned __int8 *v28; // [sp+24h] [bp-8h]
v23 = 2 * a3 + 1;
v5 = (unsigned __int8 *)off_C76020;
v6 = off_C76024;
v8 = a1;
v25 = (char *)off_C76028;
v26 = (char *)off_C7602C;
v27 = a1;
v28 = a1 + 12;
do
{
v21 = 16;
do
{
result = v8[2];
v10 = v8[5];
v11 = v8[3];
v12 = v8[4];
v22 = v8[6];
v13 = v8[1];
if ( 4 * v5[v11 - v12] + v5[result - v10] <= v23 && a4 >= v5[*v8 - v13] && a4 >= v5[v13 - result] )
{
v14 = v5[result - v11];
if ( a4 >= v14 && a4 >= v5[v8[7] - v22] && a4 >= v5[v22 - v10] )
{
v15 = v5[v10 - v12];
if ( a4 >= v15 )
{
if ( a5 < v14 || a5 < v15 )
{
v20 = v26[result - v10] + 3 * (v12 - v11);
result = v25[(v20 + 4) >> 3];
v8[3] = *((_BYTE *)v6 + v11 + v25[(v20 + 3) >> 3]);
v8[4] = *((_BYTE *)v6 + v12 - result);
}
else
{
result += (int)v6;
v16 = 3 * (v12 - v11);
v17 = v25[(v16 + 4) >> 3];
v18 = v25[(v16 + 3) >> 3];
v19 = (v17 + 1) >> 1;
v8[2] = *(_BYTE *)(result + v19);
v8[3] = *((_BYTE *)v6 + v11 + v18);
v8[4] = *((_BYTE *)v6 + v12 - v17);
v8[5] = *((_BYTE *)v6 + v10 - v19);
}
}
}
}
v8 += a2;
--v21;
}
while ( v21 );
v8 = v27 + 4;
v27 = v8;
}
while ( v8 != v28 );
return result;
}