// File: /workspace/github_cpp_makefile_star2_O3/twekkel[P]mzpq/libzpaq.cpp
// Function: libzpaq::blockmix(unsigned int*, int)
static void blockmix(U32* b, int r) {
  assert(r<=8);
  U32 x[16];
  U32 y[256];
  memcpy(x, b+32*r-16, 64);
  for (int i=0; i<2*r; ++i) {
    for (int j=0; j<16; ++j) x[j]^=b[i*16+j];
    salsa8(x);
    memcpy(&y[i*16], x, 64);
  }
  for (int i=0; i<r; ++i) memcpy(b+i*16, &y[i*32], 64);
  for (int i=0; i<r; ++i) memcpy(b+(i+r)*16, &y[i*32+16], 64);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x488, %rsp            # imm = 0x488
movl %esi, %eax
shll $0x5, %eax
cltq
movdqu -0x40(%rdi,%rax,4), %xmm0
movups -0x30(%rdi,%rax,4), %xmm1
movups -0x20(%rdi,%rax,4), %xmm2
movups -0x10(%rdi,%rax,4), %xmm3
movdqa %xmm0, -0x20(%rsp)
movaps %xmm1, -0x10(%rsp)
movaps %xmm2, (%rsp)
movaps %xmm3, 0x10(%rsp)
testl %esi, %esi
jle 0x3146d
leal (%rsi,%rsi), %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movq %rcx, 0x20(%rsp)
xorl %eax, %eax
movq %rdi, %rcx
movq %rsi, 0x30(%rsp)
movq %rdi, 0x28(%rsp)
movq %rax, 0x48(%rsp)
shlq $0x4, %rax
movq %rax, 0x38(%rsp)
xorl %eax, %eax
movdqu (%rcx,%rax,4), %xmm0
pxor -0x20(%rsp,%rax,4), %xmm0
movdqa %xmm0, -0x20(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x310cc
movq %rcx, 0x40(%rsp)
movdqa -0x20(%rsp), %xmm0
movaps -0x10(%rsp), %xmm1
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm3
movdqa %xmm0, -0x70(%rsp)
movaps %xmm3, -0x40(%rsp)
movaps %xmm1, -0x60(%rsp)
movaps %xmm2, -0x50(%rsp)
movl -0x70(%rsp), %r13d
movl -0x6c(%rsp), %r14d
movl -0x40(%rsp), %r10d
movl -0x3c(%rsp), %edx
movl -0x60(%rsp), %ecx
movl -0x5c(%rsp), %esi
movl -0x50(%rsp), %r9d
movl -0x4c(%rsp), %r8d
movl -0x48(%rsp), %ebp
movl -0x58(%rsp), %r15d
movl -0x38(%rsp), %edi
movl -0x68(%rsp), %r11d
movl -0x34(%rsp), %eax
movl -0x44(%rsp), %r12d
movl -0x64(%rsp), %ebx
movq %rbx, -0x30(%rsp)
movl $0x4, -0x24(%rsp)
movl -0x54(%rsp), %ebx
movq %r11, -0x78(%rsp)
leal (%r10,%r13), %r11d
roll $0x7, %r11d
xorl %ecx, %r11d
movq %r11, 0x60(%rsp)
leal (%r11,%r13), %ecx
roll $0x9, %ecx
xorl %r9d, %ecx
movq %rcx, %r9
movq %rcx, 0x70(%rsp)
addl %r11d, %ecx
roll $0xd, %ecx
xorl %r10d, %ecx
movq %rcx, 0x78(%rsp)
addl %r9d, %ecx
roll $0x12, %ecx
xorl %r13d, %ecx
leal (%r14,%rsi), %r10d
roll $0x7, %r10d
xorl %r8d, %r10d
movq %r10, 0x58(%rsp)
leal (%r10,%rsi), %r9d
roll $0x9, %r9d
xorl %edx, %r9d
movq %r9, 0x68(%rsp)
leal (%r9,%r10), %r8d
roll $0xd, %r8d
xorl %r14d, %r8d
leal (%r8,%r9), %edx
roll $0x12, %edx
xorl %esi, %edx
leal (%r15,%rbp), %esi
roll $0x7, %esi
xorl %edi, %esi
movq %rsi, 0x50(%rsp)
leal (%rsi,%rbp), %r10d
roll $0x9, %r10d
xorl -0x78(%rsp), %r10d
addl %r10d, %esi
roll $0xd, %esi
xorl %r15d, %esi
leal (%rsi,%r10), %edi
roll $0x12, %edi
xorl %ebp, %edi
leal (%r12,%rax), %r15d
roll $0x7, %r15d
xorl -0x30(%rsp), %r15d
leal (%r15,%rax), %ebp
roll $0x9, %ebp
xorl %ebx, %ebp
leal (%r15,%rbp), %r9d
roll $0xd, %r9d
xorl %r12d, %r9d
leal (%r9,%rbp), %r11d
roll $0x12, %r11d
xorl %eax, %r11d
movq %r11, -0x78(%rsp)
leal (%r15,%rcx), %r14d
roll $0x7, %r14d
xorl %r8d, %r14d
leal (%r14,%rcx), %r11d
roll $0x9, %r11d
xorl %r10d, %r11d
leal (%r11,%r14), %eax
roll $0xd, %eax
xorl %r15d, %eax
movq %rax, -0x30(%rsp)
leal (%rax,%r11), %r13d
roll $0x12, %r13d
xorl %ecx, %r13d
movq 0x60(%rsp), %rax
leal (%rdx,%rax), %r15d
roll $0x7, %r15d
xorl %esi, %r15d
leal (%r15,%rdx), %ebx
roll $0x9, %ebx
xorl %ebp, %ebx
leal (%rbx,%r15), %ecx
roll $0xd, %ecx
xorl %eax, %ecx
leal (%rcx,%rbx), %esi
roll $0x12, %esi
xorl %edx, %esi
movq 0x58(%rsp), %rax
leal (%rdi,%rax), %r12d
roll $0x7, %r12d
xorl %r9d, %r12d
leal (%r12,%rdi), %r9d
roll $0x9, %r9d
xorl 0x70(%rsp), %r9d
leal (%r9,%r12), %r8d
roll $0xd, %r8d
xorl %eax, %r8d
leal (%r8,%r9), %ebp
roll $0x12, %ebp
xorl %edi, %ebp
movq 0x50(%rsp), %rax
movq -0x78(%rsp), %rdx
leal (%rdx,%rax), %r10d
roll $0x7, %r10d
xorl 0x78(%rsp), %r10d
addl %r10d, %edx
roll $0x9, %edx
xorl 0x68(%rsp), %edx
leal (%rdx,%r10), %edi
roll $0xd, %edi
xorl %eax, %edi
leal (%rdi,%rdx), %eax
roll $0x12, %eax
xorl -0x78(%rsp), %eax
decl -0x24(%rsp)
jne 0x3116a
movl %r13d, -0x70(%rsp)
movl %r10d, -0x40(%rsp)
movl %ecx, -0x60(%rsp)
movl %r9d, -0x50(%rsp)
movl %esi, -0x5c(%rsp)
movl %r14d, -0x6c(%rsp)
movl %r8d, -0x4c(%rsp)
movl %edx, -0x3c(%rsp)
movl %ebp, -0x48(%rsp)
movl %r15d, -0x58(%rsp)
movl %edi, -0x38(%rsp)
movl %r11d, -0x68(%rsp)
movl %eax, -0x34(%rsp)
movl %r12d, -0x44(%rsp)
movq -0x30(%rsp), %rax
movl %eax, -0x64(%rsp)
movl %ebx, -0x54(%rsp)
xorl %eax, %eax
movdqa -0x20(%rsp,%rax,4), %xmm0
paddd -0x70(%rsp,%rax,4), %xmm0
movdqa %xmm0, -0x20(%rsp,%rax,4)
addq $0x4, %rax
cmpq $0x10, %rax
jne 0x31352
movdqa -0x20(%rsp), %xmm0
movaps -0x10(%rsp), %xmm1
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm3
movq 0x38(%rsp), %rax
movdqa %xmm0, 0x80(%rsp,%rax,4)
movaps %xmm1, 0x90(%rsp,%rax,4)
movaps %xmm2, 0xa0(%rsp,%rax,4)
movaps %xmm3, 0xb0(%rsp,%rax,4)
movq 0x48(%rsp), %rax
incq %rax
movq 0x40(%rsp), %rcx
addq $0x40, %rcx
cmpq 0x20(%rsp), %rax
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdi
jne 0x310bc
testl %esi, %esi
jle 0x3146d
movl %esi, %eax
movq %rax, %rcx
shlq $0x6, %rcx
xorl %edx, %edx
movdqu 0x80(%rsp,%rdx,2), %xmm0
movups 0x90(%rsp,%rdx,2), %xmm1
movups 0xa0(%rsp,%rdx,2), %xmm2
movups 0xb0(%rsp,%rdx,2), %xmm3
movups %xmm3, 0x30(%rdi,%rdx)
movups %xmm2, 0x20(%rdi,%rdx)
movups %xmm1, 0x10(%rdi,%rdx)
movdqu %xmm0, (%rdi,%rdx)
addq $0x40, %rdx
cmpq %rdx, %rcx
jne 0x313e1
testl %esi, %esi
jle 0x3146d
shll $0x4, %esi
leaq 0xc0(%rsp), %rcx
shlq $0x4, %rax
xorl %edx, %edx
leal (%rsi,%rdx), %r8d
movdqu (%rcx,%rdx,8), %xmm0
movups 0x10(%rcx,%rdx,8), %xmm1
movups 0x20(%rcx,%rdx,8), %xmm2
movups 0x30(%rcx,%rdx,8), %xmm3
movups %xmm3, 0x30(%rdi,%r8,4)
movups %xmm2, 0x20(%rdi,%r8,4)
movups %xmm1, 0x10(%rdi,%r8,4)
movdqu %xmm0, (%rdi,%r8,4)
addq $0x10, %rdx
cmpq %rdx, %rax
jne 0x31434
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq