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

```asm
<c_phansalkar>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,%r15
  mov    %esi,0x4c(%rsp)
  mov    %edx,%ebx
  mov    %edx,0x8(%rsp)
  mov    %rcx,%rdi
  mov    %rcx,0x30(%rsp)
  mov    $0x8,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  test   %ebx,%ebx
  jle    L119
  mov    0x8(%rsp),%eax
  movslq %eax,%rdi
  mov    %rdi,0x28(%rsp)
  mov    0x30(%rsp),%rsi
  mov    %rsi,0x10(%rsp)
  shl    $0x3,%rdi
  mov    %rdi,0x18(%rsp)
  lea    0x8(%r15),%rsi
  mov    %rsi,0x20(%rsp)
  mov    %eax,%edi
  lea    -0x1(%rax),%eax
  lea    (%rsi,%rax,8),%r14
  mov    D31(%rip),%rbp
  mov    D35(%rip),%rbx
  movl   $0x0,(%rsp)
  mov    %edi,%eax
  neg    %rax
  shl    $0x3,%rax
  mov    %rax,0x38(%rsp)
L171:
  mov    0x38(%rsp),%rax
  lea    (%rax,%r14,1),%r12
  mov    0x10(%rsp),%r13
L46:
  movsd  (%r12),%xmm1
  movq   %rbp,%xmm0
  call   <min@plt>
  movq   %xmm0,%rbp
  movsd  (%r12),%xmm1
  movq   %rbx,%xmm0
  call   <max@plt>
  movq   %xmm0,%rbx
  movb   $0x0,0x0(%r13)
  add    $0x8,%r12
  add    $0x1,%r13
  cmp    %r14,%r12
  jne    L46
  mov    (%rsp),%eax
  add    $0x1,%eax
  mov    0x28(%rsp),%rsi
  add    %rsi,0x10(%rsp)
  add    0x18(%rsp),%r14
  cmp    %eax,0x8(%rsp)
  je     L50
  mov    %eax,(%rsp)
  jmp    L171
L50:
  mov    (%rsp),%eax
  mov    0x20(%rsp),%rdi
  lea    (%rdi,%rax,8),%rdx
  mov    $0x0,%esi
  not    %rax
  lea    0x0(,%rax,8),%rcx
  movapd %xmm0,%xmm1
  movq   %rbp,%xmm6
  subsd  %xmm6,%xmm1
  movq   %rbp,%xmm2
L112:
  lea    (%rcx,%rdx,1),%rax
L68:
  movsd  (%rax),%xmm0
  subsd  %xmm2,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L68
  lea    0x1(%rsi),%eax
  add    0x18(%rsp),%rdx
  cmp    %esi,(%rsp)
  je     L119
  mov    %eax,%esi
  jmp    L112
L119:
  mov    0x8(%rsp),%r12d
  mov    %r12d,%edx
  mov    0x4c(%rsp),%edi
  sub    %edi,%edx
  cmp    %edx,%edi
  jge    L100
  lea    (%rdi,%rdi,1),%eax
  mov    %eax,0x58(%rsp)
  add    $0x1,%eax
  mov    %eax,%esi
  imul   %eax,%esi
  mov    %esi,0x18(%rsp)
  mov    %edi,%esi
  imul   %r12d,%edi
  mov    %edi,0x50(%rsp)
  mov    %eax,%r14d
  lea    0x1(%rdx,%rsi,1),%eax
  mov    %eax,0x54(%rsp)
  mov    %esi,%eax
  neg    %eax
  add    %eax,%eax
  mov    %eax,0x5c(%rsp)
  mov    %edi,0x48(%rsp)
  lea    0x8(%r15),%r13
  jmp    L118
L26:
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm2
  jmp    L126
L192:
  movapd %xmm1,%xmm0
  call   <sqrt@plt>
  movsd  %xmm0,0x8(%rsp)
  jmp    L85
L193:
  mov    0x30(%rsp),%rax
  add    0x40(%rsp),%rax
  movb   $0x0,(%rax,%rbx,1)
L207:
  add    $0x1,%rbx
  add    $0x1,%ebp
  cmp    %r12d,%ebp
  je     L41
L66:
  mov    0x20(%rsp),%rax
  movsd  (%rax,%rbx,8),%xmm6
  movsd  %xmm6,0x10(%rsp)
  lea    -0x1(%r14),%eax
  mov    0x28(%rsp),%ecx
  cmp    %ecx,%eax
  jl     L26
  mov    0x38(%rsp),%esi
  pxor   %xmm1,%xmm1
  movapd %xmm1,%xmm2
  mov    %ebp,%edi
  sub    %ebx,%edi
  add    %rbx,%rdi
L77:
  cmp    %ebx,%ebp
  jl     L108
  movslq %esi,%rdx
  lea    (%rbx,%rdx,1),%rax
  lea    (%r15,%rax,8),%rax
  add    %rdi,%rdx
  lea    0x0(%r13,%rdx,8),%rdx
L36:
  movsd  (%rax),%xmm0
  addsd  %xmm0,%xmm2
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L36
L108:
  add    $0x1,%ecx
  add    %r12d,%esi
  cmp    %r14d,%ecx
  jne    L77
L126:
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0x18(%rsp),%xmm0
  movapd %xmm2,%xmm3
  divsd  %xmm0,%xmm3
  movsd  %xmm3,(%rsp)
  mulsd  %xmm3,%xmm2
  subsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm1
  pxor   %xmm7,%xmm7
  ucomisd %xmm1,%xmm7
  ja     L192
  sqrtsd %xmm1,%xmm1
  movsd  %xmm1,0x8(%rsp)
L85:
  movsd  (%rsp),%xmm0
  mulsd  D21(%rip),%xmm0
  call   <exp@plt>
  movapd %xmm0,%xmm1
  movsd  0x8(%rsp),%xmm5
  addsd  %xmm5,%xmm5
  movapd %xmm5,%xmm0
  movsd  D17(%rip),%xmm2
  subsd  %xmm2,%xmm0
  mulsd  D42(%rip),%xmm0
  addsd  %xmm1,%xmm1
  addsd  %xmm2,%xmm1
  addsd  %xmm1,%xmm0
  mulsd  (%rsp),%xmm0
  movsd  0x10(%rsp),%xmm4
  comisd %xmm0,%xmm4
  jbe    L193
  mov    0x30(%rsp),%rax
  add    0x40(%rsp),%rax
  movb   $0x1,(%rax,%rbx,1)
  jmp    L207
L41:
  add    %r12d,0x48(%rsp)
  add    $0x1,%r14d
  cmp    0x54(%rsp),%r14d
  je     L100
L118:
  mov    0x48(%rsp),%edi
  movslq %edi,%rax
  movslq 0x4c(%rsp),%rdx
  add    %rdx,%rax
  mov    %rax,0x40(%rsp)
  lea    (%r15,%rax,8),%rax
  mov    %rax,0x20(%rsp)
  mov    0x5c(%rsp),%eax
  lea    -0x1(%r14,%rax,1),%eax
  mov    %eax,0x28(%rsp)
  sub    0x50(%rsp),%edi
  mov    %edi,0x38(%rsp)
  mov    0x58(%rsp),%ebp
  mov    $0x0,%ebx
  jmp    L66
L100:
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D31
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D35
type: f64
name: extract_symbolic_data
arguments: data_label: D21
type: byte[8]
name: extract_symbolic_data
arguments: data_label: D17
type: f64
name: extract_symbolic_data
arguments: data_label: D42
type: f64

tool: {"D31": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0xbf]}

tool: D35: 65537

tool: {"D21": [0x00,0x00,0x00,0x00,0x00,0x00,0x24,0xc0]}

tool: D17: 1

tool: D42: 0.25

assistant: ```c
void c_phansalkar(double *frame, int wsize, int size, unsigned char *ret) {
  int i, j, m, n;
  double mean, sdv;
  double k = 0.25, r = 0.5, p = 2, q = 10;
  double pixel, th, sum, sum2, num;
  double Max = 65537, Min = -1;
  memset(ret, 0, sizeof(ret));
  for (i = 0; i < size; i++)
    for (j = 0; j < size; j++) {
      Min = min(Min, frame[i * size + j]);
      Max = max(Max, frame[i * size + j]);
      ret[i * size + j] = 0;
    }
  for (i = 0; i < size; i++)
    for (j = 0; j < size; j++)
      frame[i * size + j] = (frame[i * size + j] - Min) / (Max - Min);
  for (i = wsize; i < size - wsize; i++)
    for (j = wsize; j < size - wsize; j++) {
      pixel = frame[i * size + j];
      th = 0;
      sum = 0;
      sum2 = 0;
      for (m = i - wsize; m <= i + wsize; m++)
        for (n = j - wsize; n <= j + wsize; n++) {
          sum += frame[m * size + n];
          sum2 += frame[m * size + n] * frame[m * size + n];
        }
      num = (2 * wsize + 1) * (2 * wsize + 1);
      mean = sum / num;
      sdv = sqrt((sum2 - sum * mean) / num);
      th = mean * (1 + p * exp(-q * mean) + k * (sdv / r - 1));
      if (pixel > th)
        ret[i * size + j] = 1;
      else
        ret[i * size + j] = 0;
    }
}
```