//
// sub_1005B5980 from 0x1005b5980 to 0x1005b5a59 (217 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:32:40 +0000
//
char __fastcall sub_1005B5980(__int64 a1, __int64 a2, char a3)
{
__int64 v3; // rax
__int64 v4; // rcx
__int64 v5; // r15
unsigned int v6; // r14d
__int64 v7; // rbx
_DWORD v9[9]; // [rsp-24h] [rbp-24h] BYREF
if ( !a2 )
return v3;
v9[0] = HIDWORD(v3);
v4 = *(_QWORD *)(a1 + 1096);
LOBYTE(v3) = -(a3 | (v4 == 0)) | 0x4B;
if ( a3 )
{
BYTE2(v9[0]) = -1;
LOWORD(v9[0]) = -1;
v5 = *(_QWORD *)(a2 + 624);
v6 = (unsigned __int8)v3;
if ( !v5 )
goto LABEL_8;
goto LABEL_7;
}
if ( v4 )
{
memset(v9, 125, 3);
v5 = *(_QWORD *)(a2 + 624);
v6 = (unsigned __int8)v3;
if ( !v5 )
goto LABEL_8;
goto LABEL_7;
}
BYTE2(v9[0]) = -106;
LOWORD(v9[0]) = -26986;
v5 = *(_QWORD *)(a2 + 624);
v6 = (unsigned __int8)v3;
if ( v5 )
{
LABEL_7:
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 1024LL))(v5, v6);
LOBYTE(v3) = (*(__int64 (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v5 + 1072LL))(v5, v9);
}
LABEL_8:
v7 = *(_QWORD *)(a2 + 648);
if ( v7 )
{
(*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v7 + 912LL))(v7, v6);
LOBYTE(v3) = (*(__int64 (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v7 + 960LL))(v7, v9);
}
return v3;
}