//
// sub_100550EA8 from 0x100550ea8 to 0x100551124 (636 bytes)
//
// 3 xrefs:
// > sub_10054DB30 @ 0x10054ecd0
// > sub_10057AD10 @ 0x10057b2a0
// > sub_10057C160 @ 0x10057c3dc
//
// 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_100550EA8(__int64 *a1, char a2, void **a3)
{
__int64 v5; // x28
__int64 v6; // x8
__int64 v7; // x8
__int64 i; // x24
const char **j; // x23
char *v10; // x27
char *v11; // x26
__int64 v12; // x0
unsigned int v13; // t1
__uint32_t v14; // w0
char *v15; // x0
char *v16; // x26
__int64 v17; // x0
__uint32_t v18; // w0
__int64 result; // x0
__int64 v20; // [xsp+10h] [xbp-70h]
_QWORD v21[2]; // [xsp+18h] [xbp-68h]
v5 = *a1;
if ( (a2 & 1) != 0 )
{
if ( *(_BYTE *)(v5 + 976) )
{
v6 = *(_QWORD *)(v5 + 960);
LABEL_9:
v21[0] = v6;
v7 = 1;
goto LABEL_10;
}
LABEL_8:
v6 = *(_QWORD *)(v5 + 952);
goto LABEL_9;
}
if ( !*((_BYTE *)a1 + 740) || *((_BYTE *)a1 + 750) == 1 )
goto LABEL_8;
v21[0] = *(_QWORD *)(v5 + 952);
v20 = 1;
if ( *(_BYTE *)(v5 + 976) )
{
v21[1] = *(_QWORD *)(v5 + 960);
v7 = 2;
LABEL_10:
v20 = v7;
}
for ( i = 0; i < v20; ++i )
{
for ( j = (const char **)v21[i]; j; j = (const char **)j[1] )
{
v10 = (char *)*j;
v11 = strchr((char *)*j, 58);
if ( v11 )
{
while ( 1 )
{
v13 = (unsigned __int8)*++v11;
v12 = v13;
if ( !v13 )
break;
if ( (char)v12 < 0 )
v14 = __maskrune(v12, 0x4000u);
else
v14 = _DefaultRuneLocale.__runetype[v12] & 0x4000;
if ( !v14 )
{
if ( !*v11
|| a1[110] && (unsigned int)sub_10057405C("Host:", *j, 5)
|| *(_DWORD *)(v5 + 1064) == 3 && (unsigned int)sub_10057405C("Content-Type:", *j, 13)
|| *((_BYTE *)a1 + 751) && (unsigned int)sub_10057405C("Content-Length", *j, 14)
|| a1[113] && (unsigned int)sub_10057405C("Connection", *j, 10) )
{
break;
}
goto LABEL_41;
}
}
}
else
{
v15 = strchr(v10, 59);
if ( v15 )
{
v16 = v15 - 1;
do
{
v17 = (unsigned __int8)v16[2];
if ( !v16[2] )
{
++v16;
goto LABEL_39;
}
if ( (char)v17 < 0 )
v18 = __maskrune(v17, 0x4000u);
else
v18 = _DefaultRuneLocale.__runetype[v17] & 0x4000;
++v16;
}
while ( v18 );
if ( v16[1] )
continue;
LABEL_39:
if ( *v16 == 59 )
{
*v16 = 58;
LABEL_41:
result = sub_100550C00(a3, "%s\r\n", *j);
if ( (_DWORD)result )
return result;
}
}
}
}
}
return 0;
}