user: Please show me the C implementation that matches the assembly code listed below:

```asm
<thickenPoly>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r12
  mov    %edx,0x34(%rsp)
  mov    %rcx,%r14
  mov    %r8,%r15
  mov    %r9d,0x48(%rsp)
  movsd  %xmm0,0x10(%rsp)
  mov    0xa8(%rsp),%eax
  movzwl 0xa0(%rsp),%esi
  mov    %si,0x4c(%rsp)
  mov    %ax,0x4e(%rsp)
  cmpw   $0x0,0xb0(%rsp)
  je     L174
  movslq %edx,%rcx
  lea    0x0(,%rcx,8),%rdx
  movsd  (%rdi),%xmm0
  ucomisd -0x8(%rdi,%rcx,8),%xmm0
  jp     L30
  ucomisd -0x8(%rdi,%rdx,1),%xmm0
  jne    L30
  movsd  (%r12),%xmm0
  ucomisd -0x8(%r12,%rdx,1),%xmm0
  jp     L155
  jne    L155
L174:
  mov    0x34(%rsp),%ecx
  lea    -0x1(%rcx),%edx
L147:
  test   %ax,%ax
  jne    L106
  cmpl   $0x0,0x34(%rsp)
  jle    L106
  cmpl   $0x0,0x48(%rsp)
  je     L188
  movsd  0x0(%r13),%xmm0
  movsd  %xmm0,(%r14)
  movsd  (%r12),%xmm0
  movsd  %xmm0,(%r15)
  mov    $0x1,%ebp
  jmp    L156
L30:
  mov    0x34(%rsp),%edx
  jmp    L147
L155:
  mov    0x34(%rsp),%edx
  jmp    L147
L106:
  mov    $0x0,%ebp
L156:
  test   %edx,%edx
  jle    L38
  lea    0x1(%rdx),%eax
  mov    %rax,0x50(%rsp)
  mov    $0x1,%ebx
  pxor   %xmm6,%xmm6
  movsd  %xmm6,0x8(%rsp)
  jmp    L3
L85:
  call   <sqrt@plt>
  jmp    L15
L97:
  call   <asin@plt>
  addsd  %xmm0,%xmm0
  mulsd  D52(%rip),%xmm0
L35:
  cmpw   $0x0,0x4e(%rsp)
  je     L244
  cmp    %ebp,0x48(%rsp)
  je     L8
  movslq %ebp,%rax
  mov    %rax,0x38(%rsp)
  movsd  0x28(%rsp),%xmm7
  movsd  %xmm7,(%r14,%rax,8)
  movsd  -0x8(%r12,%rbx,8),%xmm1
  movsd  %xmm1,(%r15,%rax,8)
  lea    0x1(%rbp),%eax
  mov    %eax,0x28(%rsp)
  comisd 0x10(%rsp),%xmm0
  ja     L279
  mov    0x28(%rsp),%ebp
L388:
  add    $0x1,%rbx
  cmp    0x50(%rsp),%rbx
  je     L38
L3:
  cmp    %ebx,0x34(%rsp)
  mov    $0x0,%eax
  cmovne %ebx,%eax
  cltq
  movsd  -0x8(%r13,%rbx,8),%xmm7
  movsd  %xmm7,0x28(%rsp)
  movsd  0x0(%r13,%rax,8),%xmm0
  subsd  %xmm7,%xmm0
  movsd  %xmm0,0x18(%rsp)
  movsd  (%r12,%rax,8),%xmm4
  movsd  -0x8(%r12,%rbx,8),%xmm5
  movsd  %xmm4,0x38(%rsp)
  movsd  %xmm5,0x40(%rsp)
  subsd  %xmm5,%xmm4
  movapd %xmm4,%xmm5
  movsd  %xmm4,0x20(%rsp)
  cmpw   $0x0,0x4c(%rsp)
  jne    L21
  mulsd  D10(%rip),%xmm5
  movapd %xmm5,%xmm0
  divsd  D35(%rip),%xmm0
  mulsd  D119(%rip),%xmm0
  call   <sin@plt>
  movsd  %xmm0,0x58(%rsp)
  movsd  0x40(%rsp),%xmm5
  mulsd  D10(%rip),%xmm5
  movapd %xmm5,%xmm0
  divsd  D35(%rip),%xmm0
  call   <cos@plt>
  movsd  %xmm0,0x40(%rsp)
  movsd  0x38(%rsp),%xmm4
  mulsd  D10(%rip),%xmm4
  movapd %xmm4,%xmm0
  divsd  D35(%rip),%xmm0
  call   <cos@plt>
  movsd  %xmm0,0x38(%rsp)
  movsd  0x18(%rsp),%xmm0
  mulsd  D10(%rip),%xmm0
  divsd  D35(%rip),%xmm0
  mulsd  D119(%rip),%xmm0
  call   <sin@plt>
  movapd %xmm0,%xmm1
  movsd  0x40(%rsp),%xmm7
  mulsd  0x38(%rsp),%xmm7
  movapd %xmm7,%xmm0
  mulsd  %xmm1,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  0x58(%rsp),%xmm1
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L85
  sqrtsd %xmm0,%xmm0
L15:
  comisd D11(%rip),%xmm0
  jbe    L97
  movsd  D11(%rip),%xmm0
  jmp    L97
L21:
  movsd  0x20(%rsp),%xmm4
  movapd %xmm4,%xmm1
  mulsd  %xmm4,%xmm1
  movsd  0x18(%rsp),%xmm6
  movapd %xmm6,%xmm0
  mulsd  %xmm6,%xmm0
  addsd  %xmm1,%xmm0
  pxor   %xmm7,%xmm7
  ucomisd %xmm0,%xmm7
  ja     L296
  sqrtsd %xmm0,%xmm0
  jmp    L35
L296:
  call   <sqrt@plt>
  jmp    L35
L279:
  divsd  0x10(%rsp),%xmm0
  call   <ceil@plt>
  mov    %eax,%ecx
  cmp    $0x1,%eax
  jle    L127
  mov    0x48(%rsp),%esi
  mov    0x28(%rsp),%eax
  cmp    %eax,%esi
  je     L272
  lea    0x2(%rbp),%eax
  cltq
  lea    -0x2(%rsi),%edx
  sub    %ebp,%edx
  mov    0x38(%rsp),%rdi
  lea    0x3(%rdi,%rdx,1),%rsi
  mov    $0x1,%edx
  pxor   %xmm2,%xmm2
  cvtsi2sd %ecx,%xmm2
L87:
  pxor   %xmm0,%xmm0
  cvtsi2sd %edx,%xmm0
  divsd  %xmm2,%xmm0
  movsd  0x18(%rsp),%xmm1
  mulsd  %xmm0,%xmm1
  addsd  -0x8(%r13,%rbx,8),%xmm1
  movsd  %xmm1,-0x8(%r14,%rax,8)
  mulsd  0x20(%rsp),%xmm0
  addsd  -0x8(%r12,%rbx,8),%xmm0
  movsd  %xmm0,-0x8(%r15,%rax,8)
  mov    %eax,%ebp
  add    $0x1,%edx
  cmp    %edx,%ecx
  je     L388
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L87
  mov    $0xffffffff,%ebp
  jmp    L38
L244:
  movsd  0x8(%rsp),%xmm4
  addsd  %xmm0,%xmm4
  movsd  %xmm4,0x8(%rsp)
  movsd  0x10(%rsp),%xmm7
  comisd %xmm7,%xmm4
  jb     L388
  subsd  %xmm7,%xmm4
  movsd  %xmm4,0x8(%rsp)
  movapd %xmm0,%xmm1
  subsd  %xmm4,%xmm1
  divsd  %xmm0,%xmm1
  mov    0x48(%rsp),%edi
  cmp    %ebp,%edi
  je     L284
  lea    0x1(%rbp),%eax
  cltq
  lea    -0x1(%rdi),%edx
  sub    %ebp,%edx
  movslq %ebp,%rbp
  lea    0x2(%rdx,%rbp,1),%rdx
L335:
  movsd  0x18(%rsp),%xmm2
  mulsd  %xmm1,%xmm2
  addsd  -0x8(%r13,%rbx,8),%xmm2
  movsd  %xmm2,-0x8(%r14,%rax,8)
  mulsd  0x20(%rsp),%xmm1
  addsd  -0x8(%r12,%rbx,8),%xmm1
  movsd  %xmm1,-0x8(%r15,%rax,8)
  mov    %eax,%ebp
  movsd  0x8(%rsp),%xmm7
  comisd 0x10(%rsp),%xmm7
  jb     L388
  movsd  0x8(%rsp),%xmm3
  subsd  0x10(%rsp),%xmm3
  movsd  %xmm3,0x8(%rsp)
  movapd %xmm0,%xmm1
  subsd  %xmm3,%xmm1
  divsd  %xmm0,%xmm1
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L335
  mov    $0xffffffff,%ebp
L38:
  mov    %ebp,%eax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L127:
  mov    0x28(%rsp),%ebp
  jmp    L388
L188:
  mov    $0xffffffff,%ebp
  jmp    L38
L8:
  mov    $0xffffffff,%ebp
  jmp    L38
L272:
  mov    $0xffffffff,%ebp
  jmp    L38
L284:
  mov    $0xffffffff,%ebp
  jmp    L38
```

