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

    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
    memcpy(data, laneAsBytes+offset, length);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movl %esi, 0x3c(%rsp)
movq %rdx, 0x30(%rsp)
movl %ecx, 0x2c(%rsp)
movl %r8d, 0x28(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rax
movl 0x3c(%rsp), %ecx
shll %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x10(%rsp)
movq 0x20(%rsp), %rax
movl 0x3c(%rsp), %ecx
shll %ecx
addl $0x1, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
andl $0xffff, %eax           # imm = 0xFFFF
movl 0xc(%rsp), %ecx
shll $0x10, %ecx
orl %ecx, %eax
movl %eax, 0x14(%rsp)
movl 0x10(%rsp), %eax
shrl $0x10, %eax
movl 0xc(%rsp), %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %ecx, %eax
movl %eax, 0xc(%rsp)
movl 0x14(%rsp), %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movl 0x10(%rsp), %ecx
shrl $0x8, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xff00, %rax           # imm = 0xFF00
movl %eax, 0x14(%rsp)
movl 0x10(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movl 0x10(%rsp), %ecx
shrl $0x4, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xf000f0, %rax         # imm = 0xF000F0
movl %eax, 0x14(%rsp)
movl 0x10(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll $0x4, %ecx
xorl %ecx, %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movl 0x10(%rsp), %ecx
shrl $0x2, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xc0c0c0c, %rax        # imm = 0xC0C0C0C
movl %eax, 0x14(%rsp)
movl 0x10(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll $0x2, %ecx
xorl %ecx, %eax
movl %eax, 0x10(%rsp)
movl 0x10(%rsp), %eax
movl 0x10(%rsp), %ecx
shrl %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0x22222222, %rax       # imm = 0x22222222
movl %eax, 0x14(%rsp)
movl 0x10(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll %ecx
xorl %ecx, %eax
movl %eax, 0x10(%rsp)
movl 0xc(%rsp), %eax
movl 0xc(%rsp), %ecx
shrl $0x8, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xff00, %rax           # imm = 0xFF00
movl %eax, 0x14(%rsp)
movl 0xc(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll $0x8, %ecx
xorl %ecx, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl 0xc(%rsp), %ecx
shrl $0x4, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xf000f0, %rax         # imm = 0xF000F0
movl %eax, 0x14(%rsp)
movl 0xc(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll $0x4, %ecx
xorl %ecx, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl 0xc(%rsp), %ecx
shrl $0x2, %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0xc0c0c0c, %rax        # imm = 0xC0C0C0C
movl %eax, 0x14(%rsp)
movl 0xc(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll $0x2, %ecx
xorl %ecx, %eax
movl %eax, 0xc(%rsp)
movl 0xc(%rsp), %eax
movl 0xc(%rsp), %ecx
shrl %ecx
xorl %ecx, %eax
movl %eax, %eax
andq $0x22222222, %rax       # imm = 0x22222222
movl %eax, 0x14(%rsp)
movl 0xc(%rsp), %eax
xorl 0x14(%rsp), %eax
movl 0x14(%rsp), %ecx
shll %ecx
xorl %ecx, %eax
movl %eax, 0xc(%rsp)
movl 0x10(%rsp), %eax
movl %eax, 0x1c(%rsp)
movl 0xc(%rsp), %eax
movl %eax, 0x18(%rsp)
movl 0x1c(%rsp), %eax
movl %eax, 0x4(%rsp)
movl 0x18(%rsp), %eax
movl %eax, 0x8(%rsp)
movq 0x30(%rsp), %rdi
leaq 0x4(%rsp), %rsi
movl 0x2c(%rsp), %eax
addq %rax, %rsi
movl 0x28(%rsp), %eax
movl %eax, %edx
callq 0x56e0
addq $0x48, %rsp
retq
nopw %cs:(%rax,%rax)