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

```asm
<trapezoid>:
  endbr64
  test   %esi,%esi
  lea    0x3(%rsi),%r9d
  lea    (%rsi,%rsi,2),%eax
  mov    %esi,%edx
  cmovns %esi,%r9d
  lea    0x3(%rax),%esi
  pxor   %xmm0,%xmm0
  mov    %rdi,%r8
  movsd  D70(%rip),%xmm4
  sar    $0x2,%r9d
  test   %eax,%eax
  cmovns %eax,%esi
  lea    -0x1(%rdx),%eax
  movapd %xmm4,%xmm3
  cvtsi2sd %eax,%xmm0
  sar    $0x2,%esi
  mov    %esi,%edi
  divsd  %xmm0,%xmm3
  cmp    $0x3,%edx
  jle    L176
  cmp    $0xf,%edx
  jle    L158
  mov    %r9d,%ecx
  movapd %xmm3,%xmm6
  mov    %r8,%rax
  movdqa D8(%rip),%xmm2
  shr    $0x2,%ecx
  movdqa D32(%rip),%xmm5
  unpcklpd %xmm6,%xmm6
  sub    $0x1,%ecx
  shl    $0x5,%rcx
  lea    0x20(%r8,%rcx,1),%rcx
  nopl   0x0(%rax)
L10:
  movdqa %xmm2,%xmm0
  add    $0x20,%rax
  paddd  %xmm5,%xmm2
  cvtdq2pd %xmm0,%xmm1
  mulpd  %xmm6,%xmm1
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  mulpd  %xmm6,%xmm0
  movups %xmm1,-0x20(%rax)
  movups %xmm0,-0x10(%rax)
  cmp    %rax,%rcx
  jne    L10
  mov    %r9d,%eax
  and    $0xfffffffc,%eax
  mov    %eax,%ecx
  lea    (%r8,%rcx,8),%rcx
  cmp    %eax,%r9d
  je     L172
L40:
  pxor   %xmm0,%xmm0
  lea    0x1(%rax),%r10d
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %r10d,%r9d
  jle    L172
  pxor   %xmm0,%xmm0
  add    $0x2,%eax
  cvtsi2sd %r10d,%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,0x8(%rcx)
  cmp    %eax,%r9d
  jle    L172
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,0x10(%rcx)
L172:
  test   %r9d,%r9d
  lea    -0x1(%r9),%ecx
  mov    $0x1,%eax
  cmovg  %r9d,%eax
  lea    0x8(,%rcx,8),%rcx
  cmp    $0x3,%edx
  mov    $0x8,%r9d
  cmovle %r9,%rcx
  add    %r8,%rcx
  cmp    %eax,%esi
  jle    L8
L11:
  sub    %eax,%esi
  mov    %rcx,%rax
  cmp    $0x1,%esi
  je     L109
  mov    %esi,%r9d
  movapd D66(%rip),%xmm0
  shr    %r9d
  sub    $0x1,%r9d
  shl    $0x4,%r9
  lea    0x10(%rcx,%r9,1),%r9
L148:
  movups %xmm0,(%rax)
  add    $0x10,%rax
  cmp    %r9,%rax
  jne    L148
  mov    %esi,%r9d
  and    $0xfffffffe,%r9d
  mov    %r9d,%eax
  lea    (%rcx,%rax,8),%rax
  cmp    %r9d,%esi
  je     L33
L109:
  mov    D66(%rip),%r11
  mov    %r11,(%rax)
L33:
  lea    -0x1(%rsi),%eax
  lea    0x8(%rcx,%rax,8),%rcx
L71:
  cmp    %edi,%edx
  jle    L120
  mov    %edx,%r9d
  sub    %edi,%r9d
  lea    -0x1(%r9),%eax
  cmp    $0x2,%eax
  jbe    L7
  mov    %r9d,%esi
  movd   %edi,%xmm5
  movapd %xmm3,%xmm7
  mov    %rcx,%rax
  shr    $0x2,%esi
  pshufd $0x0,%xmm5,%xmm2
  movapd D70(%rip),%xmm6
  unpcklpd %xmm7,%xmm7
  sub    $0x1,%esi
  paddd  D8(%rip),%xmm2
  movdqa D32(%rip),%xmm5
  shl    $0x5,%rsi
  lea    0x20(%rcx,%rsi,1),%rsi
  nopw   0x0(%rax,%rax,1)
L49:
  movdqa %xmm2,%xmm0
  movapd %xmm6,%xmm8
  paddd  %xmm5,%xmm2
  add    $0x20,%rax
  cvtdq2pd %xmm0,%xmm1
  mulpd  %xmm7,%xmm1
  pshufd $0xee,%xmm0,%xmm0
  cvtdq2pd %xmm0,%xmm0
  mulpd  %xmm7,%xmm0
  subpd  %xmm1,%xmm8
  movapd %xmm6,%xmm1
  subpd  %xmm0,%xmm1
  movups %xmm8,-0x20(%rax)
  movups %xmm1,-0x10(%rax)
  cmp    %rax,%rsi
  jne    L49
  mov    %r9d,%eax
  and    $0xfffffffc,%eax
  mov    %eax,%esi
  add    %eax,%edi
  lea    (%rcx,%rsi,8),%rcx
  cmp    %eax,%r9d
  je     L120
L7:
  pxor   %xmm0,%xmm0
  movapd %xmm4,%xmm1
  lea    0x1(%rdi),%eax
  cvtsi2sd %edi,%xmm0
  mulsd  %xmm3,%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%rcx)
  cmp    %eax,%edx
  jle    L120
  pxor   %xmm0,%xmm0
  movapd %xmm4,%xmm1
  cvtsi2sd %eax,%xmm0
  lea    0x2(%rdi),%eax
  mulsd  %xmm3,%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x8(%rcx)
  cmp    %edx,%eax
  jge    L120
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  %xmm3,%xmm0
  subsd  %xmm0,%xmm4
  movsd  %xmm4,0x10(%rcx)
L120:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax)
L176:
  xor    %eax,%eax
  mov    %r8,%rcx
  cmp    %eax,%esi
  jg     L11
  nopl   (%rax)
L8:
  mov    %eax,%edi
  jmp    L71
L158:
  mov    %r8,%rcx
  xor    %eax,%eax
  jmp    L40
```

tool_calls: name: retrieve_data
arguments: data_label: D70
data_type: f64[2]
name: retrieve_data
arguments: data_label: D8
data_type: byte[16]
name: retrieve_data
arguments: data_label: D32
data_type: byte[16]
name: retrieve_data
arguments: data_label: D66
data_type: f64[2]

tool: {"D70": [4.0,4.0]}

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

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

tool: {"D66": [1.0,1.0]}

assistant: ```c
double *trapezoid(double *w, const int leng) {
  int k, m1, m2;
  double *p, slope;
  m1 = leng / 4;
  m2 = (leng * 3) / 4;
  slope = 4.0 / (double)(leng - 1);
  for (k = 0, p = w; k < m1; k++)
    *p++ = slope * k;
  for (; k < m2; k++)
    *p++ = 1.0;
  for (; k < leng; k++)
    *p++ = 4.0 - slope * k;
  return (w);
}
```