// File: /workspace/github_c_makefile_star2_O0/mjosaarinen[P]brutus/crypto_aead/minalpherv11/avx2/MinalpherCore.cpp
// Function: format_return_single_block(long long vector[4] const&, long long vector[4] const&, long long vector[4]&)
void format_return_single_block(
  const __m256i             &ymm0,   /* I    ymm0                    */
  const __m256i             &ymm1,   /* I    ymm1                    */
  __m256i                   &DATA    /* O                            */
  ){
  /*==== FORMAT CHANGE ====*/
  //Constant Load
  const __m256i ymmMaskFF = _mm256_set_epi16(0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF, 0x00FF);

  //SHIFT
  __m256i tmp0, tmp1;
  tmp0 = _mm256_srli_epi16(ymm0, 4);
  tmp0 = _mm256_xor_si256(tmp0, ymm0);
  tmp0 = _mm256_and_si256(ymmMaskFF, tmp0);

  tmp1 = _mm256_srli_epi16(ymm1, 4);
  tmp1 = _mm256_xor_si256(tmp1, ymm1);
  tmp1 = _mm256_and_si256(ymmMaskFF, tmp1);
  
  DATA = _mm256_packus_epi16(tmp0, tmp1);
  DATA = _mm256_permute4x64_epi64(DATA, 0xD8);
  /*==== END FORMAT CHANGE ====*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
andq $-0x20, %rsp
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, 0x78(%rsp)
movq %rsi, 0x70(%rsp)
movq %rdx, 0x68(%rsp)
movw $0xff, 0x23e(%rsp)
movw $0xff, 0x23c(%rsp)
movw $0xff, 0x23a(%rsp)
movw $0xff, 0x238(%rsp)
movw $0xff, 0x236(%rsp)
movw $0xff, 0x234(%rsp)
movw $0xff, 0x232(%rsp)
movw $0xff, 0x230(%rsp)
movw $0xff, 0x22e(%rsp)
movw $0xff, 0x22c(%rsp)
movw $0xff, 0x22a(%rsp)
movw $0xff, 0x228(%rsp)
movw $0xff, 0x226(%rsp)
movw $0xff, 0x224(%rsp)
movw $0xff, 0x222(%rsp)
movw $0xff, 0x220(%rsp)
movzwl 0x220(%rsp), %eax
vmovd %eax, %xmm0
movzwl 0x222(%rsp), %eax
vpinsrw $0x1, %eax, %xmm0, %xmm0
movzwl 0x224(%rsp), %eax
vpinsrw $0x2, %eax, %xmm0, %xmm0
movzwl 0x226(%rsp), %eax
vpinsrw $0x3, %eax, %xmm0, %xmm0
movzwl 0x228(%rsp), %eax
vpinsrw $0x4, %eax, %xmm0, %xmm0
movzwl 0x22a(%rsp), %eax
vpinsrw $0x5, %eax, %xmm0, %xmm0
movzwl 0x22c(%rsp), %eax
vpinsrw $0x6, %eax, %xmm0, %xmm0
movzwl 0x22e(%rsp), %eax
vpinsrw $0x7, %eax, %xmm0, %xmm0
movzwl 0x230(%rsp), %eax
vmovd %eax, %xmm1
movzwl 0x232(%rsp), %eax
vpinsrw $0x1, %eax, %xmm1, %xmm1
movzwl 0x234(%rsp), %eax
vpinsrw $0x2, %eax, %xmm1, %xmm1
movzwl 0x236(%rsp), %eax
vpinsrw $0x3, %eax, %xmm1, %xmm1
movzwl 0x238(%rsp), %eax
vpinsrw $0x4, %eax, %xmm1, %xmm1
movzwl 0x23a(%rsp), %eax
vpinsrw $0x5, %eax, %xmm1, %xmm1
movzwl 0x23c(%rsp), %eax
vpinsrw $0x6, %eax, %xmm1, %xmm1
movzwl 0x23e(%rsp), %eax
vpinsrw $0x7, %eax, %xmm1, %xmm1
vmovdqa %xmm1, 0x210(%rsp)
vmovdqa %xmm0, 0x200(%rsp)
vmovdqa 0x200(%rsp), %ymm0
vmovdqa %ymm0, 0x40(%rsp)
movq 0x78(%rsp), %rax
vmovdqa (%rax), %ymm0
vmovdqa %ymm0, 0x160(%rsp)
movl $0x4, 0x15c(%rsp)
vmovdqa 0x160(%rsp), %ymm0
vmovd 0x15c(%rsp), %xmm1
vpsrlw %xmm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x20(%rsp)
vmovdqa 0x20(%rsp), %ymm1
movq 0x78(%rsp), %rax
vmovdqa (%rax), %ymm0
vmovdqa %ymm1, 0x1e0(%rsp)
vmovdqa %ymm0, 0x1c0(%rsp)
vmovdqa 0x1e0(%rsp), %ymm0
vmovdqa 0x1c0(%rsp), %ymm1
vpxor %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x20(%rsp)
vmovdqa 0x40(%rsp), %ymm1
vmovdqa 0x20(%rsp), %ymm0
vmovdqa %ymm1, 0xe0(%rsp)
vmovdqa %ymm0, 0xc0(%rsp)
vmovdqa 0xe0(%rsp), %ymm0
vmovdqa 0xc0(%rsp), %ymm1
vpand %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, 0x20(%rsp)
movq 0x70(%rsp), %rax
vmovdqa (%rax), %ymm0
vmovdqa %ymm0, 0x120(%rsp)
movl $0x4, 0x11c(%rsp)
vmovdqa 0x120(%rsp), %ymm0
vmovd 0x11c(%rsp), %xmm1
vpsrlw %xmm1, %ymm0, %ymm0
vmovdqa %ymm0, (%rsp)
vmovdqa (%rsp), %ymm1
movq 0x70(%rsp), %rax
vmovdqa (%rax), %ymm0
vmovdqa %ymm1, 0x1a0(%rsp)
vmovdqa %ymm0, 0x180(%rsp)
vmovdqa 0x1a0(%rsp), %ymm0
vmovdqa 0x180(%rsp), %ymm1
vpxor %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, (%rsp)
vmovdqa 0x40(%rsp), %ymm1
vmovdqa (%rsp), %ymm0
vmovdqa %ymm1, 0xa0(%rsp)
vmovdqa %ymm0, 0x80(%rsp)
vmovdqa 0xa0(%rsp), %ymm0
vmovdqa 0x80(%rsp), %ymm1
vpand %ymm1, %ymm0, %ymm0
vmovdqa %ymm0, (%rsp)
vmovdqa 0x20(%rsp), %ymm1
vmovdqa (%rsp), %ymm0
vmovdqa %ymm1, 0x260(%rsp)
vmovdqa %ymm0, 0x240(%rsp)
vmovdqa 0x260(%rsp), %ymm0
vmovdqa 0x240(%rsp), %ymm1
vpackuswb %ymm1, %ymm0, %ymm0
movq 0x68(%rsp), %rax
vmovdqa %ymm0, (%rax)
movq 0x68(%rsp), %rax
vmovdqa (%rax), %ymm0
vpermq $0xd8, %ymm0, %ymm0     # ymm0 = ymm0[0,2,1,3]
movq 0x68(%rsp), %rax
vmovdqa %ymm0, (%rax)
movq %rbp, %rsp
popq %rbp
vzeroupper
retq
nopw %cs:(%rax,%rax)