//
// sub_CD834 from 0xcd834 to 0xcd94a (278 bytes)
//
// 1 xrefs:
// > sub_CEC4A @ 0xcecaa
//
// 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:57 +0000
//
int __fastcall sub_CD834(int a1, int a2, int a3)
{
_DWORD *v4; // r0
int v7; // r11
int v8; // r5
int v9; // r9
int result; // r0
int v11; // r0
int v12; // r5
int v13; // r5
int *v14; // t1
int v15; // r0
int v16; // r0
int v17; // r0
int v18; // r0
int v19; // r6
int v20; // r1
int v21; // r0
v4 = *(_DWORD **)(a2 + 64);
v7 = *v4;
v8 = v4[24];
v9 = *(_DWORD *)(*v4 + 28);
result = sub_C9A40(a1, (int *)a2);
if ( result )
return result;
sub_C90DC((_DWORD *)(a2 + 4), *(_DWORD *)a3, *(_DWORD *)(a3 + 4));
if ( sub_C91BC((_DWORD *)(a2 + 4), 1u) )
return -135;
v11 = sub_C91BC((_DWORD *)(a2 + 4), *(_DWORD *)(v8 + 16));
if ( v11 == -1 )
return -136;
v12 = v9 + 4 * v11;
*(_DWORD *)(a2 + 40) = v11;
v14 = *(int **)(v12 + 28);
v13 = v12 + 28;
v15 = *v14;
*(_DWORD *)(a2 + 28) = *v14;
if ( v15 )
{
*(_DWORD *)(a2 + 24) = sub_C91BC((_DWORD *)(a2 + 4), 1u);
v16 = sub_C91BC((_DWORD *)(a2 + 4), 1u);
*(_DWORD *)(a2 + 32) = v16;
if ( v16 != -1 )
{
v17 = *(_DWORD *)(a2 + 28);
goto LABEL_10;
}
return -136;
}
v17 = 0;
*(_DWORD *)(a2 + 32) = 0;
*(_DWORD *)(a2 + 24) = 0;
LABEL_10:
*(_QWORD *)(a2 + 48) = *(_QWORD *)(a3 + 16);
*(_QWORD *)(a2 + 56) = *(_QWORD *)(a3 + 24);
*(_DWORD *)(a2 + 44) = *(_DWORD *)(a3 + 12);
*(_DWORD *)(a2 + 36) = *(_DWORD *)(v9 + 4 * v17);
v18 = sub_C99E0(a1, a2, 4 * *(_DWORD *)(v7 + 4));
*(_DWORD *)a2 = v18;
if ( !v18 )
return -139;
v19 = 0;
while ( v19 < *(_DWORD *)(v7 + 4) )
{
*(_DWORD *)(*(_DWORD *)a2 + 4 * v19) = sub_C99E0(a1, a2, 4 * *(_DWORD *)(a2 + 36));
v20 = *(_DWORD *)(*(_DWORD *)a2 + 4 * v19++);
result = -139;
if ( !v20 )
return result;
}
v21 = v9 + 4 * *(_DWORD *)(*(_DWORD *)v13 + 12);
return (*((int (__fastcall **)(int, int, _DWORD))*(&off_E5F90 + *(_DWORD *)(v21 + 284)) + 4))(
a1,
a2,
*(_DWORD *)(v21 + 540));
}