user: Converte this assembly snippet into its equivalent C code:

```asm
<neoscrypt_blkmix>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  sar    $0x8,%r15d
  push   %r13
  mov    %rdi,%r13
  push   %r12
  movzbl %cl,%r12d
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rsi,0x10(%rsp)
  mov    %edx,0xc(%rsp)
  cmp    $0x1,%edx
  je     L9
  mov    0xc(%rsp),%eax
  cmp    $0x2,%eax
  je     L85
  add    %eax,%eax
  mov    %eax,0x8(%rsp)
  test   %eax,%eax
  jle    L28
  mov    0x8(%rsp),%eax
  mov    0x10(%rsp),%rbp
  lea    -0x40(%rdi),%r14
  xor    %ebx,%ebx
  sub    $0x1,%eax
  shl    $0x4,%eax
  cltq
  lea    (%rdi,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  jmp    L32
  nop
L6:
  call   <neoscrypt_chacha@plt>
L133:
  mov    %rbp,%rdi
  mov    $0x40,%edx
  mov    %r14,%rsi
  add    $0x1,%ebx
  call   <neoscrypt_blkcpy@plt>
  add    $0x40,%rbp
  cmp    %ebx,0x8(%rsp)
  je     L28
L32:
  mov    %r14,%rsi
  mov    $0x40,%edx
  add    $0x40,%r14
  test   %ebx,%ebx
  je     L52
  mov    %r14,%rdi
  call   <neoscrypt_blkxor@plt>
L5:
  mov    %r12d,%esi
  mov    %r14,%rdi
  test   %r15d,%r15d
  jne    L6
  call   <neoscrypt_salsa@plt>
  jmp    L133
  nopl   0x0(%rax)
L52:
  mov    0x18(%rsp),%rsi
  mov    %r13,%rdi
  call   <neoscrypt_blkxor@plt>
  jmp    L5
  nop
L28:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L58
  mov    0xc(%rsp),%eax
  mov    0x10(%rsp),%r14
  mov    %r13,%rbx
  lea    -0x1(%rax),%ebp
  mov    %rbp,%rax
  shl    $0x6,%rax
  lea    0x40(%r13,%rax,1),%r12
  nopw   0x0(%rax,%rax,1)
L14:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    $0x40,%edx
  add    $0x40,%rbx
  call   <neoscrypt_blkcpy@plt>
  sub    $0xffffffffffffff80,%r14
  cmp    %rbx,%r12
  jne    L14
  mov    0xc(%rsp),%eax
  shl    $0x7,%rbp
  shl    $0x4,%eax
  cltq
  lea    0x0(%r13,%rax,4),%r12
  mov    0x10(%rsp),%rax
  lea    0x40(%rax),%rbx
  lea    0xc0(%rax,%rbp,1),%rbp
L59:
  mov    %rbx,%rsi
  mov    %r12,%rdi
  mov    $0x40,%edx
  sub    $0xffffffffffffff80,%rbx
  call   <neoscrypt_blkcpy@plt>
  add    $0x40,%r12
  cmp    %rbx,%rbp
  jne    L59
L58:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L9:
  lea    0x40(%rdi),%rbp
  mov    $0x40,%edx
  mov    %rbp,%rsi
  test   %r15d,%r15d
  je     L75
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <neoscrypt_chacha@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    $0x40,%edx
  call   <neoscrypt_blkxor@plt>
  add    $0x28,%rsp
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <neoscrypt_chacha@plt>
  nopw   0x0(%rax,%rax,1)
L75:
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <neoscrypt_salsa@plt>
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    $0x40,%edx
  call   <neoscrypt_blkxor@plt>
  add    $0x28,%rsp
  mov    %r12d,%esi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <neoscrypt_salsa@plt>
  nopl   0x0(%rax)
L85:
  lea    0xc0(%rdi),%rbx
  lea    0x40(%rdi),%rbp
  mov    $0x40,%edx
  lea    0x80(%rdi),%r14
  mov    %rbx,%rsi
  test   %r15d,%r15d
  je     L141
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <neoscrypt_chacha@plt>
  mov    $0x40,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_chacha@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %r14,%rdi
  call   <neoscrypt_chacha@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    $0x40,%edx
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %rbx,%rdi
  call   <neoscrypt_chacha@plt>
L90:
  add    $0x28,%rsp
  mov    %r14,%rsi
  mov    %rbp,%rdi
  mov    $0x40,%edx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10d0 <neoscrypt_blkswp@plt>
  nopw   0x0(%rax,%rax,1)
L141:
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %r13,%rdi
  call   <neoscrypt_salsa@plt>
  mov    $0x40,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_salsa@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %r14,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %r14,%rdi
  call   <neoscrypt_salsa@plt>
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    $0x40,%edx
  call   <neoscrypt_blkxor@plt>
  mov    %r12d,%esi
  mov    %rbx,%rdi
  call   <neoscrypt_salsa@plt>
  jmp    L90
```

assistant: ```c
void neoscrypt_blkmix(uint *X, uint *Y, uint r, uint mixmode) {
  uint i, mixer, rounds;
  mixer = mixmode >> 8;
  rounds = mixmode & 0xFF;
  if (r == 1) {
    if (mixer) {
      neoscrypt_blkxor(&X[0], &X[16], 64);
      neoscrypt_chacha(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_chacha(&X[16], rounds);
    } else {
      neoscrypt_blkxor(&X[0], &X[16], 64);
      neoscrypt_salsa(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_salsa(&X[16], rounds);
    }
    return;
  }
  if (r == 2) {
    if (mixer) {
      neoscrypt_blkxor(&X[0], &X[48], 64);
      neoscrypt_chacha(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_chacha(&X[16], rounds);
      neoscrypt_blkxor(&X[32], &X[16], 64);
      neoscrypt_chacha(&X[32], rounds);
      neoscrypt_blkxor(&X[48], &X[32], 64);
      neoscrypt_chacha(&X[48], rounds);
      neoscrypt_blkswp(&X[16], &X[32], 64);
    } else {
      neoscrypt_blkxor(&X[0], &X[48], 64);
      neoscrypt_salsa(&X[0], rounds);
      neoscrypt_blkxor(&X[16], &X[0], 64);
      neoscrypt_salsa(&X[16], rounds);
      neoscrypt_blkxor(&X[32], &X[16], 64);
      neoscrypt_salsa(&X[32], rounds);
      neoscrypt_blkxor(&X[48], &X[32], 64);
      neoscrypt_salsa(&X[48], rounds);
      neoscrypt_blkswp(&X[16], &X[32], 64);
    }
    return;
  }
  for (i = 0; i < 2 * r; i++) {
    if (i)
      neoscrypt_blkxor(&X[16 * i], &X[16 * (i - 1)], 64);
    else
      neoscrypt_blkxor(&X[0], &X[16 * (2 * r - 1)], 64);
    if (mixer)
      neoscrypt_chacha(&X[16 * i], rounds);
    else
      neoscrypt_salsa(&X[16 * i], rounds);
    neoscrypt_blkcpy(&Y[16 * i], &X[16 * i], 64);
  }
  for (i = 0; i < r; i++)
    neoscrypt_blkcpy(&X[16 * i], &Y[16 * 2 * i], 64);
  for (i = 0; i < r; i++)
    neoscrypt_blkcpy(&X[16 * (i + r)], &Y[16 * (2 * i + 1)], 64);
}
```