// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/lakekeyakv2/generic32/KeccakP-1600-inplace32BI.c
// Function: KeccakP1600_ExtractAndAddBytesInLane
void KeccakP1600_ExtractAndAddBytesInLane(const void *state, unsigned int lanePosition, const unsigned char *input, unsigned char *output, unsigned int offset, unsigned int length)
{
    UINT32 *stateAsHalfLanes = (UINT32*)state;
    UINT32 low, high, temp, temp0, temp1;
    UINT8 laneAsBytes[8];
    unsigned int i;

    fromBitInterleaving(stateAsHalfLanes[lanePosition*2], stateAsHalfLanes[lanePosition*2+1], low, high, temp, temp0, temp1);
#if (PLATFORM_BYTE_ORDER == IS_LITTLE_ENDIAN)
    *((UINT32*)(laneAsBytes+0)) = low;
    *((UINT32*)(laneAsBytes+4)) = high;
#else
    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;
#endif
    for(i=0; i<length; i++)
        output[i] = input[i] ^ laneAsBytes[offset+i];
}

// Assembly:
movq %rdi, -0x8(%rsp)
movl %esi, -0xc(%rsp)
movq %rdx, -0x18(%rsp)
movq %rcx, -0x20(%rsp)
movl %r8d, -0x24(%rsp)
movl %r9d, -0x28(%rsp)
movq -0x8(%rsp), %rax
movq %rax, -0x30(%rsp)
movq -0x30(%rsp), %rax
movl -0xc(%rsp), %ecx
shll %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x40(%rsp)
movq -0x30(%rsp), %rax
movl -0xc(%rsp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %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)
movl -0x40(%rsp), %eax
movl %eax, -0x34(%rsp)
movl -0x44(%rsp), %eax
movl %eax, -0x38(%rsp)
movl -0x34(%rsp), %eax
movl %eax, -0x4c(%rsp)
movl -0x38(%rsp), %eax
movl %eax, -0x48(%rsp)
movl $0x0, -0x50(%rsp)
movl -0x50(%rsp), %eax
cmpl -0x28(%rsp), %eax
jae 0x6eae
movq -0x18(%rsp), %rax
movl -0x50(%rsp), %ecx
movzbl (%rax,%rcx), %eax
movl -0x24(%rsp), %ecx
addl -0x50(%rsp), %ecx
movl %ecx, %ecx
movzbl -0x4c(%rsp,%rcx), %ecx
xorl %ecx, %eax
movb %al, %dl
movq -0x20(%rsp), %rax
movl -0x50(%rsp), %ecx
movb %dl, (%rax,%rcx)
movl -0x50(%rsp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rsp)
jmp 0x6e6b
retq
nop