user: What is the c source code of the assembly code below?

```asm
<perm>:
  endbr64
  push   %r13
  push   %r12
  mov    %esi,%r12d
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x2,%esi
  js     L161
  lea    -0x1(%r12),%ecx
  cmp    $0x2,%esi
  jbe    L252
  mov    %ecx,%edx
  mov    %rdi,%rax
  pxor   %xmm1,%xmm1
  movdqa D42(%rip),%xmm3
  shr    $0x2,%edx
  movdqa D43(%rip),%xmm5
  movdqa D41(%rip),%xmm7
  pcmpeqd %xmm4,%xmm4
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rdi,%rdx,1),%rdx
  nopw   0x0(%rax,%rax,1)
L105:
  movdqu (%rax),%xmm6
  movdqu 0x4(%rax),%xmm0
  movdqa %xmm3,%xmm2
  add    $0x10,%rax
  paddd  %xmm5,%xmm3
  pcmpgtd %xmm6,%xmm0
  movdqa %xmm0,%xmm6
  pand   %xmm0,%xmm2
  pandn  %xmm7,%xmm0
  pandn  %xmm4,%xmm6
  paddd  %xmm0,%xmm1
  movdqa %xmm6,%xmm4
  por    %xmm2,%xmm4
  cmp    %rax,%rdx
  jne    L105
  movdqa %xmm1,%xmm0
  xor    %r13d,%r13d
  psrldq $0x8,%xmm0
  paddd  %xmm0,%xmm1
  movdqa %xmm1,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm1
  movdqa %xmm4,%xmm0
  psrldq $0x8,%xmm0
  movd   %xmm1,%eax
  movdqa %xmm0,%xmm1
  pcmpgtd %xmm4,%xmm1
  pand   %xmm1,%xmm0
  pandn  %xmm4,%xmm1
  por    %xmm0,%xmm1
  movdqa %xmm1,%xmm2
  psrldq $0x4,%xmm2
  movdqa %xmm2,%xmm0
  pcmpgtd %xmm1,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm1,%xmm0
  por    %xmm2,%xmm0
  movd   %xmm0,%edx
  cmp    $0xffffffff,%edx
  cmovne %edx,%r13d
  mov    %ecx,%edx
  and    $0xfffffffc,%edx
  test   $0x3,%cl
  je     L102
L75:
  movslq %edx,%r9
  lea    0x0(,%r9,4),%rdi
  mov    0x4(%rbp,%rdi,1),%r10d
  cmp    %r10d,0x0(%rbp,%r9,4)
  jl     L201
  add    $0x1,%eax
L243:
  lea    0x1(%rdx),%r9d
  cmp    %r9d,%esi
  jl     L102
  mov    0x8(%rbp,%rdi,1),%r11d
  cmp    %r11d,%r10d
  jl     L50
  add    $0x1,%eax
  mov    %r13d,%r9d
L50:
  lea    0x2(%rdx),%r13d
  cmp    %r13d,%esi
  jl     L239
  cmp    %r11d,0xc(%rbp,%rdi,1)
  jg     L102
  add    $0x1,%eax
L239:
  mov    %r9d,%r13d
L102:
  mov    $0x1,%r9d
  cmp    %eax,%ecx
  jle    L37
  lea    0x1(%r13),%ecx
  cmp    %ecx,%r12d
  jle    L257
  movslq %r13d,%rax
  mov    0x0(%rbp,%rax,4),%edi
  lea    0x0(,%rax,4),%rdx
  mov    %r12d,%eax
  sub    %r13d,%eax
  lea    -0x1(%rax),%r9d
  sub    $0x2,%eax
  cmp    $0x6,%eax
  jbe    L131
  movd   %r13d,%xmm7
  pxor   %xmm4,%xmm4
  movd   %edi,%xmm5
  mov    %r9d,%eax
  shr    $0x2,%eax
  lea    0x4(%rbp,%rdx,1),%rdx
  pshufd $0x0,%xmm7,%xmm2
  movdqa D49(%rip),%xmm3
  lea    -0x1(%rax),%esi
  lea    0x10(%rdx),%rax
  pshufd $0x0,%xmm5,%xmm9
  movdqa D43(%rip),%xmm5
  shl    $0x4,%rsi
  paddd  %xmm3,%xmm2
  movdqa %xmm4,%xmm1
  add    %rax,%rsi
  movdqa %xmm4,%xmm8
  jmp    L233
  nopw   0x0(%rax,%rax,1)
L82:
  add    $0x10,%rax
L233:
  movdqu (%rdx),%xmm0
  movdqa %xmm2,%xmm7
  mov    %rax,%rdx
  paddd  %xmm5,%xmm2
  pcmpgtd %xmm9,%xmm0
  pcmpeqd %xmm8,%xmm0
  movdqa %xmm0,%xmm6
  pand   %xmm0,%xmm4
  pand   %xmm0,%xmm1
  pandn  %xmm7,%xmm6
  pandn  %xmm3,%xmm0
  paddd  %xmm5,%xmm3
  por    %xmm6,%xmm4
  por    %xmm0,%xmm1
  cmp    %rax,%rsi
  jne    L82
  pshufd $0x55,%xmm1,%xmm0
  movd   %xmm1,%r10d
  movd   %xmm0,%edx
  movd   %xmm0,%eax
  movdqa %xmm1,%xmm0
  cmp    %edx,%r10d
  punpckhdq %xmm1,%xmm0
  cmovae %r10d,%eax
  movd   %xmm0,%esi
  cmp    %esi,%eax
  jb     L53
  pshufd $0x55,%xmm4,%xmm0
  movd   %xmm4,%r11d
  cmp    %edx,%r10d
  movd   %xmm0,%r8d
  cmovae %r11d,%r8d
L77:
  pshufd $0xff,%xmm1,%xmm1
  pshufd $0xff,%xmm4,%xmm0
  cmp    %esi,%eax
  cmovae %eax,%esi
  movd   %xmm1,%eax
  movd   %xmm0,%edx
  cmp    %eax,%esi
  mov    %r9d,%eax
  cmovb  %edx,%r8d
  and    $0xfffffffc,%eax
  add    %eax,%ecx
  cmp    %eax,%r9d
  je     L257
L131:
  movslq %ecx,%rdx
  cmp    %edi,0x0(%rbp,%rdx,4)
  lea    0x0(,%rdx,4),%rax
  lea    0x1(%rcx),%edx
  cmovg  %ecx,%r8d
  cmp    %r12d,%edx
  jge    L257
  cmp    0x4(%rbp,%rax,1),%edi
  cmovl  %edx,%r8d
  lea    0x2(%rcx),%edx
  cmp    %r12d,%edx
  jge    L257
  cmp    0x8(%rbp,%rax,1),%edi
  cmovl  %edx,%r8d
  lea    0x3(%rcx),%edx
  cmp    %edx,%r12d
  jle    L257
  cmp    0xc(%rbp,%rax,1),%edi
  cmovl  %edx,%r8d
  lea    0x4(%rcx),%edx
  cmp    %edx,%r12d
  jle    L257
  cmp    0x10(%rbp,%rax,1),%edi
  cmovl  %edx,%r8d
  lea    0x5(%rcx),%edx
  cmp    %edx,%r12d
  jle    L257
  cmp    0x14(%rbp,%rax,1),%edi
  cmovl  %edx,%r8d
  add    $0x6,%ecx
  cmp    %ecx,%r12d
  jle    L257
  cmp    0x18(%rbp,%rax,1),%edi
  cmovl  %ecx,%r8d
L257:
  mov    %r8d,%edx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  call   <swap@plt>
  mov    %r13d,%edx
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <reverse@plt>
  mov    %r12d,%esi
  mov    %rbp,%rdi
  call   <printv@plt>
  xor    %r9d,%r9d
L37:
  pop    %rbp
  mov    %r9d,%eax
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L201:
  mov    %edx,%r13d
  jmp    L243
L53:
  movdqa %xmm4,%xmm0
  punpckhdq %xmm4,%xmm0
  movd   %xmm0,%r8d
  jmp    L77
  nopw   0x0(%rax,%rax,1)
L161:
  xor    %eax,%eax
  lea    -0x1(%r12),%ecx
  jmp    L102
L252:
  xor    %eax,%eax
  xor    %edx,%edx
  jmp    L75
```

tool_calls: name: extract_symbolic_data
arguments: tag: D42
type: byte[16]
name: extract_symbolic_data
arguments: tag: D43
type: byte[16]
name: extract_symbolic_data
arguments: tag: D41
type: byte[16]
name: extract_symbolic_data
arguments: tag: D49
type: byte[16]

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

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

tool: {"D41": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

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

assistant: ```c
int perm(int p[], int n) {
  int l, k, i, counter = 0, t = n - 2;
  for (i = 0; i <= t; i++) {
    if (p[i] < p[i + 1])
      k = i;
    else
      counter++;
  }
  if (counter > n - 2)
    return 1;
  t = n - 1;
  for (i = k + 1; i < n; i++) {
    if (p[k] < p[i])
      l = i;
  }
  swap(p, k, l);
  reverse(p, n, k);
  printv(p, n);
  return 0;
}
```