//
// sub_BDD40 from 0xbdd40 to 0xbddb6 (118 bytes)
//
// 1 xrefs:
// > sub_BC194 @ 0xbc35c
//
// 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
//
int __fastcall sub_BDD40(int a1, int a2, _DWORD *a3, int *a4)
{
int i; // r4
int v9; // r6
int v10; // r0
int v11; // r6
for ( i = 0; i < a2; ++i )
{
if ( (*(unsigned __int8 *)(a1 + i) | 0x20) == 0x20 )
{
v9 = 0;
*(_BYTE *)(a1 + i) = 0;
while ( v9 != 3 )
{
if ( !sub_BE2AA(a1, off_E5E54[v9]) )
{
v10 = i + 1;
*a3 = v9;
while ( v10 < a2 )
{
if ( (*(unsigned __int8 *)(a1 + v10) | 0x20) == 0x20 )
{
v11 = 0;
*(_BYTE *)(a1 + v10) = 0;
*a4 = atoi((const char *)(a1 + i + 1));
return v11;
}
++v10;
}
return 31;
}
++v9;
}
return 31;
}
}
return 31;
}