//
// sub_18010C2C0 from 0x18010c2c0 to 0x18010c3df (287 bytes)
//
// 5 xrefs:
// > sub_18010DD40 @ 0x18010dd79
// > ??> @ 0x180190604
// > ??> @ 0x180190614
// > ??> @ 0x1801aea50
// > ??> @ 0x1802018a4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
void __fastcall sub_18010C2C0(__int64 a1, __int64 a2, int a3, unsigned int a4)
{
unsigned int v4; // eax
unsigned int v5; // ebp
__int64 v8; // r10
__int64 v9; // r13
int v10; // r12d
__int64 v11; // r8
int v12; // r9d
__int64 v13; // rsi
unsigned __int64 v14; // r14
__int64 v15; // rdi
__int64 v16; // rdx
int v17; // eax
__int64 v18; // rdx
int v19; // eax
__int64 v20; // rdx
__int64 v21; // rcx
__int64 v22; // rdx
__int64 v23; // rax
if ( a4 )
{
v4 = a4;
v5 = 0;
v8 = 0;
v9 = a3;
while ( 1 )
{
v10 = 0;
v11 = 0;
if ( v9 >= 4 )
break;
if ( (int)v9 > 0 )
{
v12 = v9 * v5;
goto LABEL_10;
}
LABEL_13:
++v5;
v8 += 4;
if ( v5 >= v4 )
return;
}
v12 = v9 * v5;
v13 = a1 + 16;
v14 = ((unsigned __int64)(v9 - 4) >> 2) + 1;
v10 = 4 * v14;
v11 = 4 * v14;
v15 = (unsigned int)v9 * v5 + 2;
do
{
v16 = *(_QWORD *)(v13 - 16);
v13 += 32;
v17 = *(_DWORD *)(v8 + v16);
v18 = *(_QWORD *)(v13 - 40);
*(_DWORD *)(a2 + 4LL * (unsigned int)(v15 - 2)) = v17;
v19 = *(_DWORD *)(v8 + v18);
v20 = *(_QWORD *)(v13 - 24);
*(_DWORD *)(a2 + 4LL * (unsigned int)(v15 - 1)) = v19;
v21 = (unsigned int)(v15 + 1);
*(_DWORD *)(a2 + 4 * v15) = *(_DWORD *)(v8 + *(_QWORD *)(v13 - 32));
v15 = (unsigned int)(v15 + 4);
*(_DWORD *)(a2 + 4 * v21) = *(_DWORD *)(v8 + v20);
--v14;
}
while ( v14 );
if ( v11 < v9 )
{
LABEL_10:
v22 = (unsigned int)(v12 + v10);
do
{
v23 = *(_QWORD *)(a1 + 8 * v11++);
*(_DWORD *)(a2 + 4 * v22) = *(_DWORD *)(v8 + v23);
v22 = (unsigned int)(v22 + 1);
}
while ( v11 < v9 );
}
v4 = a4;
goto LABEL_13;
}
}