tool_calls: name: extract_symbolic_data
arguments: label: D52
data_type: f64
name: extract_symbolic_data
arguments: label: D10
data_type: f64
name: extract_symbolic_data
arguments: label: D35
data_type: f64
name: extract_symbolic_data
arguments: label: D119
data_type: f32[2]
name: extract_symbolic_data
arguments: label: D11
data_type: f32[4]

tool: D52: 6371.3

tool: D10: 3.141592653589793

tool: D35: 180

tool: {"D119": [0.0,1.75]}

tool: {"D11": [0.0,1.875,3370280550400.0,2.1426990032196045]}

assistant: ```c
int thickenPoly(double *inX, double *inY, int inN, double *outX, double *outY, int outN, double tol, short units, short keepOrig, short close) {
  const short LL = 0;
  double accDist = 0.0;
  int allocatedSpace = outN;
  int i;
  int ptLast;
  outN = 0;
  if ((close) && ((inX[0] != inX[inN - 1]) || (inY[0] != inY[inN - 1])))
    ptLast = inN;
  else
    ptLast = inN - 1;
  if (!keepOrig && (inN > 0)) {
    if (outN == allocatedSpace)
      return -1;
    outX[outN] = inX[0];
    outY[outN] = inY[0];
    outN++;
  }
  for (i = 0; i < ptLast; i++) {
    int ptCurr = i;
    int ptNext = ((i + 1) == inN) ? 0 : (i + 1);
    double dX = inX[ptNext] - inX[ptCurr];
    double dY = inY[ptNext] - inY[ptCurr];
    double dist;
    if (units == LL) {
      double dlon = (inX[ptNext] - inX[ptCurr]) * 3.14159265358979323846 / 180;
      double dlat = (inY[ptNext] - inY[ptCurr]) * 3.14159265358979323846 / 180;
      double a = (sin(dlat / 2)) * (sin(dlat / 2)) + cos(inY[ptCurr] * 3.14159265358979323846 / 180) * cos(inY[ptNext] * 3.14159265358979323846 / 180) * (sin(dlon / 2)) * (sin(dlon / 2));
      a = sqrt(a);
      if (a > 1)
        a = 1;
      dist = 6371.3 * (2.0 * asin(a));
    } else {
      dist = sqrt((dX * dX) + (dY * dY));
    }
    if (keepOrig) {
      if (outN == allocatedSpace)
        return -1;
      outX[outN] = inX[ptCurr];
      outY[outN] = inY[ptCurr];
      outN++;
      if (dist > tol) {
        int segments = ceil(dist / tol);
        int j;
        for (j = 1; j < segments; j++) {
          if (outN == allocatedSpace)
            return -1;
          outX[outN] = inX[ptCurr] + (dX * ((double)j / segments));
          outY[outN] = inY[ptCurr] + (dY * ((double)j / segments));
          outN++;
        }
      }
    } else {
      accDist += dist;
      while (accDist >= tol) {
        double frac;
        accDist -= tol;
        frac = ((dist - accDist) / dist);
        if (outN == allocatedSpace)
          return -1;
        outX[outN] = inX[ptCurr] + (dX * frac);
        outY[outN] = inY[ptCurr] + (dY * frac);
        outN++;
      }
    }
  }
  return outN;
}
```