user: Demonstrate the C code that generates the assembly output below:

```asm
<cpu_percentages>:
  endbr64
  push   %rbp
  mov    %rsi,%r9
  mov    %rdx,%rsi
  mov    %rcx,%rdx
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  movslq %edi,%rax
  mov    %rsp,%r8
  lea    0xf(,%rax,4),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%r8
  and    $0xfffffffffffffff0,%rcx
  cmp    %r8,%rsp
  je     L181
L57:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %r8,%rsp
  jne    L57
L181:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L170
L56:
  mov    %rsp,%rcx
  test   %edi,%edi
  jle    L141
  lea    0x4(%rsi),%r8
  mov    %rdx,%rax
  lea    -0x1(%rdi),%r13d
  sub    %r8,%rax
  cmp    $0x8,%rax
  jbe    L67
  cmp    $0x2,%r13d
  jbe    L67
  mov    %edi,%r8d
  movdqa D23(%rip),%xmm4
  xor    %eax,%eax
  pxor   %xmm3,%xmm3
  shr    $0x2,%r8d
  shl    $0x4,%r8
  nopl   (%rax)
L11:
  movdqu (%rsi,%rax,1),%xmm1
  movdqu (%rdx,%rax,1),%xmm0
  movdqa %xmm1,%xmm5
  movdqa %xmm1,%xmm6
  movdqa %xmm0,%xmm2
  movups %xmm1,(%rdx,%rax,1)
  psubd  %xmm0,%xmm5
  psubd  %xmm4,%xmm6
  psubd  %xmm4,%xmm0
  psubd  %xmm1,%xmm2
  pcmpgtd %xmm6,%xmm0
  pand   %xmm0,%xmm2
  pandn  %xmm5,%xmm0
  por    %xmm2,%xmm0
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  paddd  %xmm0,%xmm3
  cmp    %r8,%rax
  jne    L11
  movdqa %xmm3,%xmm0
  mov    %edi,%r10d
  psrldq $0x8,%xmm0
  and    $0xfffffffc,%r10d
  paddd  %xmm0,%xmm3
  movdqa %xmm3,%xmm0
  psrldq $0x4,%xmm0
  paddd  %xmm0,%xmm3
  movd   %xmm3,%eax
  test   $0x3,%dil
  je     L171
  mov    %r10d,%r11d
  lea    0x0(,%r11,4),%r8
  mov    (%rsi,%r11,4),%r11d
  lea    (%rdx,%r8,1),%r13
  mov    0x0(%r13),%r12d
  mov    %r11d,%ebx
  mov    %r11d,0x0(%r13)
  mov    %r12d,%r14d
  sub    %r12d,%ebx
  sub    %r11d,%r14d
  cmp    %r12d,%r11d
  lea    (%rcx,%r8,1),%r12
  cmovb  %r14d,%ebx
  lea    0x1(%r10),%r11d
  mov    %ebx,(%r12)
  add    %ebx,%eax
  cmp    %r11d,%edi
  jle    L171
  lea    0x4(%rdx,%r8,1),%r14
  mov    0x4(%rsi,%r8,1),%r11d
  mov    (%r14),%r13d
  mov    %r11d,%ebx
  mov    %r11d,(%r14)
  mov    %r13d,%r15d
  sub    %r13d,%ebx
  sub    %r11d,%r15d
  cmp    %r13d,%r11d
  cmovb  %r15d,%ebx
  add    $0x2,%r10d
  mov    %ebx,0x4(%r12)
  add    %ebx,%eax
  cmp    %r10d,%edi
  jle    L171
  lea    0x8(%rdx,%r8,1),%r10
  mov    0x8(%rsi,%r8,1),%esi
  mov    (%r10),%r8d
  mov    %esi,%r11d
  mov    %esi,(%r10)
  mov    %r8d,%edx
  sub    %r8d,%r11d
  sub    %esi,%edx
  cmp    %r8d,%esi
  cmovae %r11d,%edx
  mov    %edx,0x8(%r12)
  add    %edx,%eax
L171:
  test   %eax,%eax
  mov    $0x1,%edx
  pxor   %xmm7,%xmm7
  cmovne %eax,%edx
  mov    %edx,%eax
  cvtsi2sd %rax,%xmm7
  mov    %rax,%r8
L142:
  mov    %edi,%edx
  movapd %xmm7,%xmm6
  movapd D20(%rip),%xmm5
  xor    %eax,%eax
  shr    $0x2,%edx
  movapd D21(%rip),%xmm4
  unpcklpd %xmm6,%xmm6
  pxor   %xmm3,%xmm3
  movapd D25(%rip),%xmm2
  shl    $0x4,%rdx
  xchg   %ax,%ax
L99:
  cvtdq2pd (%rcx,%rax,1),%xmm1
  movapd %xmm1,%xmm0
  cmpltpd %xmm3,%xmm0
  andpd  %xmm5,%xmm0
  addpd  %xmm0,%xmm1
  movdqu (%rcx,%rax,1),%xmm0
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  divpd  %xmm6,%xmm1
  movapd %xmm0,%xmm8
  cmpltpd %xmm3,%xmm8
  andpd  %xmm5,%xmm8
  addpd  %xmm8,%xmm0
  movapd %xmm2,%xmm8
  divpd  %xmm6,%xmm0
  mulpd  %xmm4,%xmm1
  cmplepd %xmm1,%xmm8
  movapd %xmm8,%xmm10
  movdqa %xmm8,%xmm9
  movapd %xmm2,%xmm8
  andpd  %xmm2,%xmm10
  pslld  $0x1f,%xmm9
  subpd  %xmm10,%xmm1
  cvttpd2dq %xmm1,%xmm1
  mulpd  %xmm4,%xmm0
  cmplepd %xmm0,%xmm8
  movapd %xmm8,%xmm10
  pslld  $0x1f,%xmm8
  andpd  %xmm2,%xmm10
  subpd  %xmm10,%xmm0
  cvttpd2dq %xmm0,%xmm0
  punpcklqdq %xmm0,%xmm1
  movdqa %xmm9,%xmm0
  shufps $0x88,%xmm8,%xmm0
  pxor   %xmm1,%xmm0
  movups %xmm0,(%r9,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L99
  mov    %edi,%eax
  and    $0xfffffffc,%eax
  test   $0x3,%dil
  je     L151
L196:
  movslq %eax,%rsi
  pxor   %xmm0,%xmm0
  movsd  D21(%rip),%xmm1
  lea    0x0(,%rsi,4),%rdx
  add    %rdx,%rcx
  mov    (%rcx),%r10d
  cvtsi2sd %r10,%xmm0
  divsd  %xmm7,%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%r10
  mov    %r10d,(%r9,%rsi,4)
  lea    0x1(%rax),%esi
  cmp    %esi,%edi
  jle    L151
  mov    0x4(%rcx),%esi
  pxor   %xmm0,%xmm0
  add    $0x2,%eax
  cvtsi2sd %rsi,%xmm0
  divsd  %xmm7,%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rsi
  mov    %esi,0x4(%r9,%rdx,1)
  cmp    %edi,%eax
  jge    L151
  mov    0x8(%rcx),%eax
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  divsd  %xmm7,%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%rax
  mov    %eax,0x8(%r9,%rdx,1)
L151:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L159
  lea    -0x28(%rbp),%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L67:
  mov    %edi,%r14d
  xor    %eax,%eax
  xor    %ebx,%ebx
L185:
  mov    (%rsi,%rax,4),%r8d
  mov    (%rdx,%rax,4),%r11d
  mov    %r8d,%r10d
  mov    %r11d,%r12d
  mov    %r8d,(%rdx,%rax,4)
  sub    %r8d,%r12d
  sub    %r11d,%r10d
  cmp    %r8d,%r11d
  cmova  %r12d,%r10d
  mov    %r10d,(%rcx,%rax,4)
  add    $0x1,%rax
  add    %r10d,%ebx
  cmp    %r14,%rax
  jne    L185
  test   %ebx,%ebx
  mov    $0x1,%eax
  pxor   %xmm7,%xmm7
  cmovne %ebx,%eax
  mov    %eax,%r8d
  mov    %eax,%eax
  cvtsi2sd %rax,%xmm7
  cmp    $0x2,%r13d
  ja     L142
  xor    %eax,%eax
  jmp    L196
  nop
L170:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L56
L141:
  mov    $0x1,%r8d
  jmp    L151
L159:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D23
type_infered: byte[16]
name: extract_symbolic_data
arguments: data_tag: D20
type_infered: byte[16]
name: extract_symbolic_data
arguments: data_tag: D21
type_infered: byte[16]
name: extract_symbolic_data
arguments: data_tag: D25
type_infered: byte[16]

tool: {"D23": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x80]}

tool: {"D20": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x41]}

tool: {"D21": [0x00,0x00,0x00,0x00,0x00,0x40,0x8f,0x40,0x00,0x00,0x00,0x00,0x00,0x40,0x8f,0x40]}

tool: {"D25": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x41,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x41]}

assistant: ```c
unsigned int cpu_percentages(int cnt, unsigned int *percent, unsigned int *new, unsigned int *old) {
  int i;
  unsigned int diff[cnt];
  unsigned int total;
  total = 0;
  for (i = 0; i < cnt; i++) {
    if (new[i] < old[i]) {
      diff[i] = old[i] - new[i];
    } else {
      diff[i] = new[i] - old[i];
    }
    total += diff[i];
    old[i] = new[i];
  }
  if (0 == total) {
    total = 1;
  }
  for (i = 0; i < cnt; i++) {
    percent[i] = (unsigned)((double)diff[i] / total * 1000);
  }
  return total;
}
```