//
// __aeabi_d2uiz from 0xdca88 to 0xdcadc (84 bytes)
//
// 5 xrefs:
// > j___aeabi_d2uiz @ 0xe3548
// > ??> @ 0x295c
// > ??> @ 0x2ccc
// > j___aeabi_d2uiz @ 0xe3548
// > ??> @ 0xe72bc
//
// 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
//
// Alternative name is '__fixunsdfsi'
unsigned int __fastcall _aeabi_d2uiz(unsigned int a1, int a2)
{
int v2; // r2
bool v3; // cf
int v4; // r2
int v5; // r2
v2 = 2 * a2;
if ( __CFSHL__(a2, 1) )
return 0;
v3 = __CFADD__(v2, 0x200000);
v4 = v2 + 0x200000;
if ( !v3 )
{
if ( v4 < 0 )
{
v5 = -993 - (v4 >> 21);
if ( v5 >= 0 )
return ((a2 << 11) | 0x80000000 | (a1 >> 21)) >> v5;
return -1;
}
return 0;
}
if ( !(a1 | (a2 << 12)) )
return -1;
return 0;
}