user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<gp_pt_alp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %edx,0x28(%rsp)
  mov    %r8d,0x2c(%rsp)
  cmp    $0x1,%ecx
  je     L170
  mov    %ecx,%ebp
  pxor   %xmm0,%xmm0
  cvtsi2sd %ecx,%xmm0
  movsd  D5(%rip),%xmm1
  divsd  %xmm0,%xmm1
  movsd  %xmm1,0x20(%rsp)
  cmpl   $0x1,0x2c(%rsp)
  mov    0x28(%rsp),%ebx
  sbb    $0xffffffff,%ebx
  test   %ebx,%ebx
  jle    L96
  mov    $0x0,%r15d
  jmp    L122
L170:
  test   %edx,%edx
  jle    L96
  mov    %edx,%r14d
  shl    $0x6,%r14
  add    %rdi,%r14
L28:
  mov    0x0(%r13),%rbp
  mov    0x8(%r13),%rbx
  movq   %rbp,%xmm0
  mulsd  %xmm0,%xmm0
  movq   %rbx,%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm5,%xmm5
  ucomisd %xmm0,%xmm5
  ja     L78
  sqrtsd %xmm0,%xmm0
L202:
  movsd  %xmm0,(%r12)
  call   <log@plt>
  movsd  %xmm0,0x18(%r12)
  movq   %rbp,%xmm1
  movq   %rbx,%xmm0
  call   <atan2@plt>
  movsd  %xmm0,0x30(%r12)
  add    $0x40,%r12
  add    $0x10,%r13
  cmp    %r12,%r14
  jne    L28
L96:
  add    $0x38,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L78:
  call   <sqrt@plt>
  jmp    L202
L55:
  mov    0x2c(%rsp),%ebp
  pxor   %xmm0,%xmm0
  cvtsi2sd %ebp,%xmm0
  movsd  D5(%rip),%xmm5
  divsd  %xmm0,%xmm5
  movsd  %xmm5,0x20(%rsp)
  jmp    L33
L6:
  movsd  %xmm1,0x10(%rsp)
L190:
  cmp    %rdx,%rax
  je     L216
L191:
  movsd  0x8(%rax),%xmm1
  add    $0x10,%rax
  movsd  (%rax),%xmm2
  movsd  (%rsp),%xmm3
  addsd  %xmm1,%xmm3
  movsd  %xmm3,(%rsp)
  movsd  0x8(%rsp),%xmm4
  addsd  %xmm2,%xmm4
  movsd  %xmm4,0x8(%rsp)
  mulsd  %xmm1,%xmm1
  mulsd  %xmm2,%xmm2
  addsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  comisd 0x10(%rsp),%xmm1
  ja     L6
  minsd  0x18(%rsp),%xmm1
  movsd  %xmm1,0x18(%rsp)
  jmp    L190
L216:
  add    $0x1,%rcx
  shl    $0x4,%rcx
  add    %rcx,%r14
L92:
  mulsd  0x20(%rsp),%xmm0
  pxor   %xmm6,%xmm6
  ucomisd %xmm0,%xmm6
  ja     L69
  sqrtsd %xmm0,%xmm0
L37:
  movsd  %xmm0,(%r12)
  call   <log@plt>
  movsd  %xmm0,0x18(%r12)
  pxor   %xmm5,%xmm5
  movsd  0x18(%rsp),%xmm7
  ucomisd %xmm7,%xmm5
  ja     L7
  sqrtsd %xmm7,%xmm7
  movapd %xmm7,%xmm0
L47:
  movsd  %xmm0,0x8(%r12)
  call   <log@plt>
  movsd  %xmm0,0x20(%r12)
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm0
  call   <atan2@plt>
  movsd  %xmm0,0x30(%r12)
  pxor   %xmm6,%xmm6
  movsd  0x10(%rsp),%xmm7
  ucomisd %xmm7,%xmm6
  ja     L88
  sqrtsd %xmm7,%xmm7
  movapd %xmm7,%xmm0
L98:
  movsd  %xmm0,0x10(%r12)
  call   <log@plt>
  movsd  %xmm0,0x28(%r12)
  add    $0x1,%r15d
  add    $0x40,%r12
  lea    0x8(%r14),%r13
  cmp    %r15d,%ebx
  je     L96
L122:
  cmp    %r15d,0x28(%rsp)
  je     L55
L33:
  movsd  0x0(%r13),%xmm0
  movsd  %xmm0,(%rsp)
  lea    0x8(%r13),%r14
  movsd  0x8(%r13),%xmm6
  movsd  %xmm6,0x8(%rsp)
  mulsd  %xmm0,%xmm0
  movapd %xmm6,%xmm1
  mulsd  %xmm6,%xmm1
  addsd  %xmm1,%xmm0
  cmp    $0x1,%ebp
  jle    L80
  lea    -0x2(%rbp),%ecx
  mov    %rcx,%rax
  shl    $0x4,%rax
  lea    0x18(%r13,%rax,1),%rdx
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm0,0x18(%rsp)
  mov    %r14,%rax
  jmp    L191
L80:
  movsd  %xmm0,0x10(%rsp)
  movsd  %xmm0,0x18(%rsp)
  jmp    L92
L69:
  call   <sqrt@plt>
  jmp    L37
L7:
  movsd  0x18(%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L47
L88:
  movsd  0x10(%rsp),%xmm0
  call   <sqrt@plt>
  jmp    L98
```

tool_calls: name: read_data
arguments: data_label: D5
type_infered: f64

tool: D5: 1

assistant: ```c
void gp_pt_alp(double *to, const double *p, int cnt, int siz, int rem) {
  double x, y;
  int i;
  if (siz == 1) {
    for (i = 0; i < cnt; i++, to += 8, p += 2)
      x = *p, y = p[1], to[3] = log(to[0] = sqrt(x * x + y * y)), to[6] = atan2(y, x);
    return;
  }
  double z, xa, ya, za, zm, zM, sz_1 = 1.0 / (double)siz;
  int j, i1 = cnt + !!rem;
  for (i = 0; i < i1; i++, to += 8, p++) {
    if (i == cnt)
      siz = rem, sz_1 = 1.0 / (double)(rem);
    for (j = 1, xa = *p, ya = *++p, zm = zM = za = xa * xa + ya * ya; j < siz; j++) {
      x = *++p, y = *++p, xa += x, ya += y;
      za += (z = x * x + y * y);
      if (z > zM)
        zM = z;
      else if (z < zm)
        zm = z;
    }
    to[3] = log(to[0] = sqrt(za * sz_1));
    to[4] = log(to[1] = sqrt(zm));
    to[6] = atan2(ya, xa);
    to[5] = log(to[2] = sqrt(zM));
  }
}
```