user: 请从给定的汇编指令推导出C源代码：

```asm
<btea>:
  endbr64
  push   %r13
  mov    %rdi,%r8
  mov    %rdx,%r11
  push   %r12
  push   %rbp
  push   %rbx
  cmp    $0x1,%esi
  jle    L52
  movslq %esi,%rax
  lea    -0x1(%rsi),%ebx
  xor    %r10d,%r10d
  lea    -0x4(%rdi,%rax,4),%r12
  mov    %rbx,%rbp
  mov    (%r12),%edx
  xchg   %ax,%ax
L0:
  sub    $0x61c88647,%r10d
  xor    %ecx,%ecx
  mov    %r10d,%r9d
  sar    $0x2,%r9d
L45:
  mov    %r9d,%esi
  mov    0x4(%r8,%rcx,4),%eax
  xor    %ecx,%esi
  and    $0x3,%esi
  lea    0x0(,%rax,4),%r13d
  mov    (%r11,%rsi,4),%edi
  xor    %edx,%edi
  mov    %edi,%esi
  mov    %eax,%edi
  sar    $0x3,%eax
  xor    %r10d,%edi
  add    %edi,%esi
  mov    %edx,%edi
  shl    $0x4,%edx
  sar    $0x5,%edi
  xor    %edx,%eax
  mov    (%r8,%rcx,4),%edx
  xor    %r13d,%edi
  add    %edi,%eax
  xor    %eax,%esi
  add    %esi,%edx
  mov    %edx,(%r8,%rcx,4)
  add    $0x1,%rcx
  cmp    %rcx,%rbx
  jne    L45
  xor    %ebp,%r9d
  mov    (%r8),%eax
  and    $0x3,%r9d
  mov    (%r11,%r9,4),%esi
  mov    %eax,%ecx
  lea    0x0(,%rax,4),%edi
  sar    $0x3,%eax
  xor    %r10d,%ecx
  xor    %edx,%esi
  add    %ecx,%esi
  mov    %edx,%ecx
  shl    $0x4,%edx
  sar    $0x5,%ecx
  xor    %edx,%eax
  xor    %edi,%ecx
  add    %ecx,%eax
  xor    %esi,%eax
  add    (%r12),%eax
  mov    %eax,(%r12)
  mov    %eax,%edx
  cmp    $0xb54cda56,%r10d
  jne    L0
L9:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L52:
  cmp    $0xffffffff,%esi
  jge    L9
  mov    %esi,%edx
  not    %esi
  mov    (%rdi),%eax
  neg    %edx
  movslq %esi,%r10
  movslq %edx,%rdx
  lea    -0x4(%rdi,%rdx,4),%rbx
  mov    $0xb54cda56,%edi
  nopl   (%rax)
L42:
  mov    %edi,%r9d
  mov    %r10,%rsi
  sar    $0x2,%r9d
  nopw   0x0(%rax,%rax,1)
L2:
  mov    %r9d,%edx
  mov    -0x4(%r8,%rsi,4),%ecx
  mov    %edi,%r12d
  xor    %esi,%edx
  xor    %eax,%r12d
  and    $0x3,%edx
  mov    (%r11,%rdx,4),%ebp
  mov    %ecx,%edx
  sar    $0x5,%edx
  xor    %ecx,%ebp
  shl    $0x4,%ecx
  lea    0x0(%rbp,%r12,1),%ebp
  lea    0x0(,%rax,4),%r12d
  sar    $0x3,%eax
  xor    %r12d,%edx
  xor    %ecx,%eax
  add    %edx,%eax
  mov    %ebp,%edx
  xor    %eax,%edx
  mov    (%r8,%rsi,4),%eax
  sub    %edx,%eax
  mov    %eax,(%r8,%rsi,4)
  sub    $0x1,%rsi
  test   %esi,%esi
  jne    L2
  mov    (%rbx),%ecx
  lea    0x0(,%rax,4),%esi
  and    $0x3,%r9d
  mov    %ecx,%edx
  mov    %ecx,%ebp
  xor    (%r11,%r9,4),%ecx
  sar    $0x5,%edx
  shl    $0x4,%ebp
  xor    %esi,%edx
  mov    %eax,%esi
  xor    %edi,%eax
  sar    $0x3,%esi
  add    %eax,%ecx
  mov    (%r8),%eax
  xor    %ebp,%esi
  add    %esi,%edx
  xor    %ecx,%edx
  sub    %edx,%eax
  mov    %eax,(%r8)
  add    $0x61c88647,%edi
  jne    L42
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

assistant: ```c
void btea(uint32_t *v, int8_t n, const uint32_t key[4]) {
  uint32_t y, z, sum;
  uint32_t p, rounds, e;
  if (n > 1) {
    rounds = 6;
    sum = 0;
    z = v[n - 1];
    do {
      sum += 0x9e3779b9;
      e = (sum >> 2) & 3;
      for (p = 0; p < n - 1; p++) {
        y = v[p + 1];
        z = v[p] += (((z >> 5 ^ y << 2) + (y >> 3 ^ z << 4)) ^ ((sum ^ y) + (key[(p & 3) ^ e] ^ z)));
      }
      y = v[0];
      z = v[n - 1] += (((z >> 5 ^ y << 2) + (y >> 3 ^ z << 4)) ^ ((sum ^ y) + (key[(p & 3) ^ e] ^ z)));
    } while (--rounds);
  } else if (n < -1) {
    n = -n;
    rounds = 6;
    sum = rounds * 0x9e3779b9;
    y = v[0];
    do {
      e = (sum >> 2) & 3;
      for (p = n - 1; p > 0; p--) {
        z = v[p - 1];
        y = v[p] -= (((z >> 5 ^ y << 2) + (y >> 3 ^ z << 4)) ^ ((sum ^ y) + (key[(p & 3) ^ e] ^ z)));
      }
      z = v[n - 1];
      y = v[0] -= (((z >> 5 ^ y << 2) + (y >> 3 ^ z << 4)) ^ ((sum ^ y) + (key[(p & 3) ^ e] ^ z)));
      sum -= 0x9e3779b9;
    } while (--rounds);
  }
}
```