// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/oceankeyakv2/KnightsLanding/KeccakP-1600-times8-SIMD512.c
// Function: KeccakP1600times8_ExtractLanesAll
void KeccakP1600times8_ExtractLanesAll(const void *states, unsigned char *data, unsigned int laneCount, unsigned int laneOffset)
{
    const V512 *stateAsLanes = states;
    UINT64 *dataAsLanes = (UINT64 *)data;
    unsigned int i;
	V256 index;

    #define Extr( argIndex )  STORE_SCATTER8_64(dataAsLanes+argIndex, index, stateAsLanes[argIndex])
    index = LOAD8_32(7*laneOffset, 6*laneOffset, 5*laneOffset, 4*laneOffset, 3*laneOffset, 2*laneOffset, 1*laneOffset, 0*laneOffset);
    if ( laneCount >= 16 )  {
        Extr( 0 );
        Extr( 1 );
        Extr( 2 );
        Extr( 3 );
        Extr( 4 );
        Extr( 5 );
        Extr( 6 );
        Extr( 7 );
        Extr( 8 );
        Extr( 9 );
        Extr( 10 );
        Extr( 11 );
        Extr( 12 );
        Extr( 13 );
        Extr( 14 );
        Extr( 15 );
        if ( laneCount >= 20 )  {
	        Extr( 16 );
    	    Extr( 17 );
	        Extr( 18 );
    	    Extr( 19 );
            for(i=20; i<laneCount; i++)
                Extr( i );
        }
        else {
            for(i=16; i<laneCount; i++)
                Extr( i );
        }
    }
    else {
        for(i=0; i<laneCount; i++)
            Extr( i );
    }
    #undef  Extr
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x20, %rsp
subq $0xc0, %rsp
movq %rdi, 0x58(%rsp)
movq %rsi, 0x50(%rsp)
movl %edx, 0x4c(%rsp)
movl %ecx, 0x48(%rsp)
movq 0x58(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x50(%rsp), %rax
movq %rax, 0x38(%rsp)
movl 0x48(%rsp), %eax
movl %eax, %r9d
shll $0x3, %r9d
subl %eax, %r9d
movl %eax, %ecx
addl %ecx, %ecx
movl %ecx, %edx
leal (%rdx,%rdx,2), %r8d
movl %eax, %edx
leal (%rdx,%rdx,4), %edi
movl %eax, %esi
shll $0x2, %esi
leal (%rdx,%rdx,2), %edx
movl %r9d, 0xac(%rsp)
movl %r8d, 0xa8(%rsp)
movl %edi, 0xa4(%rsp)
movl %esi, 0xa0(%rsp)
movl %edx, 0x9c(%rsp)
movl %ecx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
movl $0x0, 0x90(%rsp)
movl 0x94(%rsp), %edx
movl 0x98(%rsp), %ecx
movl 0x9c(%rsp), %eax
movl 0xa4(%rsp), %r8d
movl 0xa8(%rsp), %edi
movl 0xac(%rsp), %esi
vmovd 0xa0(%rsp), %xmm0
vpinsrd $0x1, %r8d, %xmm0, %xmm0
vpinsrd $0x2, %edi, %xmm0, %xmm0
vpinsrd $0x3, %esi, %xmm0, %xmm1
vmovd 0x90(%rsp), %xmm0
vpinsrd $0x1, %edx, %xmm0, %xmm0
vpinsrd $0x2, %ecx, %xmm0, %xmm0
vpinsrd $0x3, %eax, %xmm0, %xmm2
vmovaps %xmm2, %xmm0
vinserti128 $0x1, %xmm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x60(%rsp)
vmovdqa 0x60(%rsp), %ymm0
vmovdqa %ymm0, (%rsp)
cmpl $0x10, 0x4c(%rsp)
jb 0xc5191
movq 0x38(%rsp), %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 (%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x8, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x40(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x10, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x80(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x18, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0xc0(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x20, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x100(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x28, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x140(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x30, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x180(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x38, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x1c0(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x40, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x200(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x48, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x240(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x50, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x280(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x58, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x2c0(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x60, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x300(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x68, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x340(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x70, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x380(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x78, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x3c0(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
cmpl $0x14, 0x4c(%rsp)
jb 0xc5138
movq 0x38(%rsp), %rax
addq $0x80, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x400(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x88, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x440(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x90, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x480(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movq 0x38(%rsp), %rax
addq $0x98, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
vmovdqa64 0x4c0(%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movl $0x14, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0xc5136
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
movl 0x34(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rcx
vmovdqa64 (%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xc50e9
jmp 0xc518f
movl $0x10, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0xc518d
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
movl 0x34(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rcx
vmovdqa64 (%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xc5140
jmp 0xc518f
jmp 0xc51e8
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0xc51e6
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
vmovdqa (%rsp), %ymm0
movq 0x40(%rsp), %rcx
movl 0x34(%rsp), %edx
shlq $0x6, %rdx
addq %rdx, %rcx
vmovdqa64 (%rcx), %zmm1
kxnorw %k0, %k0, %k1
vpscatterdq %zmm1, (%rax,%ymm0,8) {%k1}
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xc5199
jmp 0xc51e8
movq %rbp, %rsp
popq %rbp
vzeroupper
retq