//
// __aeabi_d2uiz from 0xaf6234 to 0xaf6288 (84 bytes)
//
// 7 xrefs:
// > sub_9E1868 @ 0x9e1928
// > __aeabi_f2ulz @ 0xaf6610
// > __aeabi_f2ulz @ 0xaf663c
// > __aeabi_d2ulz @ 0xaf6678
// > __aeabi_d2ulz @ 0xaf66a4
// > ??> @ 0x78fdc
// > ??> @ 0x8590c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:11:02 +0000
//
// 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;
}