//
// sub_6386CC from 0x6386cc to 0x638828 (348 bytes)
//
// 0 xrefs:
//
// 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
//
int __fastcall sub_6386CC(int a1, bool *a2)
{
int v4; // r4
int result; // r0
char *v6; // r1
int v7; // r6
int v8; // r1
int v9; // r1
_DWORD *v10; // r1
const char *v11; // r3
const char *v12; // r2
const char *v13; // r1
int v14; // r6
int v15; // r3
int v16; // r0
const char *v17; // r2
*a2 = 0;
v4 = sub_623DF4(
*(_DWORD *)a1,
*(char **)(*(_DWORD *)a1 + 34676),
0,
(_DWORD *)(*(_DWORD *)(*(_DWORD *)a1 + 332) + 4),
nullptr,
1);
if ( v4 )
return v4;
v6 = *(char **)(*(_DWORD *)a1 + 984);
if ( v6 )
{
result = sub_623DF4(*(_DWORD *)a1, v6, 0, (_DWORD *)(*(_DWORD *)(*(_DWORD *)a1 + 332) + 8), nullptr, 1);
if ( result )
return result;
v7 = *(_DWORD *)a1;
}
else
{
v7 = *(_DWORD *)a1;
}
*(_QWORD *)(v7 + 80) = -1;
sub_610DC4(v7, 0);
sub_610CF4(v7, 0);
sub_610EC8((_DWORD *)v7, v8, -1, -1);
sub_610E94((_DWORD *)v7, v9, -1, -1);
if ( *(_BYTE *)(*(_DWORD *)a1 + 904) )
**(_DWORD **)(*(_DWORD *)a1 + 332) = 1;
*a2 = 0;
v10 = *(_DWORD **)(*(_DWORD *)a1 + 332);
v11 = (const char *)v10[1];
if ( *v11 )
{
if ( !*(_BYTE *)(*(_DWORD *)a1 + 893) )
{
v12 = "RETR";
LABEL_13:
v13 = (const char *)v10[2];
v14 = a1 + 1088;
if ( v13 && *v13 )
v12 = v13;
result = sub_63A7E4(a1 + 1088, "%s %s", v12, v11);
goto LABEL_17;
}
*v10 = 1;
if ( *v11 )
{
v12 = "LIST";
goto LABEL_13;
}
}
v17 = (const char *)v10[2];
v14 = a1 + 1088;
if ( v17 )
{
if ( !*v17 )
v17 = "LIST";
}
else
{
v17 = "LIST";
}
result = sub_63A7E4(a1 + 1088, "%s", v17);
LABEL_17:
if ( !result )
{
v15 = *(_DWORD *)(a1 + 664);
*(_DWORD *)(a1 + 1144) = 9;
if ( (*(_DWORD *)(v15 + 64) & 1) == 0 || *(_BYTE *)(a1 + 1148) )
{
LABEL_20:
v16 = sub_63A580(v14, 0);
*a2 = *(_DWORD *)(a1 + 1144) == 0;
return v16;
}
result = sub_6454E8(a1, 0, a1 + 1148);
if ( !result )
{
if ( !*(_BYTE *)(a1 + 1148) )
return v4;
goto LABEL_20;
}
}
return result;
}