//
// sub_846770 from 0x846770 to 0x846862 (242 bytes)
//
// 2 xrefs:
// > sub_846EF0 @ 0x84758c
// > sub_847974 @ 0x847db2
//
// 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:02:24 +0000
//
int __fastcall sub_846770(_DWORD *a1)
{
_DWORD *v2; // r3
int v3; // r2
char *v4; // r3
int v5; // r4
int result; // r0
const char *v7; // r6
int v8; // r3
int v9; // r4
const char *v10; // r1
int v11; // r8
int v12; // t1
size_t v13; // r4
char *v14; // r0
char *v15; // r8
int v16; // r3
char *v17; // r1
bool v18; // zf
int v19; // t1
int v20; // r3
v2 = *(_DWORD **)(*a1 + 332);
v3 = v2[7];
if ( v3 )
{
v4 = (char *)v2[8];
if ( !v4 )
v4 = &byte_BF4ECA;
v5 = sub_8461F8((int)a1, "%s%s", v3, (int)v4);
goto LABEL_5;
}
v7 = (const char *)v2[1];
if ( v7 )
{
v8 = *(unsigned __int8 *)v7;
if ( !*v7 )
goto LABEL_29;
v9 = 0;
v10 = v7;
v11 = 0;
do
{
if ( v8 == 92 )
{
++v11;
}
else if ( v8 == 34 )
{
++v9;
}
v12 = *(unsigned __int8 *)++v10;
v8 = v12;
}
while ( v12 );
if ( v11 | v9 )
{
v13 = v9 + v11 + strlen(v7);
v14 = (char *)off_D200AC(v13 + 1);
v15 = v14;
if ( !v14 )
return 27;
v16 = *(unsigned __int8 *)v7;
v17 = v14;
if ( *v7 )
{
do
{
v18 = v16 == 92;
if ( v16 != 92 )
v18 = v16 == 34;
if ( v18 )
*v17++ = 92;
*v17++ = *v7;
v19 = *(unsigned __int8 *)++v7;
v16 = v19;
}
while ( v19 );
}
v20 = 0;
v14[v13] = 0;
}
else
{
LABEL_29:
v15 = off_D200B8(v7);
}
}
else
{
v15 = off_D200B8(&byte_BF4ECA);
}
if ( !v15 )
return 27;
v5 = sub_8461F8((int)a1, "LIST \"%s\" *", (int)v15, v20);
off_D200B0(v15);
LABEL_5:
result = v5;
if ( !v5 )
a1[286] = 7;
return result;
}