//
// sub_180006070 from 0x180006070 to 0x180006377 (775 bytes)
//
// 2 xrefs:
// > sub_180005520 @ 0x18000560a
// > ??> @ 0x1801f6318
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// 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 10:52:41 +0000
//
__int64 __fastcall sub_180006070(
_DWORD *_RCX,
__int64 a2,
__int64 _R8,
__int64 _R9,
_DWORD *a5,
__int64 a6,
__int64 a7,
int a8,
int a9,
int a10,
int a11)
{
int v13; // eax
int v21; // edx
int v22; // eax
__int64 result; // rax
int v25; // edi
int v39; // ebx
int v48; // edi
int v61; // ebx
int v71; // r9d
int v82; // r8d
_R10 = a5;
_R11 = a2;
v13 = a8 >> 3;
if ( a8 >> 3 )
{
__asm { vmovdqu ymm3, cs:ymmword_1801446A0 }
do
{
__asm
{
vpermps ymm0, ymm3, ymmword ptr [r10-20h]
vpermps ymm1, ymm3, ymmword ptr [r9-20h]
vunpcklps ymm2, ymm1, ymm0
}
_R9 -= 32;
_R10 -= 8;
__asm
{
vunpckhps ymm1, ymm1, ymm0
vperm2f128 ymm0, ymm2, ymm1, 20h ; ' '
vmovups ymmword ptr [rcx], ymm0
vperm2f128 ymm1, ymm2, ymm1, 31h ; '1'
vmovups ymmword ptr [rcx+20h], ymm1
}
_RCX += 16;
--v13;
}
while ( v13 );
}
v21 = a8 & 7;
if ( (a8 & 7) != 0 )
{
do
{
v22 = *(_DWORD *)(_R9 - 4);
_R9 -= 4;
--_R10;
*_RCX = v22;
_RCX[1] = *_R10;
_RCX += 2;
--v21;
}
while ( v21 );
}
result = a7;
_RDX = a6;
v25 = a9 >> 3;
if ( a9 >> 3 )
{
__asm { vmovdqu ymm4, cs:ymmword_1801446A0 }
do
{
__asm
{
vmovups ymm2, ymmword ptr [r8]
vmovups ymm1, ymmword ptr [r11-20h]
vmulps ymm0, ymm1, ymmword ptr [r9-20h]
vpermps ymm3, ymm4, ymm0
vmulps ymm0, ymm1, ymmword ptr [r10-20h]
vfmadd231ps ymm3, ymm2, ymmword ptr [rdx]
}
_R11 -= 32;
_R9 -= 32;
_R10 -= 8;
_RDX += 32;
__asm
{
vpermps ymm1, ymm4, ymm0
vfmadd231ps ymm1, ymm2, ymmword ptr [rax]
vunpcklps ymm2, ymm3, ymm1
vunpckhps ymm1, ymm3, ymm1
vperm2f128 ymm0, ymm2, ymm1, 20h ; ' '
vmovups ymmword ptr [rcx], ymm0
vperm2f128 ymm1, ymm2, ymm1, 31h ; '1'
vmovups ymmword ptr [rcx+20h], ymm1
}
_RCX += 16;
result += 32;
_R8 += 32;
--v25;
}
while ( v25 );
}
v39 = a9 & 7;
if ( (a9 & 7) != 0 )
{
do
{
__asm
{
vmovss xmm0, dword ptr [rdx]
vmulss xmm2, xmm0, dword ptr [r8]
vmovss xmm1, dword ptr [r9-4]
vfmadd231ss xmm2, xmm1, dword ptr [r11-4]
vmovss dword ptr [rcx], xmm2
vmovss xmm1, dword ptr [r8]
vmovss xmm0, dword ptr [r10-4]
vmulss xmm3, xmm0, dword ptr [r11-4]
vfmadd231ss xmm3, xmm1, dword ptr [rax]
}
_R11 -= 4;
_R9 -= 4;
--_R10;
_RDX += 4;
__asm { vmovss dword ptr [rcx+4], xmm3 }
_RCX += 2;
result += 4;
_R8 += 4;
--v39;
}
while ( v39 );
}
v48 = a10 >> 3;
if ( a10 >> 3 )
{
__asm { vmovdqu ymm4, cs:ymmword_1801446A0 }
do
{
__asm
{
vpermps ymm2, ymm4, ymmword ptr [r11-20h]
vpermps ymm0, ymm4, ymmword ptr [rdx-20h]
vmulps ymm3, ymm0, ymmword ptr [r8]
vfmsub231ps ymm3, ymm2, ymmword ptr [r9]
vpermps ymm0, ymm4, ymmword ptr [rax-20h]
vmulps ymm1, ymm0, ymmword ptr [r8]
vfmsub231ps ymm1, ymm2, ymmword ptr [r10]
vunpcklps ymm2, ymm3, ymm1
}
_RDX -= 32;
result -= 32;
_R11 -= 32;
_R9 += 32;
__asm
{
vunpckhps ymm1, ymm3, ymm1
vperm2f128 ymm0, ymm2, ymm1, 20h ; ' '
vmovups ymmword ptr [rcx], ymm0
vperm2f128 ymm1, ymm2, ymm1, 31h ; '1'
vmovups ymmword ptr [rcx+20h], ymm1
}
_RCX += 16;
_R10 += 8;
_R8 += 32;
--v48;
}
while ( v48 );
}
v61 = a10 & 7;
if ( (a10 & 7) != 0 )
{
_R9 = _R9 - _R8;
do
{
__asm
{
vmovss xmm1, dword ptr [r9+r8]
vmovss xmm0, dword ptr [rdx-4]
vmulss xmm2, xmm0, dword ptr [r8]
}
_RDX -= 4;
_R11 -= 4;
__asm
{
vfmsub231ss xmm2, xmm1, dword ptr [r11]
vmovss dword ptr [rcx], xmm2
vmovss xmm0, dword ptr [rax-4]
vmulss xmm3, xmm0, dword ptr [r8]
vmovss xmm1, dword ptr [r11]
vfmsub231ss xmm3, xmm1, dword ptr [r10+r8]
}
result -= 4;
_R8 += 4;
__asm { vmovss dword ptr [rcx+4], xmm3 }
_RCX += 2;
--v61;
}
while ( v61 );
}
v71 = a11 >> 3;
if ( a11 >> 3 )
{
__asm
{
vmovdqu ymm4, cs:ymmword_1801446A0
vmovups ymm5, cs:ymmword_1801446E0
}
do
{
__asm
{
vpermps ymm0, ymm4, ymmword ptr [rdx-20h]
vpermps ymm1, ymm4, ymmword ptr [rax-20h]
vmulps ymm3, ymm0, ymm5
vmulps ymm0, ymm1, ymm5
}
_RDX -= 32;
result -= 32;
__asm
{
vunpcklps ymm2, ymm3, ymm0
vunpckhps ymm1, ymm3, ymm0
vperm2f128 ymm0, ymm2, ymm1, 20h ; ' '
vmovups ymmword ptr [rcx], ymm0
vperm2f128 ymm1, ymm2, ymm1, 31h ; '1'
vmovups ymmword ptr [rcx+20h], ymm1
}
_RCX += 16;
--v71;
}
while ( v71 );
}
v82 = a11 & 7;
if ( (a11 & 7) != 0 )
{
__asm { vmovss xmm3, dword ptr cs:xmmword_180144610 }
_RDX = _RDX - result;
do
{
result -= 4;
_RCX += 2;
__asm
{
vmovss xmm0, dword ptr [rdx+rax]
vxorps xmm1, xmm0, xmm3
vmovss dword ptr [rcx-8], xmm1
vmovss xmm2, dword ptr [rax]
vxorps xmm0, xmm2, xmm3
vmovss dword ptr [rcx-4], xmm0
}
--v82;
}
while ( v82 );
}
__asm { vzeroupper }
return result;
}