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

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

// 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 0xc4a69
movq 0x38(%rsp), %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, (%rax)
movq 0x38(%rsp), %rax
addq $0x8, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x40(%rax)
movq 0x38(%rsp), %rax
addq $0x10, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x80(%rax)
movq 0x38(%rsp), %rax
addq $0x18, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0xc0(%rax)
movq 0x38(%rsp), %rax
addq $0x20, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x100(%rax)
movq 0x38(%rsp), %rax
addq $0x28, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x140(%rax)
movq 0x38(%rsp), %rax
addq $0x30, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x180(%rax)
movq 0x38(%rsp), %rax
addq $0x38, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x1c0(%rax)
movq 0x38(%rsp), %rax
addq $0x40, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x200(%rax)
movq 0x38(%rsp), %rax
addq $0x48, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x240(%rax)
movq 0x38(%rsp), %rax
addq $0x50, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x280(%rax)
movq 0x38(%rsp), %rax
addq $0x58, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x2c0(%rax)
movq 0x38(%rsp), %rax
addq $0x60, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x300(%rax)
movq 0x38(%rsp), %rax
addq $0x68, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x340(%rax)
movq 0x38(%rsp), %rax
addq $0x70, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x380(%rax)
movq 0x38(%rsp), %rax
addq $0x78, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x3c0(%rax)
cmpl $0x14, 0x4c(%rsp)
jb 0xc4a0c
movq 0x38(%rsp), %rax
addq $0x80, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x400(%rax)
movq 0x38(%rsp), %rax
addq $0x88, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x440(%rax)
movq 0x38(%rsp), %rax
addq $0x90, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x480(%rax)
movq 0x38(%rsp), %rax
addq $0x98, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
vmovdqa64 %zmm0, 0x4c0(%rax)
movl $0x14, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0xc4a0a
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
vmovdqa64 %zmm0, (%rax)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xc49b9
jmp 0xc4a67
movl $0x10, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0xc4a65
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
vmovdqa64 %zmm0, (%rax)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xc4a14
jmp 0xc4a67
jmp 0xc4ac4
movl $0x0, 0x34(%rsp)
movl 0x34(%rsp), %eax
cmpl 0x4c(%rsp), %eax
jae 0xc4ac2
movq 0x38(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x3, %rcx
addq %rcx, %rax
vmovdqa (%rsp), %ymm1
kxnorw %k0, %k0, %k1
vpxor %xmm0, %xmm0, %xmm0
vpgatherdq (%rax,%ymm1,8), %zmm0 {%k1}
movq 0x40(%rsp), %rax
movl 0x34(%rsp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
vmovdqa64 %zmm0, (%rax)
movl 0x34(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x34(%rsp)
jmp 0xc4a71
jmp 0xc4ac4
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
nopl (%rax)