//
// sub_44A22 from 0x44a22 to 0x44c02 (480 bytes)
//
// 0 xrefs:
//
// 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:40:37 +0000
//
int __fastcall sub_44A22(_DWORD *a1, int a2)
{
int result; // r0
_DWORD *v5; // r6
int v6; // r8
unsigned __int64 *v7; // r6
bool v8; // zf
unsigned __int64 v9; // kr00_8
bool v10; // zf
int v11; // r0
__int64 v12; // kr08_8
int v13; // s0
int v14; // r0
int v15; // r1
int v16; // r12
int v17; // r2
bool v18; // zf
unsigned int v19; // r0
int v20; // r3
float v21; // s0
unsigned int v22; // r1
unsigned int v23; // r6
int v24; // r5
unsigned int v25; // r1
int v26; // r1
char v27; // [sp+7h] [bp-21h] BYREF
__int64 v28; // [sp+8h] [bp-20h] BYREF
unsigned __int64 v29; // [sp+10h] [bp-18h] BYREF
result = sub_44CA8();
if ( !result )
{
if ( (a1[8] & 0x60) != 0x40 )
return 0;
v5 = (_DWORD *)a1[3];
if ( (v5[10] & 0x30000) == 0x10000 )
return 0;
result = 0;
if ( (int)a1[7] >= 0 )
{
v29 = 0;
v28 = 0;
v27 = 0;
v6 = v5[14];
result = (*(int (__fastcall **)(_DWORD *, unsigned __int64 *, __int64 *, char *))(*v5 + 116))(
v5,
&v29,
&v28,
&v27);
if ( !result )
{
v7 = (unsigned __int64 *)(HIDWORD(v28) | HIDWORD(v29));
if ( v28 | v29 )
{
v8 = v6 == 0;
if ( v6 )
{
v7 = *(unsigned __int64 **)(v6 + 52);
v8 = v7 == nullptr;
}
if ( v8 )
v9 = 0;
else
v9 = *v7;
if ( v9 < v29 )
goto LABEL_18;
if ( v28 - 1 < v9 )
{
if ( v27 )
a1[8] &= ~0x40u;
LABEL_18:
a2 = 0;
}
}
v10 = v6 == 0;
if ( v6 )
v10 = *(_BYTE *)(v6 + 49) == 0;
if ( !v10 )
a1[8] &= ~0x40u;
if ( a2 )
{
v11 = a1[3];
v12 = *(_QWORD *)(a1 + 11);
v13 = (int)(float)((float)((float)(*(float *)(v11 + 28) * *(float *)(v11 + 388))
* (float)((float)(1.0 - *(float *)(v11 + 184))
+ (float)(*(float *)(v11 + 72) * *(float *)(v11 + 184))))
* *(float *)(*(_DWORD *)(v11 + 16) + 356));
v14 = v13 * a2 / 1000;
if ( HIDWORD(v12) == 1 )
v14 = v13 * a2 / -1000;
a1[11] = v14 + v12;
}
else
{
v14 = 0;
}
v15 = a1[5];
if ( !v15 )
return 0;
v16 = a1[7] & 4;
v17 = a1[7] & 2;
if ( !v17 )
{
v18 = v16 == 0;
if ( v16 )
v18 = a1[13] == 0;
if ( v18 )
{
v19 = *(_DWORD *)(v15 + 44);
if ( a1[11] >= v19 )
{
a1[11] = v19;
LABEL_55:
a1[8] &= ~0x40u;
}
return 0;
}
}
v20 = a1[3];
while ( 1 )
{
v21 = *(float *)(v20 + 388);
if ( v21 <= 0.0 || (v22 = a1[14], v23 = a1[11], v23 < a1[15] + v22) )
{
if ( v21 >= 0.0 )
return 0;
v23 = a1[11];
v22 = a1[14];
if ( v23 > v22 )
return 0;
}
v24 = a1[13];
if ( !v24 )
{
if ( !a1[12] && v21 > 0.0 )
v22 += a1[15];
a1[11] = v22;
goto LABEL_55;
}
if ( v17 )
break;
if ( v16 )
{
a1[12] = a1[12] == 0;
v25 = v23 - v14;
LABEL_48:
a1[11] = v25;
}
if ( v24 >= 0 )
a1[13] = v24 - 1;
}
v26 = a1[15];
if ( v21 > 0.0 )
v25 = v23 - v26;
else
v25 = v26 + v23;
goto LABEL_48;
}
}
}
return result;
}