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

```asm
<get_edge>:
  endbr64
  push   %r15
  push   %r14
  mov    %rcx,%r14
  push   %r13
  push   %r12
  mov    %rdx,%r12
  lea    0x1(%rsi),%edx
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    0x118(%rsp),%rax
  mov    0x120(%rsp),%rcx
  mov    %edi,0x58(%rsp)
  mov    0x128(%rsp),%r11
  mov    %esi,0x1c(%rsp)
  mov    %r8,0x40(%rsp)
  mov    0x110(%rsp),%r15
  mov    %r9,0x48(%rsp)
  mov    0x130(%rsp),%ebx
  mov    %rax,0x60(%rsp)
  mov    %rcx,0x70(%rsp)
  mov    %r11,0x78(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  lea    0x1(%rdi),%eax
  mov    %edx,0x8(%rsp)
  mov    %eax,0x38(%rsp)
  test   %eax,%eax
  jle    L17
  mov    %edi,%eax
  movsd  D18(%rip),%xmm0
  mov    %r11,%rsi
  lea    0x8(,%rax,8),%rdx
  xor    %eax,%eax
  nop
L67:
  movsd  %xmm0,(%rcx,%rax,1)
  movsd  %xmm0,(%rsi,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L67
L17:
  mov    0x8(%rsp),%r11d
  test   %r11d,%r11d
  jle    L187
  mov    0x1c(%rsp),%eax
  movsd  D18(%rip),%xmm0
  mov    0x60(%rsp),%rcx
  lea    0x8(,%rax,8),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L237:
  movsd  %xmm0,(%r15,%rax,1)
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L237
L187:
  mov    0x58(%rsp),%r13d
  lea    0x2(%r13),%ebp
  mov    %ebp,%edi
  mov    %ebp,0x68(%rsp)
  shl    $0x4,%edi
  call   <malloc@plt>
  mov    %rax,0x28(%rsp)
  mov    0x1c(%rsp),%eax
  lea    0x2(%rax),%edi
  shl    $0x4,%edi
  call   <malloc@plt>
  test   %ebx,%ebx
  mov    0x138(%rsp),%r8d
  mov    0x140(%rsp),%r9d
  setne  %cl
  setne  0x6f(%rsp)
  mov    0x8(%rsp),%edx
  mov    %rax,%rdi
  movzbl %cl,%ecx
  test   %r8d,%r8d
  mov    %rax,0x30(%rsp)
  mov    0x148(%rsp),%r10d
  mov    %ecx,0x3c(%rsp)
  mov    0x38(%rsp),%ecx
  cmovne %r13d,%ecx
  test   %r9d,%r9d
  setne  0x6e(%rsp)
  mov    %ecx,0x18(%rsp)
  setne  %cl
  test   %r10d,%r10d
  cmovne 0x1c(%rsp),%edx
  movzbl %cl,%ecx
  mov    %ecx,0x50(%rsp)
  mov    %edx,0x8(%rsp)
  test   %ebx,%ebx
  je     L223
  mov    %ecx,%r13d
  cmp    %ecx,%edx
  jl     L223
  lea    (%rcx,%rcx,1),%eax
  lea    0xa0(%rsp),%rbx
  mov    %r12,0x20(%rsp)
  cltq
  mov    %r14,0x88(%rsp)
  lea    (%rdi,%rax,8),%rdx
  movslq %ebp,%rax
  mov    %rbx,0x10(%rsp)
  imul   %ecx,%ebp
  lea    0x0(,%rax,8),%r10
  mov    %rax,0x80(%rsp)
  mov    %r15,0x90(%rsp)
  movslq %ebp,%rax
  lea    0xb0(%rsp),%rbp
  lea    0x8(,%rax,8),%rcx
  lea    (%r12,%rcx,1),%r8
  add    %r14,%rcx
  mov    %r13d,%r12d
  mov    %rdx,%r14
  mov    %r10,%r13
  mov    %r8,%r15
  mov    %rcx,%rbx
  xchg   %ax,%ax
L222:
  movsd  -0x8(%r15),%xmm0
  mov    %r14,%rdx
  mov    %rbp,%rsi
  add    $0x1,%r12d
  mov    0x10(%rsp),%rdi
  add    $0x10,%r14
  movsd  %xmm0,0xa0(%rsp)
  movsd  -0x8(%rbx),%xmm0
  movsd  %xmm0,0xa8(%rsp)
  movsd  (%r15),%xmm0
  add    %r13,%r15
  movsd  %xmm0,0xb0(%rsp)
  movsd  (%rbx),%xmm0
  add    %r13,%rbx
  movsd  %xmm0,0xb8(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %r12d,0x8(%rsp)
  jge    L222
  mov    0x8(%rsp),%esi
  mov    0x50(%rsp),%ecx
  mov    0x20(%rsp),%r12
  mov    0x88(%rsp),%r14
  mov    0x90(%rsp),%r15
  mov    0x10(%rsp),%rbx
  cmp    %ecx,%esi
  jle    L223
  movslq 0x38(%rsp),%r9
  movzbl 0x6e(%rsp),%edi
  sub    %ecx,%esi
  mov    %r12,0x88(%rsp)
  sub    $0x1,%esi
  mov    0x30(%rsp),%r11
  mov    %r14,0x90(%rsp)
  mov    %r9,%rax
  add    %rdi,%rsi
  shl    $0x3,%r9
  lea    (%r15,%rdi,8),%r15
  imul   %ecx,%eax
  shl    $0x4,%rsi
  mov    %rbp,0x98(%rsp)
  mov    %r9,%r12
  movslq %eax,%rdx
  mov    0x40(%rsp),%rax
  shl    $0x3,%rdx
  lea    (%rax,%rdx,1),%r8
  lea    (%rcx,%rcx,1),%eax
  add    0x48(%rsp),%rdx
  cltq
  mov    %r8,%r14
  mov    %rdx,%rbp
  lea    (%r11,%rax,8),%r13
  lea    0x10(%r11,%rsi,1),%rax
  mov    %rax,0x20(%rsp)
  nopl   0x0(%rax)
L64:
  movsd  (%r14),%xmm0
  mov    %r13,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r13
  add    %r12,%r14
  add    $0x8,%r15
  movsd  %xmm0,0xa0(%rsp)
  movsd  0x0(%rbp),%xmm0
  add    %r12,%rbp
  movsd  %xmm0,0xa8(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x10(%rsp),%xmm1
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm1
  divsd  %xmm1,%xmm2
  movsd  %xmm2,-0x8(%r15)
  cmp    0x20(%rsp),%r13
  jne    L64
  mov    0x138(%rsp),%eax
  mov    0x88(%rsp),%r12
  mov    0x90(%rsp),%r14
  mov    0x98(%rsp),%rbp
  test   %eax,%eax
  je     L49
L143:
  mov    0x50(%rsp),%r15d
  mov    0x68(%rsp),%ecx
  mov    %r12,0x20(%rsp)
  movslq 0x58(%rsp),%r13
  mov    0x30(%rsp),%rdx
  mov    %r14,0x58(%rsp)
  imul   %r15d,%ecx
  lea    (%r15,%r15,1),%eax
  mov    %rbp,0x10(%rsp)
  mov    0x80(%rsp),%r10
  cltq
  mov    %r13,0x80(%rsp)
  shl    $0x3,%r10
  lea    (%rdx,%rax,8),%rdx
  movslq %ecx,%rcx
  mov    %r10,%rbp
  add    %r13,%rcx
  mov    %rdx,%r13
  shl    $0x3,%rcx
  lea    (%r12,%rcx,1),%r8
  add    %r14,%rcx
  mov    %r15d,%r12d
  mov    %rcx,%r14
  mov    %r8,%r15
L85:
  movsd  (%r15),%xmm0
  mov    0x10(%rsp),%rsi
  mov    %r13,%rdx
  mov    %rbx,%rdi
  add    $0x1,%r12d
  add    $0x10,%r13
  movsd  %xmm0,0xa0(%rsp)
  movsd  (%r14),%xmm0
  movsd  %xmm0,0xa8(%rsp)
  movsd  0x8(%r15),%xmm0
  add    %rbp,%r15
  movsd  %xmm0,0xb0(%rsp)
  movsd  0x8(%r14),%xmm0
  add    %rbp,%r14
  movsd  %xmm0,0xb8(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %r12d,0x8(%rsp)
  jge    L85
  mov    0x8(%rsp),%r10d
  mov    0x50(%rsp),%esi
  mov    0x20(%rsp),%r12
  mov    0x58(%rsp),%r14
  mov    0x80(%rsp),%r13
  cmp    %esi,%r10d
  jle    L49
  movslq 0x38(%rsp),%r8
  mov    0x30(%rsp),%r9
  lea    (%rsi,%rsi,1),%edx
  sub    %esi,%r10d
  movzbl 0x6e(%rsp),%edi
  movslq %edx,%rdx
  mov    0x40(%rsp),%rcx
  mov    %r14,0x50(%rsp)
  mov    %r8,%rax
  lea    (%r9,%rdx,8),%r15
  mov    0x60(%rsp),%rdx
  shl    $0x3,%r8
  imul   %esi,%eax
  lea    -0x1(%r10),%esi
  mov    %r8,%r14
  add    %rdi,%rsi
  lea    (%rdx,%rdi,8),%rbp
  shl    $0x4,%rsi
  cltq
  lea    0x10(%r9,%rsi,1),%rdx
  add    %r13,%rax
  mov    %rdx,0x10(%rsp)
  shl    $0x3,%rax
  add    %rax,%rcx
  add    0x48(%rsp),%rax
  mov    %rcx,%r13
  mov    %rax,%r12
  nopl   0x0(%rax,%rax,1)
L140:
  movsd  0x0(%r13),%xmm0
  mov    %r15,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r15
  add    %r14,%r13
  add    $0x8,%rbp
  movsd  %xmm0,0xa0(%rsp)
  movsd  (%r12),%xmm0
  add    %r14,%r12
  movsd  %xmm0,0xa8(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r15,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x8(%rsp),%xmm2
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,-0x8(%rbp)
  cmp    %r15,0x10(%rsp)
  jne    L140
  mov    0x20(%rsp),%r12
  mov    0x50(%rsp),%r14
L49:
  mov    0x140(%rsp),%esi
  test   %esi,%esi
  je     L35
  mov    0x3c(%rsp),%eax
  cmp    %eax,0x18(%rsp)
  jl     L35
  mov    0x28(%rsp),%rcx
  add    %eax,%eax
  movzbl 0x6f(%rsp),%edi
  lea    0xb0(%rsp),%rbp
  cltq
  lea    0xa0(%rsp),%rbx
  mov    %rbp,0x8(%rsp)
  mov    %r12,%rbp
  lea    (%rcx,%rax,8),%rdx
  movslq 0x68(%rsp),%rcx
  mov    %r14,%r12
  mov    %rdi,%r15
  mov    %rdi,0x20(%rsp)
  mov    %rbx,%r14
  mov    %rdx,%rbx
  add    %rdi,%rcx
  lea    0x0(,%rcx,8),%r13
  nopl   0x0(%rax,%rax,1)
L0:
  movsd  0x0(%rbp,%r15,8),%xmm0
  mov    0x8(%rsp),%rsi
  mov    %rbx,%rdx
  mov    %r14,%rdi
  add    $0x10,%rbx
  movsd  %xmm0,0xa0(%rsp)
  movsd  (%r12,%r15,8),%xmm0
  add    $0x1,%r15
  movsd  %xmm0,0xa8(%rsp)
  movsd  0x0(%rbp,%r13,1),%xmm0
  movsd  %xmm0,0xb0(%rsp)
  movsd  (%r12,%r13,1),%xmm0
  add    $0x8,%r13
  movsd  %xmm0,0xb8(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %r15d,0x18(%rsp)
  jge    L0
  mov    %r14,%rbx
  mov    0x3c(%rsp),%eax
  mov    %r12,%r14
  mov    %rbp,%r12
  mov    0x8(%rsp),%rbp
  cmp    %eax,0x18(%rsp)
  jle    L35
  mov    0x28(%rsp),%rcx
  add    %eax,%eax
  mov    0x20(%rsp),%r15
  mov    %r12,0x10(%rsp)
  cltq
  mov    %r14,0x50(%rsp)
  mov    0x40(%rsp),%r12
  lea    (%rcx,%rax,8),%r13
  mov    %rbp,0x58(%rsp)
  mov    %r15,%rbp
  mov    0x70(%rsp),%r15
  mov    %r13,%r14
  mov    0x48(%rsp),%r13
  nopl   0x0(%rax,%rax,1)
L241:
  movsd  (%r12,%rbp,8),%xmm0
  mov    %r14,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r14
  movsd  %xmm0,0xa0(%rsp)
  movsd  0x0(%r13,%rbp,8),%xmm0
  movsd  %xmm0,0xa8(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r14,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x8(%rsp),%xmm1
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm1
  divsd  %xmm1,%xmm2
  movsd  %xmm2,(%r15,%rbp,8)
  add    $0x1,%rbp
  cmp    %ebp,0x18(%rsp)
  jg     L241
  mov    0x148(%rsp),%edx
  mov    0x10(%rsp),%r12
  mov    0x50(%rsp),%r14
  mov    0x58(%rsp),%rbp
  test   %edx,%edx
  je     L227
L277:
  mov    0x68(%rsp),%edi
  mov    0x1c(%rsp),%eax
  mov    %rbp,0x10(%rsp)
  mov    0x3c(%rsp),%ecx
  mov    0x20(%rsp),%r15
  mov    %rbx,0x8(%rsp)
  imul   %edi,%eax
  lea    (%rcx,%rcx,1),%edx
  mov    0x28(%rsp),%rcx
  movslq %edx,%rdx
  lea    (%rcx,%rdx,8),%rdx
  movslq %eax,%rcx
  add    %edi,%eax
  shl    $0x3,%rcx
  cltq
  mov    %rdx,%rbp
  lea    (%r12,%rcx,1),%r8
  shl    $0x3,%rax
  lea    (%r14,%rcx,1),%r13
  add    %rax,%r12
  add    %rax,%r14
  mov    %r8,%rbx
  nopw   0x0(%rax,%rax,1)
L122:
  movsd  (%rbx,%r15,8),%xmm0
  mov    0x10(%rsp),%rsi
  mov    %rbp,%rdx
  add    $0x10,%rbp
  mov    0x8(%rsp),%rdi
  movsd  %xmm0,0xa0(%rsp)
  movsd  0x0(%r13,%r15,8),%xmm0
  movsd  %xmm0,0xa8(%rsp)
  movsd  (%r12,%r15,8),%xmm0
  movsd  %xmm0,0xb0(%rsp)
  movsd  (%r14,%r15,8),%xmm0
  add    $0x1,%r15
  movsd  %xmm0,0xb8(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %r15d,0x18(%rsp)
  jge    L122
  mov    0x8(%rsp),%rbx
  mov    0x3c(%rsp),%eax
  cmp    %eax,0x18(%rsp)
  jle    L227
  mov    0x38(%rsp),%r14d
  imul   0x1c(%rsp),%r14d
  add    %eax,%eax
  mov    0x40(%rsp),%r15
  mov    0x28(%rsp),%rdx
  cltq
  mov    0x20(%rsp),%rbp
  movslq %r14d,%r14
  lea    (%rdx,%rax,8),%r13
  shl    $0x3,%r14
  add    %r14,%r15
  add    0x48(%rsp),%r14
  mov    %r15,%r12
  mov    %r14,%r15
  mov    0x78(%rsp),%r14
  nopl   (%rax)
L262:
  movsd  (%r12,%rbp,8),%xmm0
  mov    %r13,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r13
  movsd  %xmm0,0xa0(%rsp)
  movsd  (%r15,%rbp,8),%xmm0
  movsd  %xmm0,0xa8(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x8(%rsp),%xmm2
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,(%r14,%rbp,8)
  add    $0x1,%rbp
  cmp    %ebp,0x18(%rsp)
  jg     L262
L227:
  mov    0x28(%rsp),%rdi
  call   <free@plt>
  mov    0x30(%rsp),%rdi
  call   <free@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L84
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L223:
  mov    0x138(%rsp),%edi
  test   %edi,%edi
  je     L49
  mov    0x50(%rsp),%ecx
  cmp    %ecx,0x8(%rsp)
  jl     L49
  movslq 0x68(%rsp),%rax
  lea    0xb0(%rsp),%rbp
  lea    0xa0(%rsp),%rbx
  mov    %rax,0x80(%rsp)
  jmp    L143
  nop
L35:
  mov    0x148(%rsp),%ecx
  test   %ecx,%ecx
  je     L227
  mov    0x3c(%rsp),%edx
  cmp    %edx,0x18(%rsp)
  jl     L227
  movzbl 0x6f(%rsp),%eax
  lea    0xb0(%rsp),%rbp
  lea    0xa0(%rsp),%rbx
  mov    %rax,0x20(%rsp)
  jmp    L277
L84:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: label: D18
data_type: f64

tool: D18: 0.5

assistant: ```c
void get_edge(int nx, int ny, const double *lont, const double *latt, const double *lonc, const double *latc, double *edge_w, double *edge_e, double *edge_s, double *edge_n, int on_west_edge, int on_east_edge, int on_south_edge, int on_north_edge) {
  int i, j, nxp, nyp;
  int istart, iend, jstart, jend;
  double p1[2], p2[2];
  double *py, *px;
  double d1, d2;
  nxp = nx + 1;
  nyp = ny + 1;
  for (i = 0; i < nxp; i++) {
    edge_s[i] = 0.5;
    edge_n[i] = 0.5;
  }
  for (j = 0; j < nyp; j++) {
    edge_w[j] = 0.5;
    edge_e[j] = 0.5;
  }
  px = (double *)malloc(2 * (nx + 2) * sizeof(double));
  py = (double *)malloc(2 * (ny + 2) * sizeof(double));
  if (on_west_edge)
    istart = 1;
  else
    istart = 0;
  if (on_east_edge)
    iend = nx;
  else
    iend = nxp;
  if (on_south_edge)
    jstart = 1;
  else
    jstart = 0;
  if (on_north_edge)
    jend = ny;
  else
    jend = nyp;
  if (on_west_edge) {
    i = 0;
    for (j = jstart; j <= jend; j++) {
      p1[0] = lont[j * (nx + 2) + i];
      p1[1] = latt[j * (nx + 2) + i];
      p2[0] = lont[j * (nx + 2) + i + 1];
      p2[1] = latt[j * (nx + 2) + i + 1];
      mid_pt_sphere(p1, p2, &(py[2 * j]));
    }
    for (j = jstart; j < jend; j++) {
      p1[0] = lonc[j * nxp + i];
      p1[1] = latc[j * nxp + i];
      d1 = great_circle_distance(py + 2 * j, p1);
      d2 = great_circle_distance(py + 2 * (j + 1), p1);
      edge_w[j] = d2 / (d1 + d2);
    }
  }
  if (on_east_edge) {
    i = nx;
    for (j = jstart; j <= jend; j++) {
      p1[0] = lont[j * (nx + 2) + i];
      p1[1] = latt[j * (nx + 2) + i];
      p2[0] = lont[j * (nx + 2) + i + 1];
      p2[1] = latt[j * (nx + 2) + i + 1];
      mid_pt_sphere(p1, p2, &(py[2 * j]));
    }
    for (j = jstart; j < jend; j++) {
      p1[0] = lonc[j * nxp + i];
      p1[1] = latc[j * nxp + i];
      d1 = great_circle_distance(&(py[2 * j]), p1);
      d2 = great_circle_distance(&(py[2 * (j + 1)]), p1);
      edge_e[j] = d2 / (d1 + d2);
    }
  }
  if (on_south_edge) {
    j = 0;
    for (i = istart; i <= iend; i++) {
      p1[0] = lont[j * (nx + 2) + i];
      p1[1] = latt[j * (nx + 2) + i];
      p2[0] = lont[(j + 1) * (nx + 2) + i];
      p2[1] = latt[(j + 1) * (nx + 2) + i];
      mid_pt_sphere(p1, p2, &(px[2 * i]));
    }
    for (i = istart; i < iend; i++) {
      p1[0] = lonc[j * nxp + i];
      p1[1] = latc[j * nxp + i];
      d1 = great_circle_distance(&(px[2 * i]), p1);
      d2 = great_circle_distance(&(px[2 * (i + 1)]), p1);
      edge_s[i] = d2 / (d1 + d2);
    }
  }
  if (on_north_edge) {
    j = ny;
    for (i = istart; i <= iend; i++) {
      p1[0] = lont[j * (nx + 2) + i];
      p1[1] = latt[j * (nx + 2) + i];
      p2[0] = lont[(j + 1) * (nx + 2) + i];
      p2[1] = latt[(j + 1) * (nx + 2) + i];
      mid_pt_sphere(p1, p2, &(px[2 * i]));
    }
    for (i = istart; i < iend; i++) {
      p1[0] = lonc[j * nxp + i];
      p1[1] = latc[j * nxp + i];
      d1 = great_circle_distance(&(px[2 * i]), p1);
      d2 = great_circle_distance(&(px[2 * (i + 1)]), p1);
      edge_n[i] = d2 / (d1 + d2);
    }
  }
  free(px);
  free(py);
}
```