user: 请将以下的汇编代码转换成C语言代码:

```asm
<neoscrypt_blkmix>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %rsi,0x10(%rsp)
  mov    %edx,0xc(%rsp)
  mov    %ecx,%r15d
  sar    $0x8,%r15d
  movzbl %cl,%r14d
  cmp    $0x1,%edx
  je     L119
  mov    0xc(%rsp),%eax
  cmp    $0x2,%eax
  je     L53
  lea    (%rax,%rax,1),%edx
  test   %edx,%edx
  jle    L140
  lea    -0x1(%rdx),%eax
  shl    $0x4,%eax
  cltq
  lea    (%rdi,%rax,4),%rax
  mov    %rax,0x18(%rsp)
  mov    0x10(%rsp),%r13
  mov    %edx,%eax
  mov    %rax,(%rsp)
  mov    $0x0,%r12d
  mov    $0x0,%ebx
  jmp    L43
L119:
  lea    0x40(%rdi),%rbx
  mov    $0x40,%edx
  mov    %rbx,%rsi
  call   <neoscrypt_blkxor@plt>
  test   %r15d,%r15d
  je     L100
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_chacha@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %rbx,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L56
L100:
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_salsa@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %rbx,%rdi
  call   <neoscrypt_salsa@plt>
  jmp    L56
L53:
  lea    0xc0(%rdi),%r12
  mov    $0x40,%edx
  mov    %r12,%rsi
  call   <neoscrypt_blkxor@plt>
  test   %r15d,%r15d
  je     L159
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_chacha@plt>
  lea    0x40(%rbp),%rbx
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %rbx,%rdi
  call   <neoscrypt_chacha@plt>
  sub    $0xffffffffffffff80,%rbp
  mov    $0x40,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_chacha@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <neoscrypt_chacha@plt>
L62:
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <neoscrypt_blkswp@plt>
  jmp    L56
L159:
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_salsa@plt>
  lea    0x40(%rbp),%rbx
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %rbx,%rdi
  call   <neoscrypt_salsa@plt>
  sub    $0xffffffffffffff80,%rbp
  mov    $0x40,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %rbp,%rdi
  call   <neoscrypt_salsa@plt>
  mov    $0x40,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    %r14d,%esi
  mov    %r12,%rdi
  call   <neoscrypt_salsa@plt>
  jmp    L62
L117:
  mov    $0x40,%edx
  mov    0x18(%rsp),%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkxor@plt>
  jmp    L79
L34:
  movslq %r12d,%rax
  lea    0x0(%rbp,%rax,4),%rdi
  mov    %r14d,%esi
  call   <neoscrypt_salsa@plt>
L50:
  mov    %rbx,%rsi
  shl    $0x6,%rsi
  add    %rbp,%rsi
  mov    $0x40,%edx
  mov    %r13,%rdi
  call   <neoscrypt_blkcpy@plt>
  add    $0x1,%rbx
  add    $0x40,%r13
  add    $0x10,%r12d
  cmp    (%rsp),%rbx
  je     L140
L43:
  test   %ebx,%ebx
  je     L117
  lea    -0x10(%r12),%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rsi
  movslq %r12d,%rax
  lea    0x0(%rbp,%rax,4),%rdi
  mov    $0x40,%edx
  call   <neoscrypt_blkxor@plt>
L79:
  test   %r15d,%r15d
  je     L34
  movslq %r12d,%rax
  lea    0x0(%rbp,%rax,4),%rdi
  mov    %r14d,%esi
  call   <neoscrypt_chacha@plt>
  jmp    L50
L140:
  mov    0xc(%rsp),%eax
  test   %eax,%eax
  jle    L56
  mov    %rbp,%rbx
  lea    -0x1(%rax),%r14d
  mov    %r14,%rax
  shl    $0x6,%rax
  lea    0x40(%rbp,%rax,1),%r13
  mov    0x10(%rsp),%r12
L123:
  mov    $0x40,%edx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <neoscrypt_blkcpy@plt>
  add    $0x40,%rbx
  sub    $0xffffffffffffff80,%r12
  cmp    %r13,%rbx
  jne    L123
  mov    0xc(%rsp),%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(%rbp,%rax,4),%rbp
  mov    0x10(%rsp),%rax
  lea    0x40(%rax),%rbx
  shl    $0x7,%r14
  lea    0xc0(%rax,%r14,1),%r12
L147:
  mov    $0x40,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <neoscrypt_blkcpy@plt>
  add    $0x40,%rbp
  sub    $0xffffffffffffff80,%rbx
  cmp    %rbx,%r12
  jne    L147
L56:
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

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) {
    neoscrypt_blkxor(&X[0], &X[16], 64);
    if (mixer)
      neoscrypt_chacha(&X[0], rounds);
    else
      neoscrypt_salsa(&X[0], rounds);
    neoscrypt_blkxor(&X[16], &X[0], 64);
    if (mixer)
      neoscrypt_chacha(&X[16], rounds);
    else
      neoscrypt_salsa(&X[16], rounds);
    return;
  }
  if (r == 2) {
    neoscrypt_blkxor(&X[0], &X[48], 64);
    if (mixer)
      neoscrypt_chacha(&X[0], rounds);
    else
      neoscrypt_salsa(&X[0], rounds);
    neoscrypt_blkxor(&X[16], &X[0], 64);
    if (mixer)
      neoscrypt_chacha(&X[16], rounds);
    else
      neoscrypt_salsa(&X[16], rounds);
    neoscrypt_blkxor(&X[32], &X[16], 64);
    if (mixer)
      neoscrypt_chacha(&X[32], rounds);
    else
      neoscrypt_salsa(&X[32], rounds);
    neoscrypt_blkxor(&X[48], &X[32], 64);
    if (mixer)
      neoscrypt_chacha(&X[48], rounds);
    else
      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);
}
```