//
// sub_846884 from 0x846884 to 0x8469ec (360 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:02:24 +0000
//
int __fastcall sub_846884(int a1, bool *a2)
{
int v3; // r10
unsigned __int8 *v5; // r0
int v6; // r3
unsigned __int8 *v7; // r10
int v8; // r3
int v9; // t1
char v10; // r2
bool v11; // zf
unsigned __int8 *v13; // r4
int v14; // r3
int v15; // t1
bool v16; // zf
int v17; // r3
int result; // r0
int v19; // r2
v3 = 0;
*a2 = 0;
sub_83E124(a1, 0);
*(_DWORD *)(a1 + 1140) = sub_846A00;
*(_DWORD *)(a1 + 1136) = sub_847974;
*(_DWORD *)(a1 + 1128) = "ctE";
*(_DWORD *)(a1 + 1132) = a1;
*(_DWORD *)(a1 + 1176) = -1;
sub_84D8A4(a1 + 1152, &off_C75700);
sub_84A744(a1 + 1088);
v5 = *(unsigned __int8 **)(a1 + 384);
*(_BYTE *)(a1 + 1172) = 1;
while ( 1 )
{
v6 = (int)v5;
if ( v5 )
v6 = 1;
if ( v3 )
v6 = 0;
if ( !v6 )
break;
if ( !*v5 )
{
v3 = *v5;
break;
}
v7 = v5;
if ( *v5 == 61 )
goto LABEL_19;
do
{
v9 = *++v7;
v8 = v9;
v10 = v9;
if ( v9 )
v10 = 1;
v11 = v8 == 61;
if ( v8 != 61 )
v11 = v8 == 0;
}
while ( !v11 );
if ( v8 != 59 && v10 & 1 )
{
LABEL_19:
v13 = v7;
do
{
v15 = *++v13;
v14 = v15;
v16 = v15 == 59;
if ( v15 != 59 )
v16 = v14 == 0;
}
while ( !v16 );
if ( !sub_83ABE4(v5, "AUTH=", 5) )
{
LABEL_25:
v3 = 3;
goto LABEL_26;
}
}
else
{
v13 = v7;
if ( !sub_83ABE4(v5, "AUTH=", 5) )
goto LABEL_25;
}
v3 = sub_84D7D0(a1 + 1152, (char *)v7 + 1);
LABEL_26:
if ( *v13 == 59 )
++v13;
v5 = v13;
}
v17 = *(_DWORD *)(a1 + 1164);
if ( !v17 )
{
LABEL_39:
*(_DWORD *)(a1 + 1176) = v17;
if ( v3 )
return v3;
goto LABEL_40;
}
if ( v17 != -33 )
{
v17 = 2;
goto LABEL_39;
}
*(_DWORD *)(a1 + 1176) = -1;
if ( v3 )
return v3;
LABEL_40:
v19 = *(_DWORD *)(a1 + 664);
*(_DWORD *)(a1 + 1144) = 1;
strcpy((char *)(a1 + 1184), "*");
if ( (*(_DWORD *)(v19 + 64) & 1) == 0 || *(_BYTE *)(a1 + 1148) )
{
LABEL_42:
result = sub_84A600(a1 + 1088, 0);
*a2 = *(_DWORD *)(a1 + 1144) == 0;
return result;
}
result = sub_855568(a1, v3, a1 + 1148);
if ( !result )
{
if ( !*(_BYTE *)(a1 + 1148) )
return v3;
goto LABEL_42;
}
return result;
}