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

```asm
<scrypt_1024_1_1_256_sp>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x2d0,%rsp
  mov    %rdi,-0x2b8(%rbp)
  mov    %rsi,-0x2c0(%rbp)
  mov    %rdx,-0x2c8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x2c8(%rbp),%rax
  add    $0x3f,%rax
  and    $0xffffffffffffffc0,%rax
  mov    %rax,-0x298(%rbp)
  lea    -0x210(%rbp),%rcx
  mov    -0x2b8(%rbp),%rdx
  mov    -0x2b8(%rbp),%rax
  sub    $0x8,%rsp
  push   $0x80
  mov    %rcx,%r9
  mov    $0x1,%r8d
  mov    $0x50,%ecx
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <PBKDF2_SHA256@plt>
  add    $0x10,%rsp
  movl   $0x0,-0x2a0(%rbp)
  jmp    L42
L33:
  mov    -0x2a0(%rbp),%eax
  shl    $0x2,%eax
  lea    -0x210(%rbp),%rdx
  cltq
  shl    $0x2,%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  call   <le32dec@plt>
  mov    -0x2a0(%rbp),%edx
  movslq %edx,%rdx
  mov    %eax,-0x290(%rbp,%rdx,4)
  addl   $0x1,-0x2a0(%rbp)
L42:
  cmpl   $0x1f,-0x2a0(%rbp)
  jle    L33
  movl   $0x0,-0x2a4(%rbp)
  jmp    L100
L86:
  mov    -0x2a4(%rbp),%eax
  shl    $0x5,%eax
  cltq
  lea    0x0(,%rax,4),%rdx
  mov    -0x298(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  lea    -0x290(%rbp),%rax
  mov    $0x80,%edx
  mov    %rax,%rsi
  mov    %rcx,%rdi
  call   <memcpy@plt>
  lea    -0x290(%rbp),%rax
  lea    0x40(%rax),%rdx
  lea    -0x290(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <xor_salsa8@plt>
  lea    -0x290(%rbp),%rax
  lea    -0x290(%rbp),%rdx
  add    $0x40,%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <xor_salsa8@plt>
  addl   $0x1,-0x2a4(%rbp)
L100:
  cmpl   $0x3ff,-0x2a4(%rbp)
  jle    L86
  movl   $0x0,-0x2a4(%rbp)
  jmp    L29
L36:
  mov    -0x250(%rbp),%eax
  and    $0x3ff,%eax
  shl    $0x5,%eax
  mov    %eax,-0x29c(%rbp)
  movl   $0x0,-0x2a0(%rbp)
  jmp    L9
L47:
  mov    -0x2a0(%rbp),%eax
  cltq
  mov    -0x290(%rbp,%rax,4),%edx
  mov    -0x29c(%rbp),%ecx
  mov    -0x2a0(%rbp),%eax
  add    %ecx,%eax
  cltq
  lea    0x0(,%rax,4),%rcx
  mov    -0x298(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%eax
  xor    %eax,%edx
  mov    -0x2a0(%rbp),%eax
  cltq
  mov    %edx,-0x290(%rbp,%rax,4)
  addl   $0x1,-0x2a0(%rbp)
L9:
  cmpl   $0x1f,-0x2a0(%rbp)
  jle    L47
  lea    -0x290(%rbp),%rax
  lea    0x40(%rax),%rdx
  lea    -0x290(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <xor_salsa8@plt>
  lea    -0x290(%rbp),%rax
  lea    -0x290(%rbp),%rdx
  add    $0x40,%rdx
  mov    %rax,%rsi
  mov    %rdx,%rdi
  call   <xor_salsa8@plt>
  addl   $0x1,-0x2a4(%rbp)
L29:
  cmpl   $0x3ff,-0x2a4(%rbp)
  jle    L36
  movl   $0x0,-0x2a0(%rbp)
  jmp    L57
L105:
  mov    -0x2a0(%rbp),%eax
  cltq
  mov    -0x290(%rbp,%rax,4),%eax
  mov    -0x2a0(%rbp),%edx
  shl    $0x2,%edx
  lea    -0x210(%rbp),%rcx
  movslq %edx,%rdx
  shl    $0x2,%rdx
  add    %rcx,%rdx
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <le32enc@plt>
  addl   $0x1,-0x2a0(%rbp)
L57:
  cmpl   $0x1f,-0x2a0(%rbp)
  jle    L105
  mov    -0x2c0(%rbp),%rcx
  lea    -0x210(%rbp),%rdx
  mov    -0x2b8(%rbp),%rax
  sub    $0x8,%rsp
  push   $0x20
  mov    %rcx,%r9
  mov    $0x1,%r8d
  mov    $0x80,%ecx
  mov    $0x50,%esi
  mov    %rax,%rdi
  call   <PBKDF2_SHA256@plt>
  add    $0x10,%rsp
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L52
  call   <__stack_chk_fail@plt>
L52:
  leave
  ret
```

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);
}
```