// File: twekkel[P]mzpq/libzpaq.cpp
// Function: libzpaq::smix(char*, int, int)
static void smix(char* b, int r, int n) {
  libzpaq::Array<U32> x(32*r), v(32*r*n);
  for (int i=0; i<r*128; ++i) x[i/4]+=(b[i]&255)<<i%4*8;
  for (int i=0; i<n; ++i) {
    memcpy(&v[i*r*32], &x[0], r*128);
    blockmix(&x[0], r);
  }
  for (int i=0; i<n; ++i) {
    U32 j=x[(2*r-1)*16]&(n-1);
    for (int k=0; k<r*32; ++k) x[k]^=v[j*r*32+k];
    blockmix(&x[0], r);
  }
  for (int i=0; i<r*128; ++i) b[i]=x[i/4]>>(i%4*8);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl -0xc(%rbp), %eax
shll $0x5, %eax
movslq %eax, %rsi
leaq -0x28(%rbp), %rdi
xorl %edx, %edx
movl %edx, -0x68(%rbp)
callq 0x30690
movl -0x68(%rbp), %edx
movl -0xc(%rbp), %eax
movl -0x10(%rbp), %ecx
imull %ecx, %eax
shll $0x5, %eax
movslq %eax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x30690
jmp 0xe259
movl $0x0, -0x50(%rbp)
movl -0x50(%rbp), %eax
movl -0xc(%rbp), %ecx
shll $0x7, %ecx
cmpl %ecx, %eax
jge 0xe2f1
movq -0x8(%rbp), %rax
movslq -0x50(%rbp), %rdx
movl %edx, %ecx
movl %ecx, %esi
addl $0x3, %esi
testq %rdx, %rdx
movzbl (%rax,%rdx), %edx
movl %ecx, %eax
cmovsl %esi, %eax
movl %eax, %esi
andl $-0x4, %esi
subl %esi, %ecx
shlb $0x3, %cl
shll %cl, %edx
movl %edx, -0x74(%rbp)
sarl $0x2, %eax
movslq %eax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x30880
movq %rax, -0x70(%rbp)
jmp 0xe2b0
movq -0x70(%rbp), %rax
movl -0x74(%rbp), %ecx
addl (%rax), %ecx
movl %ecx, (%rax)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0xe260
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xe511
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x30820
jmp 0xe511
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0xe388
movl -0x54(%rbp), %eax
movl -0xc(%rbp), %ecx
imull %ecx, %eax
shll $0x5, %eax
movslq %eax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x30880
movq %rax, -0x80(%rbp)
jmp 0xe322
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x30880
movq %rax, -0x88(%rbp)
jmp 0xe338
movq -0x88(%rbp), %rsi
movq -0x80(%rbp), %rdi
movl -0xc(%rbp), %eax
shll $0x7, %eax
movslq %eax, %rdx
callq 0x5200
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x30880
movq %rax, -0x90(%rbp)
jmp 0xe367
movq -0x90(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x28320
jmp 0xe378
jmp 0xe37a
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0xe2f8
movl $0x0, -0x58(%rbp)
movl -0x58(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0xe47e
movl -0xc(%rbp), %eax
shll $0x5, %eax
addl $-0x10, %eax
movslq %eax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x30880
movq %rax, -0x98(%rbp)
jmp 0xe3b9
movq -0x98(%rbp), %rax
movl (%rax), %eax
movl -0x10(%rbp), %ecx
subl $0x1, %ecx
andl %ecx, %eax
movl %eax, -0x5c(%rbp)
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl -0xc(%rbp), %ecx
shll $0x5, %ecx
cmpl %ecx, %eax
jge 0xe447
movl -0x5c(%rbp), %eax
movl -0xc(%rbp), %ecx
imull %ecx, %eax
shll $0x5, %eax
movl -0x60(%rbp), %ecx
addl %ecx, %eax
movl %eax, %esi
leaq -0x40(%rbp), %rdi
callq 0x30880
movq %rax, -0xa0(%rbp)
jmp 0xe406
movq -0xa0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xac(%rbp)
movslq -0x60(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x30880
movq %rax, -0xa8(%rbp)
jmp 0xe42b
movq -0xa8(%rbp), %rax
movl -0xac(%rbp), %ecx
xorl (%rax), %ecx
movl %ecx, (%rax)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0xe3d4
xorl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x30880
movq %rax, -0xb8(%rbp)
jmp 0xe45d
movq -0xb8(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x28320
jmp 0xe46e
jmp 0xe470
movl -0x58(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x58(%rbp)
jmp 0xe38f
movl $0x0, -0x64(%rbp)
movl -0x64(%rbp), %eax
movl -0xc(%rbp), %ecx
shll $0x7, %ecx
cmpl %ecx, %eax
jge 0xe4f6
movl -0x64(%rbp), %eax
movl %eax, %ecx
addl $0x3, %ecx
testl %eax, %eax
cmovsl %ecx, %eax
sarl $0x2, %eax
movslq %eax, %rsi
leaq -0x28(%rbp), %rdi
callq 0x30880
movq %rax, -0xc0(%rbp)
jmp 0xe4b7
movq -0xc0(%rbp), %rax
movl (%rax), %eax
movl %eax, -0xc4(%rbp)
movl -0x64(%rbp), %eax
movl $0x4, %ecx
cltd
idivl %ecx
movl -0xc4(%rbp), %eax
movl %edx, %ecx
shll $0x3, %ecx
shrl %cl, %eax
movb %al, %dl
movq -0x8(%rbp), %rax
movslq -0x64(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x64(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x64(%rbp)
jmp 0xe485
leaq -0x40(%rbp), %rdi
callq 0x30820
leaq -0x28(%rbp), %rdi
callq 0x30820
addq $0xd0, %rsp
popq %rbp
retq
leaq -0x28(%rbp), %rdi
callq 0x30820
movq -0x48(%rbp), %rdi
callq 0x5490
nopw %cs:(%rax,%rax)