//
// sub_100481004 from 0x100481004 to 0x1004810c0 (188 bytes)
//
// 1 xrefs:
// > sub_100480EE8 @ 0x100480f40
//
// 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_100481004(__int64 a1, __int64 a2, unsigned int a3, int a4)
{
unsigned int v7; // w21
unsigned int v8; // w8
__int16 v9; // w20
if ( a4 == 2 )
{
v7 = *(_DWORD *)(a1 + 2136);
if ( v7 == a3 )
return 0;
v8 = *(_DWORD *)(a1 + 2136);
if ( v7 <= a3 )
goto LABEL_10;
sub_1004B2C44(a1, 0);
while ( 1 )
{
v8 = *(_DWORD *)(a1 + 2136);
LABEL_10:
if ( v8 >= a3 )
break;
sub_100481144(a1, 1);
}
if ( v7 <= a3 )
{
return 0;
}
else
{
v9 = *(_WORD *)(a1 + 3048);
sub_1004B2E70(a1);
*(_WORD *)(a1 + 3048) = v9;
return 0;
}
}
else if ( a4 == 256 )
{
sub_1004B2C44(a1, 0);
*(_DWORD *)(a1 + 3068) = a3;
*(_DWORD *)(a1 + 3084) = a3;
return 0;
}
else
{
return 19;
}
}