//
// sub_1005759F8 from 0x1005759f8 to 0x100575bcc (468 bytes)
//
// 2 xrefs:
// > ??> @ 0x10082e518
// > ??> @ 0x10082e598
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall sub_1005759F8(__int64 a1, bool *a2)
{
__int64 v4; // x22
__int64 v5; // x21
__int64 v6; // x8
const char *v7; // x0
char v8; // w8
const char *v9; // x24
char *v10; // x23
char v11; // t1
int v12; // w9
int v13; // w9
__int64 result; // x0
*a2 = 0;
*(_QWORD *)(a1 + 1416) = 1800000;
*(_QWORD *)(a1 + 1432) = sub_100575DC0;
v4 = a1 + 1336;
*(_BYTE *)(a1 + 737) = 0;
*(_QWORD *)(a1 + 1440) = sub_100576B48;
*(_DWORD *)(a1 + 1488) = -1;
v5 = a1 + 1456;
*(_QWORD *)(a1 + 1424) = a1;
sub_1005800EC(a1 + 1456, &off_10082E5F0);
sub_10057A75C(v4);
v6 = 0;
v7 = *(const char **)(a1 + 384);
*(_BYTE *)(a1 + 1480) = 1;
if ( v7 )
{
while ( 1 )
{
v8 = *v7;
v9 = v7;
if ( !*v7 )
break;
while ( 1 )
{
v10 = (char *)(v9 + 1);
if ( !v8 || v8 == 61 )
break;
v8 = *v10;
++v9;
}
while ( v8 && v8 != 59 )
{
v11 = *++v9;
v8 = v11;
}
if ( sub_1005679CC(v7, "AUTH=", 5u) )
v6 = sub_10057FF98(v5, v10, v9 - v10);
else
v6 = 3;
if ( *v9 == 59 )
v7 = v9 + 1;
else
v7 = v9;
if ( (_DWORD)v6 || !v7 )
goto LABEL_19;
}
v6 = 0;
}
LABEL_19:
v12 = *(_DWORD *)(v5 + 16);
if ( v12 == -33 )
{
v13 = -1;
LABEL_24:
*(_DWORD *)(a1 + 1488) = v13;
goto LABEL_25;
}
if ( v12 )
{
v13 = 2;
goto LABEL_24;
}
*(_DWORD *)(a1 + 1488) = 0;
LABEL_25:
if ( !(_DWORD)v6 )
{
*(_DWORD *)(a1 + 1448) = 1;
*(_WORD *)(a1 + 1496) = 42;
if ( (*(_BYTE *)(*(_QWORD *)(a1 + 800) + 124LL) & 1) == 0 || *(_BYTE *)(a1 + 1452) )
goto LABEL_30;
v6 = sub_100587124(a1, 0, a1 + 1452);
if ( !(_DWORD)v6 )
{
if ( *(_BYTE *)(a1 + 1452) )
{
LABEL_30:
result = sub_10057A59C(a1 + 1336, 0);
*a2 = *(_DWORD *)(a1 + 1448) == 0;
return result;
}
return 0;
}
}
return v6;
}