//
// sub_C7B44 from 0xc7b44 to 0xc7c28 (228 bytes)
//
// 1 xrefs:
// > sub_C6E34 @ 0xc6e6c
//
// 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:41:53 +0000
//
int __fastcall sub_C7B44(int a1, int a2)
{
int v3; // r0
unsigned __int64 v5; // kr00_8
int v6; // r6
unsigned int v7; // r0
int v8; // r6
int v9; // r1
int v10; // r0
int v11; // r0
bool v12; // zf
int *v14; // r0
int v15; // r1
int v16; // [sp+0h] [bp-20h] BYREF
v3 = *(_DWORD *)(a2 + 4);
if ( *(_DWORD *)(v3 + 248) )
{
v5 = *(_QWORD *)(v3 + 304);
if ( v5 )
{
if ( *(_QWORD *)(v3 + 240) >= v5 )
{
v14 = *(int **)a2;
v15 = 4;
goto LABEL_21;
}
}
}
if ( !sub_C45DC(*(_DWORD *)(v3 + 60)) )
{
v6 = *(_DWORD *)(*(_DWORD *)(a2 + 4) + 60);
v7 = sub_C45EA(v6);
if ( !sub_C460A(a1, v6, &v16, v7) )
return 0;
}
v8 = 1;
while ( 1 )
{
v9 = *(_DWORD *)(a2 + 4);
if ( *(_DWORD *)(v9 + 3520) )
{
v10 = *(unsigned __int8 *)(v9 + 3582);
v16 = v10;
*(_DWORD *)(v9 + 3520) = 0;
}
else
{
if ( !sub_C460A(a1, *(_DWORD *)(v9 + 60), &v16, 8u) )
return 0;
v10 = v16;
}
if ( v10 == 255 )
break;
LABEL_16:
v12 = v8 == 0;
v8 = 0;
if ( !v12 )
{
v8 = 0;
sub_C8EEE(a2, 0);
}
}
*(_BYTE *)(*(_DWORD *)(a2 + 4) + 3580) = -1;
if ( !sub_C460A(a1, *(_DWORD *)(*(_DWORD *)(a2 + 4) + 60), &v16, 8u) )
return 0;
if ( v16 == 255 )
{
v11 = *(_DWORD *)(a2 + 4);
*(_DWORD *)(v11 + 3520) = 1;
*(_BYTE *)(v11 + 3582) = -1;
goto LABEL_16;
}
if ( (v16 & 0xFFFFFFFC) != 0xF8 )
goto LABEL_16;
*(_BYTE *)(*(_DWORD *)(a2 + 4) + 3581) = v16;
v15 = 3;
v14 = *(int **)a2;
LABEL_21:
*v14 = v15;
return 1;
}