//
// sub_DCA18 from 0xdca18 to 0xdca88 (112 bytes)
//
// 1 xrefs:
// > __divdf3 @ 0xdc8a0
//
// 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 11:42:06 +0000
//
int __fastcall sub_DCA18(int result, int a2, int a3, unsigned int a4)
{
bool v4; // cf
int v5; // r4
int v6; // r12
int v7; // r5
bool v8; // zf
bool v9; // zf
v7 = v6 & (a4 >> 20);
v8 = v5 == v6;
if ( v5 == v6 )
v8 = v7 == v6;
if ( v8 )
LABEL_25:
JUMPOUT(0xDC878);
if ( v5 == v6 )
{
if ( result | (a2 << 12) || v7 == v6 )
goto LABEL_25;
LABEL_26:
JUMPOUT(0xDC860);
}
if ( v7 == v6 )
{
if ( a3 | (a4 << 12) )
goto LABEL_25;
goto LABEL_27;
}
v9 = (result | (2 * a2)) == 0;
if ( result | (2 * a2) )
v9 = (a3 | (2 * a4)) == 0;
if ( v9 )
{
if ( result | (2 * a2) )
goto LABEL_26;
if ( !(a3 | (2 * a4)) )
goto LABEL_25;
LABEL_27:
JUMPOUT(0xDC814);
}
if ( v5 )
goto LABEL_23;
while ( 1 )
{
v4 = __CFSHL__(result, 1);
result *= 2;
a2 += v4 + a2;
if ( (a2 & 0x100000) != 0 )
break;
--v5;
}
if ( !v7 )
{
LABEL_23:
while ( 1 )
{
v4 = __CFSHL__(a3, 1);
a3 *= 2;
a4 += v4 + a4;
if ( (a4 & 0x100000) != 0 )
break;
--v7;
}
}
return result;
}