//
// sub_82A04C from 0x82a04c to 0x82a19a (334 bytes)
//
// 2 xrefs:
// > sub_82A1B4 @ 0x82a2ec
// > sub_82AC68 @ 0x82b6aa
//
// 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:01:59 +0000
//
int __fastcall sub_82A04C(int *a1)
{
int v2; // r3
int v3; // r1
const char *v4; // r2
int v5; // r5
int v6; // r0
int v7; // r2
int v8; // r5
int result; // r0
const char *v10; // r2
int v11; // r3
int v12; // r3
int v13; // r3
int v14; // r3
const char *v15; // r2
v2 = *a1;
if ( *(_BYTE *)(*a1 + 889) || *(_DWORD *)(v2 + 628) )
{
v10 = (const char *)a1[290];
if ( v10 )
{
result = sub_84A864(a1 + 272, "MDTM %s", v10);
if ( !result )
a1[298] = 18;
return result;
}
v3 = *(_DWORD *)(v2 + 332);
goto LABEL_26;
}
v3 = *(_DWORD *)(v2 + 332);
if ( !*(_BYTE *)(v2 + 904) )
{
v11 = *(_DWORD *)(v3 + 12);
if ( v11 == 1 )
{
v4 = (const char *)a1[290];
if ( !v4 )
return sub_82A33C(a1);
LABEL_29:
result = sub_84A864(a1 + 272, "SIZE %s", v4);
if ( !result )
a1[298] = 23;
return result;
}
goto LABEL_20;
}
v4 = (const char *)a1[290];
if ( !v4 )
{
LABEL_26:
v11 = *(_DWORD *)(v3 + 12);
if ( v11 == 1 )
return sub_82A33C(a1);
LABEL_20:
if ( !v11 )
return sub_82A33C(a1);
v12 = a1[290];
goto LABEL_22;
}
v5 = *((unsigned __int8 *)a1 + 1176);
if ( *(_BYTE *)(v2 + 891) )
v6 = 65;
else
v6 = 73;
if ( v5 == v6 )
{
v12 = *(_DWORD *)(v3 + 12);
if ( v12 == 1 )
goto LABEL_29;
LABEL_22:
if ( v12 )
{
result = sub_84A864(a1 + 272, "REST %d", 0);
if ( !result )
a1[298] = 26;
return result;
}
return sub_82A33C(a1);
}
*(_DWORD *)(v3 + 12) = 1;
v7 = 73;
v8 = 73;
if ( *(_BYTE *)(v2 + 891) )
{
v7 = 65;
v8 = 65;
}
if ( *((unsigned __int8 *)a1 + 1176) != v8 )
{
result = sub_84A864(a1 + 272, "TYPE %c", v7);
if ( !result )
{
*((_BYTE *)a1 + 1176) = v8;
a1[298] = 19;
return 0;
}
return result;
}
v13 = *a1;
a1[298] = 19;
v14 = *(_DWORD *)(*(_DWORD *)(v13 + 332) + 12);
if ( v14 != 1 )
{
if ( v14 && a1[290] )
{
result = sub_84A864(a1 + 272, "REST %d", 0);
if ( !result )
{
a1[298] = 26;
return 0;
}
return result;
}
return sub_82A33C(a1);
}
v15 = (const char *)a1[290];
if ( !v15 )
return sub_82A33C(a1);
result = sub_84A864(a1 + 272, "SIZE %s", v15);
if ( !result )
{
a1[298] = 23;
return 0;
}
return result;
}