// File: /workspace/github_cpp_makefile_star2_O2/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 $0x478, %rsp            # imm = 0x478
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, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
movq %rsi, -0x10(%rsp)
leal (%rsi,%rsi), %eax
xorl %ecx, %ecx
testl %eax, %eax
cmovlel %ecx, %eax
movq %rax, (%rsp)
movq %rdi, -0x8(%rsp)
cmpq (%rsp), %rcx
je 0x1a960
movl %ecx, %eax
andl $0xfffffff, %eax        # imm = 0xFFFFFFF
shlq $0x6, %rax
addq %rdi, %rax
movq %rcx, 0x10(%rsp)
shlq $0x4, %rcx
movq %rcx, 0x8(%rsp)
xorl %ecx, %ecx
cmpq $0x10, %rcx
je 0x1a686
movl (%rax,%rcx,4), %edx
xorl %edx, 0x30(%rsp,%rcx,4)
incq %rcx
jmp 0x1a674
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movaps 0x50(%rsp), %xmm2
movaps 0x60(%rsp), %xmm3
movaps %xmm0, -0x80(%rsp)
movaps %xmm3, -0x50(%rsp)
movaps %xmm1, -0x70(%rsp)
movaps %xmm2, -0x60(%rsp)
movl -0x80(%rsp), %r13d
movl -0x7c(%rsp), %eax
movq %rax, -0x30(%rsp)
movl -0x50(%rsp), %edi
movl -0x4c(%rsp), %r14d
movl -0x70(%rsp), %eax
movl -0x6c(%rsp), %esi
movl -0x60(%rsp), %r15d
movl -0x5c(%rsp), %ebx
movl -0x58(%rsp), %ebp
movl -0x68(%rsp), %ecx
movq %rcx, -0x38(%rsp)
movl -0x48(%rsp), %r11d
movl -0x78(%rsp), %ecx
movq %rcx, -0x40(%rsp)
movl -0x44(%rsp), %edx
movl -0x54(%rsp), %r9d
movl -0x74(%rsp), %ecx
movq %rcx, -0x20(%rsp)
movl -0x64(%rsp), %ecx
movq %rcx, -0x28(%rsp)
movl $0x4, %ecx
subl $0x1, %ecx
jb 0x1a8a5
movq %r9, %r12
leal (%rdi,%r13), %r9d
roll $0x7, %r9d
xorl %eax, %r9d
movl %ecx, -0x14(%rsp)
leal (%r9,%r13), %ecx
roll $0x9, %ecx
xorl %r15d, %ecx
movq %rcx, 0x20(%rsp)
leal (%rcx,%r9), %eax
roll $0xd, %eax
xorl %edi, %eax
movq %rax, 0x28(%rsp)
leal (%rax,%rcx), %edi
roll $0x12, %edi
xorl %r13d, %edi
movq -0x30(%rsp), %rax
leal (%rsi,%rax), %r8d
roll $0x7, %r8d
xorl %ebx, %r8d
leal (%r8,%rsi), %ecx
roll $0x9, %ecx
xorl %r14d, %ecx
movq %rcx, 0x18(%rsp)
leal (%rcx,%r8), %r14d
roll $0xd, %r14d
xorl %eax, %r14d
leal (%r14,%rcx), %ebx
roll $0x12, %ebx
xorl %esi, %ebx
movq -0x38(%rsp), %rax
leal (%rax,%rbp), %r10d
roll $0x7, %r10d
xorl %r11d, %r10d
leal (%r10,%rbp), %r13d
roll $0x9, %r13d
xorl -0x40(%rsp), %r13d
leal (%r10,%r13), %esi
roll $0xd, %esi
xorl %eax, %esi
leal (%rsi,%r13), %r11d
roll $0x12, %r11d
xorl %ebp, %r11d
leal (%rdx,%r12), %ecx
roll $0x7, %ecx
xorl -0x20(%rsp), %ecx
leal (%rcx,%rdx), %ebp
roll $0x9, %ebp
xorl -0x28(%rsp), %ebp
leal (%rcx,%rbp), %r15d
roll $0xd, %r15d
xorl %r12d, %r15d
leal (%r15,%rbp), %r12d
roll $0x12, %r12d
xorl %edx, %r12d
leal (%rdi,%rcx), %eax
roll $0x7, %eax
xorl %r14d, %eax
leal (%rax,%rdi), %edx
roll $0x9, %edx
xorl %r13d, %edx
movq %rax, -0x30(%rsp)
leal (%rdx,%rax), %r14d
roll $0xd, %r14d
xorl %ecx, %r14d
movq %r14, -0x20(%rsp)
movq %rdx, -0x40(%rsp)
leal (%r14,%rdx), %r13d
roll $0x12, %r13d
xorl %edi, %r13d
leal (%rbx,%r9), %eax
roll $0x7, %eax
xorl %esi, %eax
leal (%rax,%rbx), %ecx
roll $0x9, %ecx
xorl %ebp, %ecx
movq %rax, -0x38(%rsp)
addl %ecx, %eax
roll $0xd, %eax
xorl %r9d, %eax
movq %rcx, -0x28(%rsp)
leal (%rax,%rcx), %esi
roll $0x12, %esi
xorl %ebx, %esi
leal (%r11,%r8), %r9d
roll $0x7, %r9d
xorl %r15d, %r9d
leal (%r9,%r11), %r15d
roll $0x9, %r15d
xorl 0x20(%rsp), %r15d
movl -0x14(%rsp), %ecx
leal (%r15,%r9), %ebx
roll $0xd, %ebx
xorl %r8d, %ebx
leal (%rbx,%r15), %ebp
roll $0x12, %ebp
xorl %r11d, %ebp
leal (%r12,%r10), %edi
roll $0x7, %edi
xorl 0x28(%rsp), %edi
leal (%rdi,%r12), %r14d
roll $0x9, %r14d
xorl 0x18(%rsp), %r14d
leal (%r14,%rdi), %r11d
roll $0xd, %r11d
xorl %r10d, %r11d
leal (%r11,%r14), %edx
roll $0x12, %edx
xorl %r12d, %edx
jmp 0x1a711
movl %r13d, -0x80(%rsp)
movl %edi, -0x50(%rsp)
movl %eax, -0x70(%rsp)
movl %r15d, -0x60(%rsp)
movl %esi, -0x6c(%rsp)
movq -0x30(%rsp), %rax
movl %eax, -0x7c(%rsp)
movl %ebx, -0x5c(%rsp)
movl %r14d, -0x4c(%rsp)
movl %ebp, -0x58(%rsp)
movq -0x38(%rsp), %rax
movl %eax, -0x68(%rsp)
movl %r11d, -0x48(%rsp)
movq -0x40(%rsp), %rax
movl %eax, -0x78(%rsp)
movl %edx, -0x44(%rsp)
movl %r9d, -0x54(%rsp)
movq -0x20(%rsp), %rax
movl %eax, -0x74(%rsp)
movq -0x28(%rsp), %rax
movl %eax, -0x64(%rsp)
xorl %eax, %eax
movq -0x8(%rsp), %rdi
cmpq $0x10, %rax
je 0x1a91d
movl -0x80(%rsp,%rax,4), %ecx
addl %ecx, 0x30(%rsp,%rax,4)
incq %rax
jmp 0x1a90a
movaps 0x30(%rsp), %xmm0
movaps 0x40(%rsp), %xmm1
movaps 0x50(%rsp), %xmm2
movaps 0x60(%rsp), %xmm3
movq 0x8(%rsp), %rax
movaps %xmm0, 0x70(%rsp,%rax,4)
movaps %xmm1, 0x80(%rsp,%rax,4)
movaps %xmm2, 0x90(%rsp,%rax,4)
movaps %xmm3, 0xa0(%rsp,%rax,4)
movq 0x10(%rsp), %rcx
incq %rcx
jmp 0x1a64c
xorl %ecx, %ecx
movq -0x10(%rsp), %rdx
testl %edx, %edx
movl $0x0, %eax
cmovgl %edx, %eax
shlq $0x6, %rax
cmpq %rcx, %rax
je 0x1a9b0
movups 0x70(%rsp,%rcx,2), %xmm0
movups 0x80(%rsp,%rcx,2), %xmm1
movups 0x90(%rsp,%rcx,2), %xmm2
movups 0xa0(%rsp,%rcx,2), %xmm3
movups %xmm3, 0x30(%rdi,%rcx)
movups %xmm2, 0x20(%rdi,%rcx)
movups %xmm1, 0x10(%rdi,%rcx)
movups %xmm0, (%rdi,%rcx)
addq $0x40, %rcx
jmp 0x1a975
movslq -0x10(%rsp), %rcx
shlq $0x6, %rcx
addq %rcx, %rdi
xorl %ecx, %ecx
cmpq %rcx, %rax
je 0x1a9fc
movups 0xb0(%rsp,%rcx,2), %xmm0
movups 0xc0(%rsp,%rcx,2), %xmm1
movups 0xd0(%rsp,%rcx,2), %xmm2
movups 0xe0(%rsp,%rcx,2), %xmm3
movups %xmm3, 0x30(%rdi,%rcx)
movups %xmm2, 0x20(%rdi,%rcx)
movups %xmm1, 0x10(%rdi,%rcx)
movups %xmm0, (%rdi,%rcx)
addq $0x40, %rcx
jmp 0x1a9be
addq $0x478, %rsp            # imm = 0x478
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq