user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<neoscrypt_blkmix>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    -0x28(%rbp),%eax
  sar    $0x8,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x28(%rbp),%eax
  movzbl %al,%eax
  mov    %eax,-0x4(%rbp)
  cmpl   $0x1,-0x24(%rbp)
  jne    L72
  cmpl   $0x0,-0x8(%rbp)
  je     L163
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_chacha@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L176
L163:
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_salsa@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
  jmp    L176
L72:
  cmpl   $0x2,-0x24(%rbp)
  jne    L177
  cmpl   $0x0,-0x8(%rbp)
  je     L116
  mov    -0x18(%rbp),%rax
  lea    0xc0(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_chacha@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  sub    $0xffffffffffffff80,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    $0xc0,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0xc0(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    $0x40,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkswp@plt>
  jmp    L176
L116:
  mov    -0x18(%rbp),%rax
  lea    0xc0(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_salsa@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rcx
  mov    -0x18(%rbp),%rax
  sub    $0xffffffffffffff80,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    $0xc0,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  mov    -0x18(%rbp),%rax
  lea    0xc0(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rcx
  mov    -0x18(%rbp),%rax
  add    $0x40,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkswp@plt>
  jmp    L176
L177:
  movl   $0x0,-0xc(%rbp)
  jmp    L82
L106:
  cmpl   $0x0,-0xc(%rbp)
  je     L136
  mov    -0xc(%rbp),%eax
  sub    $0x1,%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
  jmp    L173
L136:
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  sub    $0x1,%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x18(%rbp),%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkxor@plt>
L173:
  cmpl   $0x0,-0x8(%rbp)
  je     L152
  mov    -0xc(%rbp),%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L120
L152:
  mov    -0xc(%rbp),%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
L120:
  mov    -0xc(%rbp),%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkcpy@plt>
  addl   $0x1,-0xc(%rbp)
L82:
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0xc(%rbp)
  jl     L106
  movl   $0x0,-0xc(%rbp)
  jmp    L113
L64:
  mov    -0xc(%rbp),%eax
  shl    $0x5,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkcpy@plt>
  addl   $0x1,-0xc(%rbp)
L113:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L64
  movl   $0x0,-0xc(%rbp)
  jmp    L168
L107:
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x20(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0xc(%rbp),%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  shl    $0x4,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    $0x40,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <neoscrypt_blkcpy@plt>
  addl   $0x1,-0xc(%rbp)
L168:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L107
L176:
  leave
  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) {
    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);
}
```