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

```asm
<scrypt_1024_1_1_256_sp>:
  endbr64
  push   %r15
  mov    $0x50,%ecx
  mov    $0x1,%r8d
  push   %r14
  push   %r13
  lea    0x3f(%rdx),%r13
  mov    %rdi,%rdx
  push   %r12
  and    $0xffffffffffffffc0,%r13
  push   %rbp
  push   %rbx
  sub    $0x2c8,%rsp
  mov    %rsi,0x20(%rsp)
  lea    0xb0(%rsp),%rbp
  sub    $0x8,%rsp
  mov    $0x50,%esi
  mov    %rdi,0x20(%rsp)
  mov    %rbp,%r9
  mov    %rbp,%r14
  mov    %fs:0x28,%rax
  mov    %rax,0x2c0(%rsp)
  xor    %eax,%eax
  mov    %rbp,0x30(%rsp)
  push   $0x80
  call   <PBKDF2_SHA256@plt>
  lea    0x40(%rsp),%rbx
  lea    0x2c0(%rsp),%rax
  mov    %rbx,0x18(%rsp)
  mov    %rbx,%r12
  mov    %rax,0x20(%rsp)
  pop    %rcx
  pop    %rsi
L18:
  mov    %rbp,%rdi
  add    $0x4,%r12
  add    $0x10,%rbp
  call   <le32dec@plt>
  mov    %eax,-0x4(%r12)
  cmp    0x10(%rsp),%rbp
  jne    L18
  lea    0x20000(%r13),%r12
  mov    %r13,%r15
  lea    0x70(%rsp),%rbp
  nopl   (%rax)
L81:
  mov    $0x80,%edx
  mov    %r15,%rdi
  mov    %rbx,%rsi
  sub    $0xffffffffffffff80,%r15
  call   <memcpy@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <xor_salsa8@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <xor_salsa8@plt>
  cmp    %r12,%r15
  jne    L81
  mov    $0x400,%r12d
  lea    0x80(%rbx),%r15
  jmp    L87
  nopl   0x0(%rax)
L57:
  movdqu (%rax),%xmm0
  pxor   0x30(%rsp),%xmm0
  movaps %xmm0,0x30(%rsp)
  movdqu 0x10(%rax),%xmm0
  pxor   0x40(%rsp),%xmm0
  movaps %xmm0,0x40(%rsp)
  movdqu 0x20(%rax),%xmm0
  pxor   0x50(%rsp),%xmm0
  movaps %xmm0,0x50(%rsp)
  movdqu 0x30(%rax),%xmm0
  pxor   0x60(%rsp),%xmm0
  movaps %xmm0,0x60(%rsp)
  movdqu 0x40(%rax),%xmm0
  pxor   0x70(%rsp),%xmm0
  movaps %xmm0,0x70(%rsp)
  movdqu 0x50(%rax),%xmm0
  pxor   0x80(%rsp),%xmm0
  movaps %xmm0,0x80(%rsp)
  movdqu 0x60(%rax),%xmm0
  pxor   0x90(%rsp),%xmm0
  movaps %xmm0,0x90(%rsp)
  movdqu 0x70(%rax),%xmm0
  pxor   0xa0(%rsp),%xmm0
  movaps %xmm0,0xa0(%rsp)
L64:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <xor_salsa8@plt>
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <xor_salsa8@plt>
  sub    $0x1,%r12d
  je     L83
L87:
  mov    0x70(%rsp),%edx
  mov    %rbx,%rsi
  and    $0x3ff,%edx
  shl    $0x7,%rdx
  lea    0x0(%r13,%rdx,1),%rax
  lea    0x4(%rax),%rdi
  sub    %rdi,%rsi
  cmp    $0x8,%rsi
  ja     L57
  sub    %rbx,%rdx
  mov    %rbx,%rax
  add    %r13,%rdx
  nopl   (%rax)
L35:
  mov    (%rax,%rdx,1),%esi
  xor    %esi,(%rax)
  add    $0x4,%rax
  cmp    %r15,%rax
  jne    L35
  jmp    L64
L83:
  mov    0x8(%rsp),%rbx
  mov    %r14,%rdi
  add    $0x10,%r14
  mov    (%rbx),%esi
  call   <le32enc@plt>
  mov    %rbx,%rax
  add    $0x4,%rax
  mov    %rax,0x8(%rsp)
  cmp    0x10(%rsp),%r14
  jne    L83
  sub    $0x8,%rsp
  mov    $0x1,%r8d
  mov    $0x80,%ecx
  mov    $0x50,%esi
  push   $0x20
  mov    0x30(%rsp),%r9
  mov    0x38(%rsp),%rdx
  mov    0x28(%rsp),%rdi
  call   <PBKDF2_SHA256@plt>
  pop    %rax
  pop    %rdx
  mov    0x2b8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L44
  add    $0x2c8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L44:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void scrypt_1024_1_1_256_sp(const char *input, char *output, char *scratchpad) {
  uint8_t B[128];
  uint32_t X[32];
  uint32_t *V;
  uint32_t i, j, k;
  V = (uint32_t *)(((uintptr_t)(scratchpad) + 63) & ~(uintptr_t)(63));
  PBKDF2_SHA256((const uint8_t *)input, 80, (const uint8_t *)input, 80, 1, B, 128);
  for (k = 0; k < 32; k++)
    X[k] = le32dec(&B[4 * k]);
  for (i = 0; i < 1024; i++) {
    memcpy(&V[i * 32], X, 128);
    xor_salsa8(&X[0], &X[16]);
    xor_salsa8(&X[16], &X[0]);
  }
  for (i = 0; i < 1024; i++) {
    j = 32 * (X[16] & 1023);
    for (k = 0; k < 32; k++)
      X[k] ^= V[j + k];
    xor_salsa8(&X[0], &X[16]);
    xor_salsa8(&X[16], &X[0]);
  }
  for (k = 0; k < 32; k++)
    le32enc(&B[4 * k], X[k]);
  PBKDF2_SHA256((const uint8_t *)input, 80, B, 128, 1, (uint8_t *)output, 32);
}
```