user: Translate the below assembly code into C programming language:

```asm
<clamp_poles>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %edx,-0x24(%rbp)
  mov    %ecx,-0x28(%rbp)
  mov    %r8,-0x30(%rbp)
  mov    %r9d,-0x34(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  jns    L66
  cmpl   $0x3,0x20(%rbp)
  jne    L2
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    0x18(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <subcurve@plt>
  jmp    L50
L2:
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x28(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0x34(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x30(%rbp),%rax
  add    %rax,%rcx
  mov    0x18(%rbp),%eax
  movapd %xmm0,%xmm1
  movq   %rdx,%xmm0
  mov    %eax,%esi
  mov    %rcx,%rdi
  call   <subline@plt>
  jmp    L50
L66:
  mov    -0x28(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L5
  mov    0x10(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,%r10d
  mov    -0x24(%rbp),%eax
  lea    -0x1(%rax),%edi
  mov    -0x34(%rbp),%r9d
  mov    -0x30(%rbp),%r8
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x20(%rbp),%ecx
  push   %rcx
  mov    0x10(%rbp),%ecx
  push   %rcx
  push   %r10
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <clamp_poles>
  add    $0x20,%rsp
  jmp    L50
L5:
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x20(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  ucomisd %xmm1,%xmm0
  jp     L22
  ucomisd %xmm1,%xmm0
  je     L69
L22:
  mov    0x20(%rbp),%eax
  add    $0x1,%eax
  jmp    L54
L69:
  mov    $0x1,%eax
L54:
  mov    %eax,-0x4(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L15
L7:
  mov    0x10(%rbp),%eax
  lea    0x3(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x2,%eax
  mov    %eax,%r10d
  mov    -0x8(%rbp),%eax
  imul   0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x34(%rbp),%eax
  lea    (%rdx,%rax,1),%r9d
  mov    -0x24(%rbp),%eax
  lea    -0x1(%rax),%edi
  mov    -0x30(%rbp),%r8
  mov    -0x28(%rbp),%edx
  mov    -0x20(%rbp),%rsi
  mov    -0x18(%rbp),%rax
  sub    $0x8,%rsp
  mov    0x20(%rbp),%ecx
  push   %rcx
  mov    0x18(%rbp),%ecx
  push   %rcx
  push   %r10
  mov    %edx,%ecx
  mov    %edi,%edx
  mov    %rax,%rdi
  call   <clamp_poles>
  add    $0x20,%rsp
  addl   $0x1,-0x8(%rbp)
L15:
  mov    -0x8(%rbp),%eax
  cmp    -0x4(%rbp),%eax
  jl     L7
L50:
  nop
  leave
  ret
```

assistant: ```c
void clamp_poles(double *T0, double *T1, int ii, int i, double *pole, int p_offset, int pole_step, int pole_step_i, int order) {
  if (ii < 0) {
    if (order == 3)
      subcurve(pole + p_offset, pole_step_i, T0[i], T1[i]);
    else
      subline(pole + p_offset, pole_step_i, T0[i], T1[i]);
  } else if (i == ii) {
    clamp_poles(T0, T1, ii - 1, i, pole, p_offset, pole_step / 4, pole_step, order);
  } else {
    int j, ei = (T0[ii] == T1[ii] ? 1 : order + 1);
    for (j = 0; j < ei; j++)
      clamp_poles(T0, T1, ii - 1, i, pole, p_offset + j * pole_step, pole_step / 4, pole_step_i, order);
  }
}
```