//
// sub_1005D0C80 from 0x1005d0c80 to 0x1005d0e58 (472 bytes)
//
// 1 xrefs:
// > ??> @ 0x10083afd0
//
// 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_1005D0C80(__int64 a1, int a2, int a3, _QWORD *a4)
{
__int64 v5; // x20
__int64 result; // x0
__int64 v7; // x4
v5 = *(_QWORD *)(a1 + 40);
if ( a2 <= 4096 )
{
result = 1;
switch ( a2 )
{
case 1:
if ( (unsigned int)sub_1005EB2A0(a4) == 64
|| (unsigned int)sub_1005EB2A0(a4) == 116
|| (unsigned int)sub_1005EB2A0(a4) == 66
|| (unsigned int)sub_1005EB2A0(a4) == 675
|| (unsigned int)sub_1005EB2A0(a4) == 672
|| (unsigned int)sub_1005EB2A0(a4) == 673
|| (unsigned int)sub_1005EB2A0(a4) == 674 )
{
goto LABEL_20;
}
v7 = 194;
goto LABEL_32;
case 2:
sub_1005E0E48(10, 120, 150, "dsa_pmeth.c", 211);
return 4294967294LL;
case 5:
case 7:
case 11:
return result;
case 13:
*a4 = *(_QWORD *)(v5 + 24);
return 1;
default:
return 4294967294LL;
}
}
if ( a2 == 4099 )
{
if ( (unsigned int)sub_1005EB2A0(a4) == 64
|| (unsigned int)sub_1005EB2A0(a4) == 675
|| (unsigned int)sub_1005EB2A0(a4) == 672 )
{
LABEL_20:
*(_QWORD *)(v5 + 24) = a4;
return 1;
}
else
{
v7 = 180;
LABEL_32:
sub_1005E0E48(10, 120, 106, "dsa_pmeth.c", v7);
return 0;
}
}
else if ( a2 == 4098 )
{
result = 4294967294LL;
if ( a3 <= 223 )
{
if ( a3 && a3 != 160 )
return result;
LABEL_26:
*(_DWORD *)(v5 + 4) = a3;
return 1;
}
if ( a3 == 224 || a3 == 256 )
goto LABEL_26;
}
else if ( a2 == 4097 && a3 >= 256 )
{
*(_DWORD *)v5 = a3;
return 1;
}
else
{
return 4294967294LL;
}
return result;
}