user: Converte this assembly snippet into its equivalent C code:

```asm
<p3dCartesian2polar_8>:
  endbr64
  movapd %xmm0,%xmm3
  movapd %xmm1,%xmm4
  push   %r15
  pxor   %xmm7,%xmm7
  mulsd  %xmm0,%xmm3
  push   %r14
  mov    %r8,%r14
  mulsd  %xmm1,%xmm4
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %ecx,%r12d
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %rsi,%rbx
  movapd %xmm3,%xmm5
  addsd  %xmm4,%xmm5
  sub    $0x58,%rsp
  movsd  %xmm0,0x20(%rsp)
  ucomisd %xmm5,%xmm7
  movsd  %xmm1,0x28(%rsp)
  ja     L103
  sqrtsd %xmm5,%xmm5
L39:
  pxor   %xmm1,%xmm1
  cvtsi2sd %ebp,%xmm1
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  addsd  %xmm1,%xmm4
  ucomisd %xmm4,%xmm7
  ja     L52
  sqrtsd %xmm4,%xmm4
L55:
  pxor   %xmm0,%xmm0
  movsd  0x28(%rsp),%xmm6
  cvtsi2sd %r12d,%xmm0
  subsd  %xmm0,%xmm6
  mulsd  %xmm6,%xmm6
  addsd  %xmm6,%xmm3
  ucomisd %xmm3,%xmm7
  ja     L72
  sqrtsd %xmm3,%xmm3
L45:
  addsd  %xmm6,%xmm1
  ucomisd %xmm1,%xmm7
  movapd %xmm1,%xmm0
  ja     L77
  sqrtsd %xmm0,%xmm0
L70:
  maxsd  %xmm4,%xmm5
  mov    $0x1,%esi
  maxsd  %xmm3,%xmm5
  movapd %xmm5,%xmm3
  maxsd  %xmm0,%xmm3
  movsd  D0(%rip),%xmm0
  addsd  %xmm3,%xmm0
  mulsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,(%r14)
  imul   %eax,%eax
  movslq %eax,%rdi
  call   <calloc@plt>
  mov    %rax,(%rbx)
  mov    (%r14),%eax
  test   %eax,%eax
  jle    L96
  lea    0x48(%rsp),%rcx
  movl   $0x0,0x10(%rsp)
  mov    %rcx,0x38(%rsp)
  lea    0x40(%rsp),%rcx
  mov    %rcx,0x30(%rsp)
  nopl   0x0(%rax)
L79:
  pxor   %xmm5,%xmm5
  xor    %r15d,%r15d
  cvtsi2sdl 0x10(%rsp),%xmm5
  movsd  %xmm5,0x18(%rsp)
  nopl   0x0(%rax,%rax,1)
L61:
  pxor   %xmm1,%xmm1
  movsd  0x18(%rsp),%xmm0
  pxor   %xmm2,%xmm2
  mov    0x30(%rsp),%rsi
  cvtsi2sd %eax,%xmm1
  mov    0x38(%rsp),%rdi
  cvtsi2sd %r15d,%xmm2
  divsd  %xmm1,%xmm0
  movsd  %xmm2,0x8(%rsp)
  mulsd  D14(%rip),%xmm0
  addsd  %xmm0,%xmm0
  call   <sincos@plt>
  movsd  0x8(%rsp),%xmm2
  mov    %r12d,%edx
  mov    %ebp,%esi
  movsd  0x48(%rsp),%xmm1
  mov    %r13,%rdi
  mov    $0x2,%eax
  mulsd  %xmm2,%xmm1
  mulsd  0x40(%rsp),%xmm2
  addsd  0x28(%rsp),%xmm1
  addsd  0x20(%rsp),%xmm2
  movapd %xmm2,%xmm0
  call   <p3dBicubicInterpolation_8@plt>
  mov    (%rbx),%rdx
  mov    %eax,%r9d
  mov    0x10(%rsp),%eax
  imul   (%r14),%eax
  add    %r15d,%eax
  add    $0x1,%r15d
  cltq
  mov    %r9b,(%rdx,%rax,1)
  mov    (%r14),%eax
  cmp    %r15d,%eax
  jg     L61
  addl   $0x1,0x10(%rsp)
  mov    0x10(%rsp),%ecx
  cmp    %ecx,%eax
  jg     L79
L96:
  add    $0x58,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L103:
  movapd %xmm5,%xmm0
  movsd  %xmm2,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x18(%rsp),%xmm2
  movsd  0x10(%rsp),%xmm4
  pxor   %xmm7,%xmm7
  movapd %xmm0,%xmm5
  movsd  0x8(%rsp),%xmm3
  movsd  0x20(%rsp),%xmm0
  jmp    L39
L77:
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm3,0x18(%rsp)
  movsd  %xmm4,0x10(%rsp)
  movsd  %xmm5,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x30(%rsp),%xmm2
  movsd  0x18(%rsp),%xmm3
  movsd  0x10(%rsp),%xmm4
  movsd  0x8(%rsp),%xmm5
  jmp    L70
L72:
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x38(%rsp)
  movsd  %xmm4,0x30(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm6,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x38(%rsp),%xmm2
  pxor   %xmm7,%xmm7
  movsd  0x30(%rsp),%xmm4
  movsd  0x18(%rsp),%xmm5
  movsd  0x10(%rsp),%xmm6
  movapd %xmm0,%xmm3
  movsd  0x8(%rsp),%xmm1
  jmp    L45
L52:
  movapd %xmm4,%xmm0
  movsd  %xmm2,0x30(%rsp)
  movsd  %xmm5,0x18(%rsp)
  movsd  %xmm1,0x10(%rsp)
  movsd  %xmm3,0x8(%rsp)
  call   <sqrt@plt>
  movsd  0x30(%rsp),%xmm2
  pxor   %xmm7,%xmm7
  movsd  0x18(%rsp),%xmm5
  movsd  0x10(%rsp),%xmm1
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm4
  jmp    L55
```

tool_calls: name: retrieve_data
arguments: data_label: D0
type: f64
name: retrieve_data
arguments: data_label: D14
type: f64

tool: D0: 0.5

tool: D14: 3.141592653589793

assistant: ```c
void p3dCartesian2polar_8(unsigned char *in_im, unsigned char **out_im, const int dimx, const int dimy, const double centerX, const double centerY, const double precision, int *polarX) {
  int i, j;
  double r, phi;
  double x, y;
  double r1, r2, r3, r4;
  r1 = sqrt((centerX - 0) * (centerX - 0) + (centerY - 0) * (centerY - 0));
  r2 = sqrt((centerX - dimx) * (centerX - dimx) + (centerY - 0) * (centerY - 0));
  r3 = sqrt((centerX - 0) * (centerX - 0) + (centerY - dimy) * (centerY - dimy));
  r4 = sqrt((centerX - dimx) * (centerX - dimx) + (centerY - dimy) * (centerY - dimy));
  *polarX = (int)(precision * ((((((((((r1) > (r2)) ? (r1) : (r2))) > (r3)) ? ((((r1) > (r2)) ? (r1) : (r2))) : (r3))) > (r4)) ? (((((((r1) > (r2)) ? (r1) : (r2))) > (r3)) ? ((((r1) > (r2)) ? (r1) : (r2))) : (r3))) : (r4)) + 0.5));
  (*out_im) = (unsigned char *)calloc((*polarX) * (*polarX), sizeof(unsigned char));
#pragma omp parallel for private(i, r, phi, x, y)
  for (j = 0; j < (*polarX); j++)
    for (i = 0; i < (*polarX); i++) {
      r = (double)(i);
      phi = ((double)(j) / (*polarX)) * 3.1415926535897932384626433 * 2;
      x = r * cos(phi) + centerX;
      y = r * sin(phi) + centerY;
      (*out_im)[((j) * ((*polarX)) + (i))] = p3dBicubicInterpolation_8(in_im, dimx, dimy, x, y);
    }
}
```