user: Please show me the C implementation that matches the assembly code listed below:

```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    L78
  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>
  cmpl   $0x0,-0x8(%rbp)
  je     L38
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L154
L38:
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_salsa@plt>
L154:
  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>
  cmpl   $0x0,-0x8(%rbp)
  je     L7
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L254
L7:
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
  jmp    L254
L78:
  cmpl   $0x2,-0x24(%rbp)
  jne    L2
  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>
  cmpl   $0x0,-0x8(%rbp)
  je     L11
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L112
L11:
  mov    -0x4(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <neoscrypt_salsa@plt>
L112:
  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>
  cmpl   $0x0,-0x8(%rbp)
  je     L173
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L218
L173:
  mov    -0x18(%rbp),%rax
  lea    0x40(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
L218:
  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>
  cmpl   $0x0,-0x8(%rbp)
  je     L188
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L18
L188:
  mov    -0x18(%rbp),%rax
  lea    0x80(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
L18:
  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>
  cmpl   $0x0,-0x8(%rbp)
  je     L255
  mov    -0x18(%rbp),%rax
  lea    0xc0(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_chacha@plt>
  jmp    L76
L255:
  mov    -0x18(%rbp),%rax
  lea    0xc0(%rax),%rdx
  mov    -0x4(%rbp),%eax
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <neoscrypt_salsa@plt>
L76:
  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    L254
L2:
  movl   $0x0,-0xc(%rbp)
  jmp    L242
L41:
  cmpl   $0x0,-0xc(%rbp)
  je     L185
  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    L33
L185:
  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>
L33:
  cmpl   $0x0,-0x8(%rbp)
  je     L216
  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    L17
L216:
  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>
L17:
  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)
L242:
  mov    -0x24(%rbp),%eax
  add    %eax,%eax
  cmp    %eax,-0xc(%rbp)
  jl     L41
  movl   $0x0,-0xc(%rbp)
  jmp    L103
L224:
  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)
L103:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L224
  movl   $0x0,-0xc(%rbp)
  jmp    L175
L247:
  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)
L175:
  mov    -0xc(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L247
L254:
  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) {
    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);
}
```