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

```asm
<setlabptn>:
  endbr64
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  movslq %ecx,%r12
  push   %rbp
  lea    -0x1(%r12),%r14d
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  test   %r12d,%r12d
  jle    L75
  cmp    $0x2,%r14d
  jbe    L12
  mov    %r12d,%edx
  movdqa D25(%rip),%xmm0
  movdqa D9(%rip),%xmm2
  mov    %rsi,%rax
  shr    $0x2,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%rsi,%rdx,1),%rdx
  nopl   0x0(%rax)
L199:
  movdqa %xmm0,%xmm1
  add    $0x10,%rax
  paddd  %xmm2,%xmm0
  movups %xmm1,-0x10(%rax)
  cmp    %rax,%rdx
  jne    L199
  mov    %r12d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r12b
  je     L75
L92:
  movslq %eax,%rdx
  mov    %eax,(%rbx,%rdx,4)
  lea    0x0(,%rdx,4),%rcx
  lea    0x1(%rax),%edx
  cmp    %r12d,%edx
  jge    L75
  add    $0x2,%eax
  mov    %edx,0x4(%rbx,%rcx,1)
  cmp    %r12d,%eax
  jge    L75
  mov    %eax,0x8(%rbx,%rcx,1)
L75:
  test   %rbp,%rbp
  je     L152
  mov    %rbp,%rsi
  mov    %r12d,%edx
  mov    %rbx,%rdi
  call   <sortwt@plt>
  lea    -0x2(%r12),%esi
  xor    %eax,%eax
  test   %r14d,%r14d
  jg     L124
L13:
  movl   $0x0,-0x4(%r13,%r12,4)
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L86:
  movl   $0x0,0x0(%r13,%rax,4)
  lea    0x1(%rax),%rdx
  cmp    %rax,%rsi
  je     L13
L71:
  mov    %rdx,%rax
L124:
  movslq (%rbx,%rax,4),%rdx
  movslq 0x4(%rbx,%rax,4),%rcx
  mov    0x0(%rbp,%rdx,4),%edi
  cmp    %edi,0x0(%rbp,%rcx,4)
  jne    L86
  movl   $0x1,0x0(%r13,%rax,4)
  lea    0x1(%rax),%rdx
  cmp    %rax,%rsi
  jne    L71
  jmp    L13
  nopl   0x0(%rax)
L152:
  test   %r14d,%r14d
  jle    L13
  lea    -0x2(%r12),%eax
  cmp    $0x2,%eax
  jbe    L163
  mov    %r14d,%edx
  movdqa D10(%rip),%xmm0
  mov    %r13,%rax
  shr    $0x2,%edx
  sub    $0x1,%edx
  shl    $0x4,%rdx
  lea    0x10(%r13,%rdx,1),%rdx
L58:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L58
  mov    %r14d,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%r14b
  je     L13
L49:
  movslq %eax,%rdx
  movl   $0x1,0x0(%r13,%rdx,4)
  lea    0x0(,%rdx,4),%rcx
  lea    0x1(%rax),%edx
  cmp    %edx,%r14d
  jle    L13
  movl   $0x1,0x4(%r13,%rcx,1)
  add    $0x2,%eax
  cmp    %eax,%r14d
  jle    L13
  movl   $0x1,0x8(%r13,%rcx,1)
  jmp    L13
L12:
  xor    %eax,%eax
  jmp    L92
L163:
  xor    %eax,%eax
  jmp    L49
```

tool_calls: name: retrieve_data
arguments: data_tag: D25
data_type: byte[16]
name: retrieve_data
arguments: data_tag: D9
data_type: byte[16]
name: retrieve_data
arguments: data_tag: D10
data_type: byte[16]

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

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

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

assistant: ```c
void setlabptn(int *weight, int *lab, int *ptn, int n) {
  int i;
  for (i = 0; i < n; ++i)
    lab[i] = i;
  if (weight) {
    sortwt(lab, weight, n);
    for (i = 0; i < n - 1; ++i) {
      if (weight[lab[i]] != weight[lab[i + 1]])
        ptn[i] = 0;
      else
        ptn[i] = 1;
    }
    ptn[n - 1] = 0;
  } else {
    for (i = 0; i < n - 1; ++i)
      ptn[i] = 1;
    ptn[n - 1] = 0;
  }
}
```