// File: /workspace/github_cpp_makefile_star2_O1/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
movups -0x40(%rdi,%rax,4), %xmm0
movups -0x30(%rdi,%rax,4), %xmm1
movups -0x20(%rdi,%rax,4), %xmm2
movups -0x10(%rdi,%rax,4), %xmm3
movaps %xmm0, 0x40(%rsp)
movaps %xmm1, 0x50(%rsp)
movaps %xmm2, 0x60(%rsp)
movaps %xmm3, 0x70(%rsp)
testl %esi, %esi
jle 0x47df6
leal (%rsi,%rsi), %eax
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
movq %rcx, -0x18(%rsp)
xorl %ecx, %ecx
movq %rdi, %rdx
movq %rsi, -0x8(%rsp)
movq %rdi, -0x10(%rsp)
movq %rcx, 0x8(%rsp)
xorl %eax, %eax
movl (%rdx,%rax,4), %ecx
xorl %ecx, 0x40(%rsp,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x47b09
movq %rdx, (%rsp)
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movaps 0x60(%rsp), %xmm2
movaps 0x70(%rsp), %xmm3
movaps %xmm0, -0x70(%rsp)
movaps %xmm3, -0x40(%rsp)
movaps %xmm1, -0x60(%rsp)
movaps %xmm2, -0x50(%rsp)
movl -0x70(%rsp), %r12d
movl -0x6c(%rsp), %ebx
movl -0x40(%rsp), %r9d
movl -0x3c(%rsp), %edx
movl -0x60(%rsp), %ecx
movl -0x5c(%rsp), %eax
movl -0x50(%rsp), %r8d
movl -0x4c(%rsp), %edi
movl -0x48(%rsp), %r13d
movl -0x58(%rsp), %r14d
movl -0x38(%rsp), %esi
movl -0x68(%rsp), %r10d
movl -0x34(%rsp), %ebp
movl -0x44(%rsp), %r15d
movl -0x64(%rsp), %r11d
movq %r11, -0x28(%rsp)
movl $0x4, -0x1c(%rsp)
movl -0x54(%rsp), %r11d
movq %r10, -0x78(%rsp)
leal (%r9,%r12), %r10d
roll $0x7, %r10d
xorl %ecx, %r10d
movq %r10, 0x20(%rsp)
leal (%r10,%r12), %ecx
roll $0x9, %ecx
xorl %r8d, %ecx
movq %rcx, %r8
movq %rcx, 0x30(%rsp)
addl %r10d, %ecx
roll $0xd, %ecx
xorl %r9d, %ecx
movq %rcx, 0x38(%rsp)
addl %r8d, %ecx
roll $0x12, %ecx
xorl %r12d, %ecx
leal (%rbx,%rax), %r9d
roll $0x7, %r9d
xorl %edi, %r9d
movq %r9, 0x18(%rsp)
leal (%r9,%rax), %r8d
roll $0x9, %r8d
xorl %edx, %r8d
movq %r8, 0x28(%rsp)
leal (%r8,%r9), %edi
roll $0xd, %edi
xorl %ebx, %edi
leal (%rdi,%r8), %edx
roll $0x12, %edx
xorl %eax, %edx
leal (%r14,%r13), %eax
roll $0x7, %eax
xorl %esi, %eax
movq %rax, 0x10(%rsp)
leal (%rax,%r13), %r9d
roll $0x9, %r9d
xorl -0x78(%rsp), %r9d
addl %r9d, %eax
roll $0xd, %eax
xorl %r14d, %eax
leal (%rax,%r9), %esi
roll $0x12, %esi
xorl %r13d, %esi
leal (%r15,%rbp), %r14d
roll $0x7, %r14d
xorl -0x28(%rsp), %r14d
leal (%r14,%rbp), %r13d
roll $0x9, %r13d
xorl %r11d, %r13d
leal (%r14,%r13), %r8d
roll $0xd, %r8d
xorl %r15d, %r8d
leal (%r8,%r13), %r10d
roll $0x12, %r10d
xorl %ebp, %r10d
movq %r10, -0x78(%rsp)
leal (%r14,%rcx), %ebx
roll $0x7, %ebx
xorl %edi, %ebx
leal (%rbx,%rcx), %r10d
roll $0x9, %r10d
xorl %r9d, %r10d
leal (%r10,%rbx), %edi
roll $0xd, %edi
xorl %r14d, %edi
movq %rdi, -0x28(%rsp)
leal (%rdi,%r10), %r12d
roll $0x12, %r12d
xorl %ecx, %r12d
movq 0x20(%rsp), %rdi
leal (%rdx,%rdi), %r14d
roll $0x7, %r14d
xorl %eax, %r14d
leal (%r14,%rdx), %r11d
roll $0x9, %r11d
xorl %r13d, %r11d
leal (%r11,%r14), %ecx
roll $0xd, %ecx
xorl %edi, %ecx
leal (%rcx,%r11), %eax
roll $0x12, %eax
xorl %edx, %eax
movq 0x18(%rsp), %rdx
leal (%rsi,%rdx), %r15d
roll $0x7, %r15d
xorl %r8d, %r15d
leal (%r15,%rsi), %r8d
roll $0x9, %r8d
xorl 0x30(%rsp), %r8d
leal (%r8,%r15), %edi
roll $0xd, %edi
xorl %edx, %edi
leal (%rdi,%r8), %r13d
roll $0x12, %r13d
xorl %esi, %r13d
movq 0x10(%rsp), %rbp
movq -0x78(%rsp), %rdx
leal (%rdx,%rbp), %r9d
roll $0x7, %r9d
xorl 0x38(%rsp), %r9d
addl %r9d, %edx
roll $0x9, %edx
xorl 0x28(%rsp), %edx
leal (%rdx,%r9), %esi
roll $0xd, %esi
xorl %ebp, %esi
leal (%rsi,%rdx), %ebp
roll $0x12, %ebp
xorl -0x78(%rsp), %ebp
decl -0x1c(%rsp)
jne 0x47b9b
movl %r12d, -0x70(%rsp)
movl %r9d, -0x40(%rsp)
movl %ecx, -0x60(%rsp)
movl %r8d, -0x50(%rsp)
movl %eax, -0x5c(%rsp)
movl %ebx, -0x6c(%rsp)
movl %edi, -0x4c(%rsp)
movl %edx, -0x3c(%rsp)
movl %r13d, -0x48(%rsp)
movl %r14d, -0x58(%rsp)
movl %esi, -0x38(%rsp)
movl %r10d, -0x68(%rsp)
movl %ebp, -0x34(%rsp)
movl %r15d, -0x44(%rsp)
movq -0x28(%rsp), %rax
movl %eax, -0x64(%rsp)
movl %r11d, -0x54(%rsp)
xorl %eax, %eax
movl -0x70(%rsp,%rax,4), %ecx
addl %ecx, 0x40(%rsp,%rax,4)
incq %rax
cmpq $0x10, %rax
jne 0x47d85
movq 0x8(%rsp), %rcx
movq %rcx, %rax
shlq $0x6, %rax
movaps 0x40(%rsp), %xmm0
movaps 0x50(%rsp), %xmm1
movaps 0x60(%rsp), %xmm2
movaps 0x70(%rsp), %xmm3
movaps %xmm0, 0x80(%rsp,%rax)
movaps %xmm1, 0x90(%rsp,%rax)
movaps %xmm2, 0xa0(%rsp,%rax)
movaps %xmm3, 0xb0(%rsp,%rax)
incq %rcx
movq (%rsp), %rdx
addq $0x40, %rdx
cmpq -0x18(%rsp), %rcx
movq -0x8(%rsp), %rsi
movq -0x10(%rsp), %rdi
jne 0x47b02
movl %esi, %eax
testl %esi, %esi
jle 0x47e41
movq %rax, %rcx
shlq $0x6, %rcx
xorl %edx, %edx
movups 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)
movups %xmm0, (%rdi,%rdx)
addq $0x40, %rdx
cmpq %rdx, %rcx
jne 0x47e05
testl %esi, %esi
jle 0x47e8d
shll $0x4, %esi
leaq 0xc0(%rsp), %rcx
shlq $0x4, %rax
xorl %edx, %edx
leal (%rsi,%rdx), %r8d
movups (%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)
movups %xmm0, (%rdi,%r8,4)
addq $0x10, %rdx
cmpq %rdx, %rax
jne 0x47e56
addq $0x488, %rsp            # imm = 0x488
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq