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

```asm
<gp_pt_alp>:
  endbr64
  push   %r15
  mov    %rdi,%r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %r8d,0x3c(%rsp)
  cmp    $0x1,%ecx
  je     L194
  pxor   %xmm0,%xmm0
  cmpl   $0x1,0x3c(%rsp)
  mov    %edx,%r14d
  mov    %ecx,%r12d
  cvtsi2sd %ecx,%xmm0
  movsd  D0(%rip),%xmm7
  sbb    $0xffffffff,%r14d
  divsd  %xmm0,%xmm7
  movsd  %xmm7,0x30(%rsp)
  test   %r14d,%r14d
  jle    L79
  pxor   %xmm7,%xmm7
  xor    %ebp,%ebp
  movsd  %xmm7,0x8(%rsp)
  nopl   0x0(%rax)
L204:
  cmp    %ebp,%r13d
  je     L52
L75:
  movsd  (%rsi),%xmm1
  movsd  0x8(%rsi),%xmm4
  lea    0x8(%rsi),%rbx
  movapd %xmm1,%xmm0
  movapd %xmm4,%xmm2
  mulsd  %xmm1,%xmm0
  mulsd  %xmm4,%xmm2
  addsd  %xmm2,%xmm0
  cmp    $0x1,%r12d
  jle    L137
  lea    -0x2(%r12),%ecx
  movapd %xmm0,%xmm5
  movapd %xmm0,%xmm6
  mov    %rbx,%rax
  mov    %rcx,%rdx
  shl    $0x4,%rdx
  lea    0x18(%rsi,%rdx,1),%rdx
  jmp    L175
  nopw   0x0(%rax,%rax,1)
L184:
  minsd  %xmm6,%xmm2
  movapd %xmm2,%xmm6
  cmp    %rdx,%rax
  je     L62
L175:
  movsd  0x8(%rax),%xmm2
  movsd  0x10(%rax),%xmm3
  add    $0x10,%rax
  addsd  %xmm2,%xmm1
  addsd  %xmm3,%xmm4
  mulsd  %xmm2,%xmm2
  mulsd  %xmm3,%xmm3
  addsd  %xmm3,%xmm2
  comisd %xmm5,%xmm2
  addsd  %xmm2,%xmm0
  jbe    L184
  movapd %xmm2,%xmm5
  cmp    %rdx,%rax
  jne    L175
L62:
  add    $0x1,%rcx
  shl    $0x4,%rcx
  add    %rcx,%rbx
L148:
  mulsd  0x30(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm7
  ucomisd %xmm0,%xmm7
  ja     L188
  sqrtsd %xmm0,%xmm0
L127:
  movsd  %xmm0,(%r15)
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm6,0x10(%rsp)
  call   <log@plt>
  movsd  0x8(%rsp),%xmm7
  movsd  0x10(%rsp),%xmm6
  movsd  0x18(%rsp),%xmm5
  movsd  0x20(%rsp),%xmm1
  movsd  %xmm0,0x18(%r15)
  ucomisd %xmm6,%xmm7
  movsd  0x28(%rsp),%xmm4
  ja     L145
  sqrtsd %xmm6,%xmm6
  movapd %xmm6,%xmm0
L65:
  movsd  %xmm0,0x8(%r15)
  movsd  %xmm5,0x10(%rsp)
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm1,0x18(%rsp)
  call   <log@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm1
  movsd  %xmm0,0x20(%r15)
  movapd %xmm4,%xmm0
  call   <atan2@plt>
  movsd  0x8(%rsp),%xmm7
  movsd  0x10(%rsp),%xmm5
  movsd  %xmm0,0x30(%r15)
  ucomisd %xmm5,%xmm7
  ja     L103
  sqrtsd %xmm5,%xmm5
  movapd %xmm5,%xmm0
L130:
  movsd  %xmm0,0x10(%r15)
  add    $0x1,%ebp
  add    $0x40,%r15
  call   <log@plt>
  lea    0x8(%rbx),%rsi
  movsd  %xmm0,-0x18(%r15)
  cmp    %ebp,%r14d
  jne    L204
L79:
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L52:
  mov    0x3c(%rsp),%r12d
  pxor   %xmm0,%xmm0
  movsd  D0(%rip),%xmm7
  cvtsi2sd %r12d,%xmm0
  divsd  %xmm0,%xmm7
  movsd  %xmm7,0x30(%rsp)
  jmp    L75
  nopl   (%rax)
L137:
  movapd %xmm0,%xmm5
  movapd %xmm0,%xmm6
  jmp    L148
L194:
  test   %edx,%edx
  jle    L79
  movslq %edx,%rbx
  pxor   %xmm7,%xmm7
  shl    $0x6,%rbx
  movsd  %xmm7,0x8(%rsp)
  add    %rdi,%rbx
  nopl   (%rax)
L170:
  movsd  (%rsi),%xmm1
  movsd  0x8(%rsi),%xmm2
  movsd  0x8(%rsp),%xmm7
  movapd %xmm1,%xmm0
  movapd %xmm2,%xmm3
  mulsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm3
  addsd  %xmm3,%xmm0
  ucomisd %xmm0,%xmm7
  ja     L126
  sqrtsd %xmm0,%xmm0
L95:
  movsd  %xmm0,(%r15)
  add    $0x40,%r15
  mov    %rsi,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  call   <log@plt>
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  movsd  %xmm0,-0x28(%r15)
  movapd %xmm2,%xmm0
  call   <atan2@plt>
  mov    0x20(%rsp),%rsi
  movsd  %xmm0,-0x10(%r15)
  add    $0x10,%rsi
  cmp    %r15,%rbx
  jne    L170
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L188:
  movsd  %xmm4,0x28(%rsp)
  movsd  %xmm1,0x20(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm6,0x10(%rsp)
  call   <sqrt@plt>
  movsd  0x28(%rsp),%xmm4
  movsd  0x20(%rsp),%xmm1
  movsd  0x18(%rsp),%xmm5
  movsd  0x10(%rsp),%xmm6
  jmp    L127
L103:
  movapd %xmm5,%xmm0
  call   <sqrt@plt>
  jmp    L130
L145:
  movapd %xmm6,%xmm0
  movsd  %xmm4,0x20(%rsp)
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm5,0x10(%rsp)
  call   <sqrt@plt>
  movsd  0x20(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm1
  movsd  0x10(%rsp),%xmm5
  jmp    L65
L126:
  mov    %rsi,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  call   <sqrt@plt>
  mov    0x20(%rsp),%rsi
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm1
  jmp    L95
```

tool_calls: name: unpack_data
arguments: tag: D0
type_guessed: f64

tool: D0: 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));
  }
}
```