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

```asm
<smix>:
  endbr64
  push   %r15
  mov    %rsi,%r15
  mov    %rsi,%rax
  push   %r14
  shl    $0x7,%r15
  push   %r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  lea    (%r8,%r15,1),%rbp
  push   %rbx
  lea    0x0(%rbp,%r15,1),%r13
  mov    %r8,%rbx
  sub    $0x38,%rsp
  shl    $0x5,%rax
  mov    %rdi,0x28(%rsp)
  mov    %edx,0x18(%rsp)
  mov    %rcx,(%rsp)
  mov    %rax,0x20(%rsp)
  je     L49
  mov    %rsi,0x10(%rsp)
  xor    %r14d,%r14d
  mov    %rbp,0x8(%rsp)
  mov    %r14,%r12
  mov    %rdi,%rbp
  mov    %rax,%r14
  nopl   (%rax)
L59:
  mov    %rbp,%rdi
  add    $0x10,%rbp
  call   <libcperciva_le32dec@plt>
  mov    %eax,(%rbx,%r12,4)
  add    $0x1,%r12
  cmp    %r14,%r12
  jne    L59
  mov    0x18(%rsp),%eax
  mov    0x8(%rsp),%rbp
  mov    0x10(%rsp),%r12
  test   %eax,%eax
  jle    L36
L17:
  mov    0x18(%rsp),%eax
  mov    %r12d,%r14d
  mov    (%rsp),%r8
  xor    %r10d,%r10d
  shl    $0x7,%r14d
  sub    $0x1,%eax
  mov    %eax,0x18(%rsp)
  and    $0xfffffffe,%eax
  add    $0x2,%eax
  mov    %eax,0x1c(%rsp)
  nopw   0x0(%rax,%rax,1)
L16:
  mov    %r8,%rdi
  mov    %r14d,%edx
  mov    %rbx,%rsi
  mov    %r10d,0x10(%rsp)
  mov    %r8,0x8(%rsp)
  call   <blkcpy@plt>
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <blockmix_salsa8@plt>
  mov    0x8(%rsp),%r8
  mov    %r14d,%edx
  mov    %rbp,%rsi
  add    %r15,%r8
  mov    %r8,%rdi
  mov    %r8,0x8(%rsp)
  call   <blkcpy@plt>
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <blockmix_salsa8@plt>
  mov    0x10(%rsp),%r9d
  mov    0x8(%rsp),%r8
  lea    0x2(%r9),%r10d
  add    %r15,%r8
  cmp    %r10d,0x1c(%rsp)
  jne    L16
  xor    %r8d,%r8d
  mov    %r15,0x8(%rsp)
  mov    %r8d,%r15d
L37:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <integerify@plt>
  and    0x18(%rsp),%eax
  mov    %r14d,%edx
  mov    %rbx,%rdi
  movslq %eax,%rsi
  imul   0x8(%rsp),%rsi
  add    (%rsp),%rsi
  call   <blkxor@plt>
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <blockmix_salsa8@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <integerify@plt>
  mov    0x18(%rsp),%esi
  mov    %r14d,%edx
  mov    %rbp,%rdi
  and    %eax,%esi
  movslq %esi,%rsi
  imul   0x8(%rsp),%rsi
  add    (%rsp),%rsi
  call   <blkxor@plt>
  mov    %r12,%rcx
  mov    %r13,%rdx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <blockmix_salsa8@plt>
  mov    %r15d,%eax
  add    $0x2,%r15d
  cmp    %eax,0x10(%rsp)
  jne    L37
  cmpq   $0x0,0x20(%rsp)
  je     L77
L36:
  mov    0x28(%rsp),%r12
  mov    0x20(%rsp),%r13
  xor    %ebp,%ebp
  nopl   0x0(%rax,%rax,1)
L3:
  mov    (%rbx,%rbp,4),%esi
  mov    %r12,%rdi
  add    $0x1,%rbp
  add    $0x10,%r12
  call   <libcperciva_le32enc@plt>
  cmp    %rbp,%r13
  jne    L3
L77:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L49:
  mov    0x18(%rsp),%edx
  test   %edx,%edx
  jg     L17
  jmp    L77
```

assistant: ```c
void smix(uint8_t *B, size_t r, uint64_t N, uint32_t *V, uint32_t *XY) {
  uint32_t *X = XY;
  uint32_t *Y = &XY[32 * r];
  uint32_t *Z = &XY[64 * r];
  uint64_t i;
  uint64_t j;
  size_t k;
  for (k = 0; k < 32 * r; k++)
    X[k] = libcperciva_le32dec(&B[4 * k]);
  for (i = 0; i < N; i += 2) {
    blkcpy(&V[i * (32 * r)], X, 128 * r);
    blockmix_salsa8(X, Y, Z, r);
    blkcpy(&V[(i + 1) * (32 * r)], Y, 128 * r);
    blockmix_salsa8(Y, X, Z, r);
  }
  for (i = 0; i < N; i += 2) {
    j = integerify(X, r) & (N - 1);
    blkxor(X, &V[j * (32 * r)], 128 * r);
    blockmix_salsa8(X, Y, Z, r);
    j = integerify(Y, r) & (N - 1);
    blkxor(Y, &V[j * (32 * r)], 128 * r);
    blockmix_salsa8(Y, X, Z, r);
  }
  for (k = 0; k < 32 * r; k++)
    libcperciva_le32enc(&B[4 * k], X[k]);
}
```