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

```asm
<compute_all_permutations>:
  endbr64
  push   %r15
  lea    -0x1(%rdi),%eax
  push   %r14
  mov    %rsi,%r14
  push   %r13
  push   %r12
  mov    %edi,%r12d
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %eax,0x14(%rsp)
  test   %edi,%edi
  jle    L24
  cmp    $0x2,%eax
  jbe    L110
  mov    %edi,%edx
  movdqa D3(%rip),%xmm0
  movdqa D5(%rip),%xmm2
  mov    %rsi,%rax
  shr    $0x2,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rsi,%rdx,1),%rdx
  nopl   0x0(%rax,%rax,1)
L38:
  movdqa %xmm0,%xmm1
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  movups %xmm1,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L38
  mov    %r12d,%edx
  and    $0xfffffffc,%edx
  lea    0x1(%rdx),%eax
  cmp    %edx,%r12d
  je     L24
L158:
  movslq %eax,%rdx
  lea    0x1(%rax),%ecx
  lea    0x0(,%rdx,4),%rsi
  mov    %eax,-0x4(%r14,%rsi,1)
  cmp    %ecx,%r12d
  jl     L24
  add    $0x2,%eax
  mov    %ecx,(%r14,%rdx,4)
  cmp    %eax,%r12d
  jl     L24
  mov    %eax,0x4(%r14,%rsi,1)
L24:
  movslq %r12d,%rax
  movslq 0x14(%rsp),%rbx
  movl   $0x1,0x28(%rsp)
  lea    0x0(,%rax,4),%rcx
  mov    %rax,0x20(%rsp)
  lea    -0x2(%r12),%eax
  mov    %eax,0x2c(%rsp)
  cltq
  mov    %rbx,%rdi
  lea    (%rcx,%rax,4),%rbp
  mov    %rbx,0x80(%rsp)
  shl    $0x2,%rbx
  lea    (%r14,%rbp,1),%rax
  mov    %rbx,0x40(%rsp)
  mov    %rax,0x18(%rsp)
  lea    -0x4(%rcx),%rax
  cmp    $0x8,%rax
  mov    %rcx,0x8(%rsp)
  seta   %dl
  cmp    $0x2,%edi
  seta   %al
  and    %eax,%edx
  mov    %r12d,%eax
  shr    $0x2,%eax
  mov    %dl,0x33(%rsp)
  lea    -0x1(%rax),%ebx
  add    $0x1,%rbx
  shl    $0x4,%rbx
  mov    %rbx,0x38(%rsp)
  mov    %r12d,%ebx
  and    $0xfffffffc,%ebx
  movslq %ebx,%rax
  lea    0x1(%rbx),%ecx
  mov    %ebx,0x34(%rsp)
  shl    $0x2,%rax
  mov    %ecx,0x60(%rsp)
  mov    %rax,0x48(%rsp)
  lea    (%r12,%rbx,1),%eax
  add    $0x2,%ebx
  cltq
  mov    %ebx,0x64(%rsp)
  shl    $0x2,%rax
  mov    %rax,0x50(%rsp)
  movslq %ecx,%rax
  shl    $0x2,%rax
  mov    %rax,0x68(%rsp)
  lea    (%r12,%rcx,1),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,0x58(%rsp)
  movslq %ebx,%rax
  shl    $0x2,%rax
  mov    %rax,0x78(%rsp)
  lea    (%r12,%rbx,1),%eax
  cltq
  shl    $0x2,%rax
  mov    %rax,0x70(%rsp)
  mov    %edi,%eax
  add    $0x1,%rax
  mov    %rax,0x88(%rsp)
L69:
  mov    %r12d,%edi
  call   <factorial@plt>
  cmp    0x28(%rsp),%eax
  jle    L95
  test   %r12d,%r12d
  jle    L50
  cmpb   $0x0,0x33(%rsp)
  je     L42
  mov    0x8(%rsp),%rax
  mov    0x38(%rsp),%rdx
  lea    (%r14,%rax,1),%r13
  xor    %eax,%eax
  nopl   0x0(%rax)
L230:
  movdqu (%r14,%rax,1),%xmm3
  movups %xmm3,0x0(%r13,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L230
  cmp    0x34(%rsp),%r12d
  je     L245
  mov    0x48(%rsp),%rax
  mov    0x50(%rsp),%rcx
  mov    (%r14,%rax,1),%eax
  mov    %eax,(%r14,%rcx,1)
  cmp    0x60(%rsp),%r12d
  jle    L245
  mov    0x68(%rsp),%rax
  mov    0x58(%rsp),%rdi
  mov    (%r14,%rax,1),%eax
  mov    %eax,(%r14,%rdi,1)
  cmp    0x64(%rsp),%r12d
  jle    L245
  mov    0x78(%rsp),%rax
  mov    0x70(%rsp),%rcx
  mov    (%r14,%rax,1),%eax
  mov    %eax,(%r14,%rcx,1)
L245:
  mov    0x18(%rsp),%rcx
  mov    0x2c(%rsp),%r15d
  mov    %r13,%r14
  mov    (%rcx),%edx
  mov    %rcx,%rdi
  test   %r15d,%r15d
  js     L209
  mov    0x20(%rsp),%rdi
  mov    %rcx,%rax
  sub    0x8(%rsp),%rax
  mov    0x4(%rax,%rdi,4),%esi
  mov    %rcx,%rax
  jmp    L4
  nopl   (%rax)
L278:
  sub    $0x4,%rax
  test   %r15d,%r15d
  je     L95
  sub    $0x1,%r15d
  mov    %edx,%esi
L4:
  mov    (%rax),%edx
  mov    %rax,%rdi
  cmp    %esi,%edx
  jge    L278
L209:
  mov    0x40(%rsp),%rax
  lea    0x0(%r13,%rax,1),%r9
  cmp    %edx,0x0(%r13,%rax,1)
  jg     L163
  mov    0x14(%rsp),%esi
  test   %esi,%esi
  js     L95
  lea    -0x4(%r13,%rax,1),%rax
  jmp    L235
L101:
  sub    $0x4,%rax
  cmp    $0xffffffff,%esi
  je     L95
L235:
  sub    $0x1,%esi
  mov    %rax,%r9
  cmp    %edx,(%rax)
  jle    L101
L163:
  mov    %r9,%rsi
  lea    0x1(%r15),%ebx
  call   <swap@plt>
  cmp    %ebx,0x14(%rsp)
  jle    L226
  movslq %ebx,%rax
  lea    0x0(%r13,%rax,4),%rbp
  movslq %r15d,%rax
  add    0x80(%rsp),%rax
  lea    0x0(%r13,%rax,2),%rax
  lea    0x4(%rax,%rax,1),%r13
  nopw   0x0(%rax,%rax,1)
L16:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  add    $0x1,%ebx
  sub    %rbp,%rsi
  add    $0x4,%rbp
  call   <swap@plt>
  mov    %r12d,%eax
  sub    %ebx,%eax
  add    %r15d,%eax
  cmp    %eax,%ebx
  jl     L16
L226:
  mov    0x8(%rsp),%rdi
  addl   $0x1,0x28(%rsp)
  add    %rdi,0x18(%rsp)
  jmp    L69
  nopl   (%rax)
L95:
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L42:
  mov    0x88(%rsp),%rcx
  mov    0x20(%rsp),%rsi
  mov    %r14,%rax
  lea    (%r14,%rcx,4),%rcx
  nopl   0x0(%rax)
L264:
  mov    (%rax),%edx
  mov    %edx,(%rax,%rsi,4)
  add    $0x4,%rax
  cmp    %rcx,%rax
  jne    L264
L50:
  mov    0x8(%rsp),%rax
  lea    (%r14,%rax,1),%r13
  jmp    L245
L110:
  mov    $0x1,%eax
  jmp    L158
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D3
data_type: byte[16]
name: extract_symbolic_data
arguments: data_tag: D5
data_type: byte[16]

tool: {"D3": [0x01,0x00,0x00,0x00,0x02,0x00,0x00,0x00,0x03,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

tool: {"D5": [0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00,0x04,0x00,0x00,0x00]}

assistant: ```c
void compute_all_permutations(int n, int *res) {
  int i;
  int *curr = res;
  for (i = 1; i <= n; i++) {
    res[i - 1] = i;
  }
  int found = 1;
  while (found < factorial(n)) {
    int k;
    for (k = 0; k < n; k++) {
      curr[k + n] = curr[k];
    }
    curr += n;
    int j;
    for (j = n - 2; j >= 0 && curr[j] >= curr[j + 1]; j--) {
      if (j == 0) {
        return;
      }
    }
    int l;
    for (l = n - 1; curr[j] >= curr[l]; l--) {
      if (l < 0) {
        return;
      }
    }
    swap(&curr[j], &curr[l]);
    for (k = j + 1, l = n - 1; k < l;) {
      swap(&curr[k], &curr[l]);
      k++;
      l--;
    }
    found++;
  }
}
```