//
// sub_BAD734 from 0xbad734 to 0xbad93c (520 bytes)
//
// 2 xrefs:
// > sub_B7756C @ 0xb776a8
// > sub_B7756C @ 0xb778d0
//
// 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_BAD734(__int64 a1, unsigned __int8 a2)
{
int v2; // w23
__int64 v4; // x20
char *v5; // x1
__int64 v6; // x20
void **v7; // x24
int *v8; // x22
int v9; // w0
__int64 result; // x0
char *v11; // x25
unsigned int v12; // w21
const char *v13; // x1
const char *v14; // x1
v2 = a2;
v4 = *(_QWORD *)a1;
if ( a2 )
{
v5 = *(char **)(a1 + 392);
v6 = v4 + 35864;
v7 = (void **)(a1 + 1056);
v8 = (int *)(a1 + 1232);
*(_BYTE *)(v6 + 24) = 0;
if ( v5 )
goto LABEL_3;
}
else
{
v5 = *(char **)(a1 + 536);
v6 = v4 + 35832;
v7 = (void **)(a1 + 1080);
v8 = (int *)(a1 + 1200);
*(_BYTE *)(v6 + 24) = 0;
if ( v5 )
{
LABEL_3:
v9 = *v8;
if ( *v8 != 2 )
goto LABEL_4;
goto LABEL_9;
}
}
v5 = &byte_F288A0;
v9 = *v8;
if ( *v8 != 2 )
{
LABEL_4:
if ( v9 == 3 )
{
off_1231008(*v7);
*v7 = nullptr;
*(_BYTE *)(v6 + 24) = 1;
return 0;
}
else
{
result = sub_BACFB0(a1, v5);
if ( !(_DWORD)result )
{
result = sub_BAD444((int *)(a1 + 1264), (char **)(a1 + 1280), "YR\n", *v8);
if ( !(_DWORD)result )
{
off_1231008(*v7);
if ( v2 )
v14 = "Proxy-";
else
v14 = &byte_F288A0;
*v7 = sub_B8F880("%sAuthorization: %s\r\n", v14, *(const char **)(a1 + 1280));
off_1231008(*(void **)(a1 + 1280));
*(_QWORD *)(a1 + 1280) = 0;
return 0;
}
}
}
return result;
}
LABEL_9:
v11 = sub_B8F880("TT %s\n", *(const char **)(a1 + 1272));
result = 27;
if ( v11 )
{
v12 = sub_BAD444((int *)(a1 + 1264), (char **)(a1 + 1280), v11, *v8);
off_1231008(v11);
result = v12;
if ( !v12 )
{
off_1231008(*v7);
if ( v2 )
v13 = "Proxy-";
else
v13 = &byte_F288A0;
*v7 = sub_B8F880("%sAuthorization: %s\r\n", v13, *(const char **)(a1 + 1280));
*v8 = 3;
*(_BYTE *)(v6 + 24) = 1;
sub_BAD638(a1);
return 0;
}
}
return result;
}