//
// sub_995104 from 0x995104 to 0x9951de (218 bytes)
//
// 2 xrefs:
// > sub_993ED0 @ 0x9946b8
// > sub_9957F0 @ 0x995874
//
// 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:06:39 +0000
//
_DWORD *__fastcall sub_995104(_DWORD *a1, int *a2)
{
int v2; // s0
unsigned int v3; // s1
_DWORD *v6; // r5
int v7; // r10
unsigned int v8; // r6
int v9; // r0
unsigned int v10; // r2
int v11; // r0
unsigned int v12; // r1
int v13; // r4
int v14; // r0
unsigned int v16; // [sp+4h] [bp-20h] BYREF
int v17; // [sp+8h] [bp-1Ch] BYREF
v6 = sub_993E20(1);
if ( v6 != (_DWORD *)&unk_C50F20 )
{
v7 = (v3 >> 20) & 0x7FF;
v8 = v3 & 0xFFFFF;
if ( v7 )
v8 |= 0x100000u;
v16 = v8;
v17 = v2;
if ( v2 )
{
v9 = sub_9969B8(&v17);
if ( v9 )
{
v10 = v8 << (32 - v9);
v8 >>= v9;
v6[5] = v17 | v10;
v16 = v8;
}
else
{
v6[5] = v17;
}
v13 = 1;
v6[6] = v8;
if ( v8 )
v13 = 2;
v6[4] = v13;
}
else
{
v11 = sub_9969B8(&v16);
v12 = v16;
v9 = v11 + 32;
v13 = 1;
v6[4] = 1;
v6[5] = v12;
}
if ( v7 )
{
*a1 = v7 - 1075 + v9;
v14 = 53 - v9;
}
else
{
*a1 = v9 - 1074;
v14 = 32 * v13 - sub_996410(v6[v13 + 4]);
}
*a2 = v14;
}
return v6;
}