//
// sub_B4AF80 from 0xb4af80 to 0xb4b258 (728 bytes)
//
// 3 xrefs:
// > sub_B653E4 @ 0xb65418
// > sub_B653E4 @ 0xb65478
// > sub_B653E4 @ 0xb65514
//
// 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_B4AF80(__int64 a1)
{
unsigned __int8 *v2; // x3
__int64 v3; // x2
int v4; // w0
__int64 v5; // x0
unsigned int v6; // w0
unsigned int v7; // w0
__int64 v8; // x1
__int64 v9; // x0
__int64 v10; // x0
unsigned int v11; // [xsp+0h] [xbp-10h]
unsigned int v12; // [xsp+4h] [xbp-Ch]
switch ( *(_DWORD *)(a1 + 32) )
{
case 1:
v11 = 3;
v12 = 4;
return v11 | ((unsigned __int64)v12 << 32);
case 2:
v11 = 4;
v12 = 4;
return v11 | ((unsigned __int64)v12 << 32);
case 3:
v12 = 4;
v11 = 5;
return v11 | ((unsigned __int64)v12 << 32);
case 4:
v12 = 4;
v11 = 6;
return v11 | ((unsigned __int64)v12 << 32);
case 5:
v12 = 4;
v11 = 7;
return v11 | ((unsigned __int64)v12 << 32);
case 6:
v12 = 4;
v11 = 8;
return v11 | ((unsigned __int64)v12 << 32);
case 7:
v6 = 9;
return v6 | 0x200000000LL;
case 8:
v6 = 10;
return v6 | 0x200000000LL;
case 9:
v7 = 11;
return v7 | 0x200000000LL;
case 0xA:
v11 = 15;
v12 = 1;
return v11 | ((unsigned __int64)v12 << 32);
case 0x14:
v2 = *(unsigned __int8 **)(a1 + 16);
v3 = *(_QWORD *)(a1 + 24) - (_QWORD)v2;
if ( !v3 )
goto LABEL_40;
v4 = *v2;
switch ( v4 )
{
case 'o':
v5 = 0;
while ( v3 != ++v5 )
{
if ( (unsigned __int8)aBaseColor[v5 + 8] != v2[v5] )
goto LABEL_2;
}
if ( !aBaseColor[v3 + 8] )
{
v11 = 1;
v12 = 4;
return v11 | ((unsigned __int64)v12 << 32);
}
LABEL_2:
v11 = 0;
v12 = 0;
return v11 | ((unsigned __int64)v12 << 32);
case 'a':
v8 = 0;
while ( v3 != ++v8 )
{
if ( (unsigned __int8)aSetupScaleComm[v8 + 16] != v2[v8] )
goto LABEL_2;
}
if ( !aSetupScaleComm[v3 + 16] )
{
v11 = 2;
v12 = 4;
return v11 | ((unsigned __int64)v12 << 32);
}
goto LABEL_2;
case 'd':
v9 = 0;
while ( v3 != ++v9 )
{
if ( (unsigned __int8)aDiv[v9] != v2[v9] )
goto LABEL_2;
}
if ( aDiv[v3] )
goto LABEL_2;
v7 = 12;
break;
case 'm':
v10 = 0;
while ( v3 != ++v10 )
{
if ( (unsigned __int8)aGravityMod[v10 + 8] != v2[v10] )
goto LABEL_2;
}
LABEL_40:
if ( aGravityMod[v3 + 8] )
goto LABEL_2;
v7 = 13;
break;
default:
goto LABEL_2;
}
return v7 | 0x200000000LL;
default:
goto LABEL_2;
}
}