// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/lakekeyakv2/generic32/KeccakP-1600-inplace32BI.c
// Function: KeccakP1600_ExtractAndAddLanes
void KeccakP1600_ExtractAndAddLanes(const void *state, const unsigned char *input, unsigned char *output, unsigned int laneCount)
{
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
    const UINT32 * pI = (const UINT32 *)input;
    UINT32 * pO = (UINT32 *)output;
    const UINT32 * pS = (const UINT32 *)state;
    UINT32 t, x0, x1;
    int i;
    for (i = laneCount-1; i >= 0; --i) {
#ifdef NO_MISALIGNED_ACCESSES
        UINT32 low;
        UINT32 high;
        fromBitInterleaving(*(pS++), *(pS++), low, high, t, x0, x1);
        *(pO++) = *(pI++) ^ low;
        *(pO++) = *(pI++) ^ high;
#else
        fromBitInterleavingAndXOR(*(pS++), *(pS++), *(pI++), *(pI++), *(pO++), *(pO++), t, x0, x1)
#endif
    }
#else
    unsigned int lanePosition;
    for(lanePosition=0; lanePosition<laneCount; lanePosition++) {
        UINT32 *stateAsHalfLanes = (UINT32*)state;
        UINT32 low, high, temp, temp0, temp1;
        fromBitInterleaving(stateAsHalfLanes[lanePosition*2], stateAsHalfLanes[lanePosition*2+1], low, high, temp, temp0, temp1);
        UINT8 laneAsBytes[8];
        laneAsBytes[0] = low & 0xFF;
        laneAsBytes[1] = (low >> 8) & 0xFF;
        laneAsBytes[2] = (low >> 16) & 0xFF;
        laneAsBytes[3] = (low >> 24) & 0xFF;
        laneAsBytes[4] = high & 0xFF;
        laneAsBytes[5] = (high >> 8) & 0xFF;
        laneAsBytes[6] = (high >> 16) & 0xFF;
        laneAsBytes[7] = (high >> 24) & 0xFF;
        ((UINT32*)(output+lanePosition*8))[0] = ((UINT32*)(input+lanePosition*8))[0] ^ (*(const UINT32*)(laneAsBytes+0));
        ((UINT32*)(output+lanePosition*8))[1] = ((UINT32*)(input+lanePosition*8))[0] ^ (*(const UINT32*)(laneAsBytes+4));
    }
#endif
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq %rsi, -0x10(%rsp)
movq %rdx, -0x18(%rsp)
movl %ecx, -0x1c(%rsp)
movq -0x10(%rsp), %rax
movq %rax, -0x28(%rsp)
movq -0x18(%rsp), %rax
movq %rax, -0x30(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x38(%rsp)
movl -0x1c(%rsp), %eax
subl $0x1, %eax
movl %eax, -0x48(%rsp)
cmpl $0x0, -0x48(%rsp)
jl 0x712a
movq -0x38(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x38(%rsp)
movl (%rax), %eax
movl %eax, -0x40(%rsp)
movq -0x38(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x38(%rsp)
movl (%rax), %eax
movl %eax, -0x44(%rsp)
movl -0x40(%rsp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl -0x44(%rsp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movl %eax, -0x3c(%rsp)
movl -0x40(%rsp), %eax
shrl $0x10, %eax
movl -0x44(%rsp), %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %ecx, %eax
movl %eax, -0x44(%rsp)
movl -0x3c(%rsp), %eax
movl %eax, -0x40(%rsp)
movl -0x40(%rsp), %eax
movl -0x40(%rsp), %ecx
shrl $0x8, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xff00, %rax           # imm = 0xFF00
movl %eax, -0x3c(%rsp)
movl -0x40(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movl %eax, -0x40(%rsp)
movl -0x40(%rsp), %eax
movl -0x40(%rsp), %ecx
shrl $0x4, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xf000f0, %rax         # imm = 0xF000F0
movl %eax, -0x3c(%rsp)
movl -0x40(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll $0x4, %ecx
xorl %ecx, %eax
movl %eax, -0x40(%rsp)
movl -0x40(%rsp), %eax
movl -0x40(%rsp), %ecx
shrl $0x2, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xc0c0c0c, %rax        # imm = 0xC0C0C0C
movl %eax, -0x3c(%rsp)
movl -0x40(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll $0x2, %ecx
xorl %ecx, %eax
movl %eax, -0x40(%rsp)
movl -0x40(%rsp), %eax
movl -0x40(%rsp), %ecx
shrl %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0x22222222, %rax       # imm = 0x22222222
movl %eax, -0x3c(%rsp)
movl -0x40(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll %ecx
xorl %ecx, %eax
movl %eax, -0x40(%rsp)
movl -0x44(%rsp), %eax
movl -0x44(%rsp), %ecx
shrl $0x8, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xff00, %rax           # imm = 0xFF00
movl %eax, -0x3c(%rsp)
movl -0x44(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movl %eax, -0x44(%rsp)
movl -0x44(%rsp), %eax
movl -0x44(%rsp), %ecx
shrl $0x4, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xf000f0, %rax         # imm = 0xF000F0
movl %eax, -0x3c(%rsp)
movl -0x44(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll $0x4, %ecx
xorl %ecx, %eax
movl %eax, -0x44(%rsp)
movl -0x44(%rsp), %eax
movl -0x44(%rsp), %ecx
shrl $0x2, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xc0c0c0c, %rax        # imm = 0xC0C0C0C
movl %eax, -0x3c(%rsp)
movl -0x44(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll $0x2, %ecx
xorl %ecx, %eax
movl %eax, -0x44(%rsp)
movl -0x44(%rsp), %eax
movl -0x44(%rsp), %ecx
shrl %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0x22222222, %rax       # imm = 0x22222222
movl %eax, -0x3c(%rsp)
movl -0x44(%rsp), %eax
xorl -0x3c(%rsp), %eax
movl -0x3c(%rsp), %ecx
shll %ecx
xorl %ecx, %eax
movl %eax, -0x44(%rsp)
movq -0x28(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x28(%rsp)
movl (%rax), %ecx
xorl -0x40(%rsp), %ecx
movq -0x30(%rsp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x30(%rsp)
movl %ecx, (%rax)
movq -0x28(%rsp), %rax
movq %rax, %rcx
addq $0x4, %rcx
movq %rcx, -0x28(%rsp)
movl (%rax), %ecx
xorl -0x44(%rsp), %ecx
movq -0x30(%rsp), %rax
movq %rax, %rdx
addq $0x4, %rdx
movq %rdx, -0x30(%rsp)
movl %ecx, (%rax)
movl -0x48(%rsp), %eax
addl $-0x1, %eax
movl %eax, -0x48(%rsp)
jmp 0x6eec
retq
nopl (%rax,%rax)