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

```asm
<neoscrypt_blkmix>:
  endbr64
  push   %r15
  mov    %ecx,%eax
  movzbl %cl,%r15d
  push   %r14
  shr    $0x8,%eax
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %edx,0xc(%rsp)
  mov    %eax,0x10(%rsp)
  cmp    $0x1,%edx
  je     L65
  mov    0xc(%rsp),%eax
  cmp    $0x2,%eax
  je     L21
  add    %eax,%eax
  mov    %rsi,%r14
  mov    %eax,0x14(%rsp)
  je     L146
  mov    0xc(%rsp),%eax
  xor    %r12d,%r12d
  shl    $0x5,%eax
  sub    $0x10,%eax
  lea    (%rdi,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  jmp    L102
  nopl   0x0(%rax,%rax,1)
L18:
  call   <neoscrypt_chacha@plt>
L28:
  lea    (%r14,%rbx,1),%rdi
  mov    $0x40,%edx
  mov    %rbp,%rsi
  add    $0x1,%r12d
  call   <neoscrypt_blkcpy@plt>
  cmp    %r12d,0x14(%rsp)
  je     L146
L102:
  mov    %r12d,%eax
  shl    $0x4,%eax
  mov    %eax,%ebx
  shl    $0x2,%rbx
  lea    0x0(%r13,%rbx,1),%rbp
  test   %r12d,%r12d
  je     L58
  sub    $0x10,%eax
  mov    $0x40,%edx
  mov    %rbp,%rdi
  lea    0x0(%r13,%rax,4),%rsi
  call   <neoscrypt_blkxor@plt>
L40:
  mov    0x10(%rsp),%eax
  mov    %r15d,%esi
  mov    %rbp,%rdi
  test   %eax,%eax
  jne    L18
  call   <neoscrypt_salsa@plt>
  jmp    L28
  nopl   0x0(%rax)
L58:
  mov    0x18(%rsp),%rsi
  mov    $0x40,%edx
  mov    %r13,%rdi
  call   <neoscrypt_blkxor@plt>
  jmp    L40
  nopl   0x0(%rax)
L146:
  mov    0xc(%rsp),%esi
  xor    %ebx,%ebx
  test   %esi,%esi
  je     L143
  nopw   0x0(%rax,%rax,1)
L73:
  mov    %ebx,%eax
  mov    $0x40,%edx
  mov    %ebx,%r12d
  shl    $0x5,%eax
  lea    (%r14,%rax,4),%rsi
  mov    %ebx,%eax
  lea    0x1(%rbx),%ebx
  shl    $0x4,%eax
  lea    0x0(%r13,%rax,4),%rdi
  call   <neoscrypt_blkcpy@plt>
  cmp    %ebx,0xc(%rsp)
  jne    L73
  mov    0xc(%rsp),%ebp
  xor    %ebx,%ebx
  shl    $0x4,%ebp
  nopw   0x0(%rax,%rax,1)
L147:
  mov    %ebx,%eax
  mov    $0x40,%edx
  shl    $0x5,%eax
  add    $0x10,%eax
  lea    (%r14,%rax,4),%rsi
  mov    %ebp,%eax
  add    $0x10,%ebp
  lea    0x0(%r13,%rax,4),%rdi
  call   <neoscrypt_blkcpy@plt>
  mov    %ebx,%eax
  add    $0x1,%ebx
  cmp    %eax,%r12d
  jne    L147
L143:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L65:
  lea    0x40(%rdi),%rbp
  mov    $0x40,%edx
  mov    %rbp,%rsi
  test   %eax,%eax
  je     L20
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%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    %r15d,%esi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10c0 <neoscrypt_chacha@plt>
  nopl   0x0(%rax)
L20:
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%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    %r15d,%esi
  mov    %rbp,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10b0 <neoscrypt_salsa@plt>
  nopl   0x0(%rax)
L21:
  mov    0x10(%rsp),%ecx
  lea    0x40(%rdi),%rbp
  lea    0xc0(%rdi),%r14
  mov    $0x40,%edx
  lea    0x80(%rdi),%r12
  mov    %r14,%rsi
  test   %ecx,%ecx
  je     L19
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <neoscrypt_chacha@plt>
  mov    $0x40,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_chacha@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %r12,%rdi
  call   <neoscrypt_chacha@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  mov    $0x40,%edx
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <neoscrypt_chacha@plt>
L131:
  add    $0x28,%rsp
  mov    %r12,%rsi
  mov    %rbp,%rdi
  mov    $0x40,%edx
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    10d0 <neoscrypt_blkswp@plt>
  nopl   (%rax)
L19:
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %r13,%rdi
  call   <neoscrypt_salsa@plt>
  mov    $0x40,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_salsa@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %r12,%rdi
  call   <neoscrypt_salsa@plt>
  mov    %r12,%rsi
  mov    %r14,%rdi
  mov    $0x40,%edx
  call   <neoscrypt_blkxor@plt>
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <neoscrypt_salsa@plt>
  jmp    L131
```

assistant: ```c
void neoscrypt_blkmix(unsigned int *X, unsigned int *Y, unsigned int r, unsigned int mixmode) {
  unsigned int 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);
}
```