//
// sub_63B97C from 0x63b97c to 0x63bac4 (328 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_63B97C(int *a1, _BYTE *a2)
{
int v2; // r10
int v3; // r8
const char *v5; // r5
int v6; // r0
void *v7; // r11
int v8; // r5
int v9; // r4
int result; // r0
size_t v11; // r0
char *v12; // r3
int v13; // t1
void *v14; // [sp+14h] [bp-10h] BYREF
size_t v15; // [sp+18h] [bp-Ch] BYREF
int v16; // [sp+1Ch] [bp-8h] BYREF
v2 = *a1;
v3 = a1[104];
v5 = *(const char **)(*a1 + 34676);
*a2 = 1;
if ( strlen(v5) > 2 )
{
v11 = strlen(v5 + 2);
v12 = (char *)(v5 + 1);
if ( v11 )
{
do
{
v13 = (unsigned __int8)*++v12;
if ( v13 == 63 )
*v12 = 9;
}
while ( v12 != &v5[v11 + 1] );
}
sub_623DF4(v2, (char *)v5 + 2, 0, &v14, &v16, 0);
v7 = v14;
v6 = v16;
if ( !v14 )
return 27;
}
else
{
v6 = 0;
v7 = nullptr;
v16 = 0;
v14 = &byte_9B1912;
}
v8 = sub_63B800(v6);
while ( 1 )
{
v9 = sub_61831C((int)a1, v3, (int)v14, v8, (int *)&v15);
if ( v9 )
goto LABEL_8;
v9 = sub_618748((int)a1, 2, (const char *)v14, v15);
if ( v9 )
goto LABEL_8;
v8 -= v15;
v14 = (char *)v14 + v15;
if ( v8 <= 0 )
break;
if ( sub_632D88(-1, -1, v3, 100) < 0 )
{
v9 = 55;
LABEL_8:
off_ABAEB0(v7);
LABEL_9:
sub_6180F8(v2, "Failed sending Gopher request");
return v9;
}
}
off_ABAEB0(v7);
v9 = sub_6181B4(v3, a1, (int)&word_9B1DDC);
if ( v9 )
goto LABEL_9;
result = sub_618748((int)a1, 2, (const char *)&word_9B1DDC, 2u);
if ( !result )
{
sub_62A980(a1, 0, -1, -1, 0, v2 + 112, -1, nullptr);
return 0;
}
return result;
}