//
// sub_63E56C from 0x63e56c to 0x63e62e (194 bytes)
//
// 1 xrefs:
// > sub_62160C @ 0x623070
//
// 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
//
size_t __fastcall sub_63E56C(size_t result, int a2)
{
size_t v2; // r10
__int64 v4; // r8
__int64 v5; // r2
int *v6; // r1
int v7; // r1
__int64 v8; // r6
_BOOL4 v9; // r1
__int64 v10; // r8
int v11; // r2
int v12; // r4
if ( result )
{
v2 = result;
v4 = sub_62FDD0(*(_DWORD *)(result + 64));
v5 = sub_62FDF0(*(_DWORD *)(v2 + 64));
v6 = *(int **)(a2 + 732);
if ( v6 && (v7 = *v6) != 0 )
{
v8 = *(_QWORD *)(*(_DWORD *)v7 + 80);
v9 = v4 < v8;
if ( v4 < 1 )
v9 = 0;
if ( v9 )
{
if ( v5 < 1 )
{
v11 = *(_DWORD *)(a2 + 68);
v10 = *(_QWORD *)(a2 + 40);
goto LABEL_10;
}
v10 = *(_QWORD *)(a2 + 40);
LABEL_9:
v11 = *(_DWORD *)(a2 + 68);
LABEL_10:
v12 = 1;
LABEL_11:
sub_61807C(
v2,
"Conn: %ld (%p) Receive pipe weight: (%lld/%zu), penalized: %s\n",
v11,
(const void *)a2,
v8,
(size_t)v10,
(const char *)HIDWORD(v10));
return v12;
}
}
else
{
v8 = -2;
}
if ( v5 < 1 )
{
v12 = 0;
v11 = *(_DWORD *)(a2 + 68);
v10 = *(_QWORD *)(a2 + 40);
goto LABEL_11;
}
v10 = *(_QWORD *)(a2 + 40);
if ( v5 >= v10 )
{
v12 = 0;
v11 = *(_DWORD *)(a2 + 68);
goto LABEL_11;
}
goto LABEL_9;
}
return result;
}