user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<get_edge>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdx,%r14
  lea    0x1(%rdi),%edx
  push   %r13
  push   %r12
  lea    0x1(%rsi),%r12d
  push   %rbp
  push   %rbx
  sub    $0xd8,%rsp
  mov    %rcx,0x28(%rsp)
  mov    0x118(%rsp),%rax
  mov    0x128(%rsp),%rcx
  mov    %edi,0x50(%rsp)
  mov    %esi,0x40(%rsp)
  mov    0x110(%rsp),%r15
  mov    %r8,0x60(%rsp)
  mov    0x120(%rsp),%rbp
  mov    %r9,0x68(%rsp)
  mov    0x130(%rsp),%ebx
  mov    %rax,0x20(%rsp)
  mov    %rcx,0x30(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  mov    %edx,0x44(%rsp)
  test   %edx,%edx
  jle    L295
  lea    0x8(%rbp),%rax
  cmp    %rax,%rcx
  je     L276
  cmp    $0x3,%edi
  jbe    L276
  shr    %edx
  movapd D19(%rip),%xmm0
  xor    %eax,%eax
  shl    $0x4,%rdx
  nopl   0x0(%rax,%rax,1)
L201:
  movups %xmm0,0x0(%rbp,%rax,1)
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L201
  mov    0x44(%rsp),%ecx
  mov    %ecx,%eax
  and    $0xfffffffe,%eax
  and    $0x1,%ecx
  je     L295
  movsd  D19(%rip),%xmm0
  mov    0x30(%rsp),%rcx
  cltq
  movsd  %xmm0,0x0(%rbp,%rax,8)
  movsd  %xmm0,(%rcx,%rax,8)
L295:
  test   %r12d,%r12d
  jle    L349
  mov    0x20(%rsp),%rcx
  lea    0x8(%r15),%rax
  cmp    %rax,%rcx
  je     L375
  cmpl   $0x3,0x40(%rsp)
  jbe    L375
  mov    %r12d,%edx
  movapd D19(%rip),%xmm0
  xor    %eax,%eax
  shr    %edx
  shl    $0x4,%rdx
  nop
L336:
  movups %xmm0,(%r15,%rax,1)
  movups %xmm0,(%rcx,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L336
  mov    %r12d,%eax
  and    $0xfffffffe,%eax
  test   $0x1,%r12b
  je     L349
  movsd  D19(%rip),%xmm0
  mov    0x20(%rsp),%rcx
  cltq
  movsd  %xmm0,(%r15,%rax,8)
  movsd  %xmm0,(%rcx,%rax,8)
L349:
  mov    0x50(%rsp),%eax
  lea    0x2(%rax),%r13d
  mov    %r13d,%edi
  mov    %r13d,0x78(%rsp)
  shl    $0x4,%edi
  call   <malloc@plt>
  mov    0x40(%rsp),%esi
  mov    %rax,0x48(%rsp)
  lea    0x2(%rsi),%edi
  shl    $0x4,%edi
  call   <malloc@plt>
  test   %ebx,%ebx
  mov    0x138(%rsp),%r8d
  mov    0x140(%rsp),%r9d
  setne  %dl
  mov    0x148(%rsp),%r10d
  setne  0x7f(%rsp)
  mov    %rax,%rdi
  movzbl %dl,%edx
  test   %r8d,%r8d
  mov    %rax,0x58(%rsp)
  mov    %edx,0x70(%rsp)
  mov    0x44(%rsp),%edx
  cmovne 0x50(%rsp),%edx
  test   %r9d,%r9d
  setne  %cl
  setne  0x7e(%rsp)
  test   %r10d,%r10d
  cmovne 0x40(%rsp),%r12d
  movzbl %cl,%ecx
  mov    %edx,0xc(%rsp)
  mov    %ecx,0x74(%rsp)
  mov    %r12d,0x10(%rsp)
  test   %ebx,%ebx
  je     L188
  cmp    %ecx,%r12d
  jl     L188
  lea    (%rcx,%rcx,1),%eax
  mov    %ecx,%r12d
  lea    0xa0(%rsp),%rbx
  mov    %r14,0x38(%rsp)
  cltq
  mov    %r15,0x88(%rsp)
  lea    (%rdi,%rax,8),%rdx
  movslq %r13d,%rax
  mov    %rbx,0x18(%rsp)
  imul   %ecx,%r13d
  lea    0x0(,%rax,8),%r10
  mov    %rax,0x80(%rsp)
  mov    %rbp,0x90(%rsp)
  mov    %r12d,%ebp
  mov    %r10,%r12
  movslq %r13d,%rax
  lea    0xb0(%rsp),%r13
  lea    0x8(,%rax,8),%rcx
  lea    (%r14,%rcx,1),%r8
  add    0x28(%rsp),%rcx
  mov    %rdx,%r14
  mov    %r8,%r15
  mov    %rcx,%rbx
  cs nopw 0x0(%rax,%rax,1)
L20:
  movsd  -0x8(%r15),%xmm0
  mov    %r14,%rdx
  mov    %r13,%rsi
  add    $0x1,%ebp
  mov    0x18(%rsp),%rdi
  add    $0x10,%r14
  movhpd -0x8(%rbx),%xmm0
  movaps %xmm0,0xa0(%rsp)
  movsd  (%r15),%xmm0
  add    %r12,%r15
  movhpd (%rbx),%xmm0
  add    %r12,%rbx
  movaps %xmm0,0xb0(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %ebp,0x10(%rsp)
  jge    L20
  mov    0x10(%rsp),%esi
  mov    0x74(%rsp),%r11d
  mov    0x38(%rsp),%r14
  mov    0x88(%rsp),%r15
  mov    0x90(%rsp),%rbp
  mov    0x18(%rsp),%rbx
  cmp    %r11d,%esi
  jle    L188
  movslq 0x44(%rsp),%r8
  movzbl 0x7e(%rsp),%edi
  sub    %r11d,%esi
  mov    %r14,0x88(%rsp)
  sub    $0x1,%esi
  mov    0x58(%rsp),%r9
  mov    %r13,0x98(%rsp)
  mov    %r8,%rax
  add    %rdi,%rsi
  shl    $0x3,%r8
  lea    (%r15,%rdi,8),%r15
  imul   %r11d,%eax
  shl    $0x4,%rsi
  mov    %r8,%r13
  movslq %eax,%rdx
  mov    0x60(%rsp),%rax
  shl    $0x3,%rdx
  lea    (%rax,%rdx,1),%rcx
  lea    (%r11,%r11,1),%eax
  add    0x68(%rsp),%rdx
  cltq
  mov    %rcx,%r14
  mov    %rdx,%rbp
  lea    (%r9,%rax,8),%r12
  lea    0x10(%r9,%rsi,1),%rax
  mov    %rax,0x38(%rsp)
L82:
  movsd  (%r14),%xmm0
  mov    %r12,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r12
  add    %r13,%r14
  add    $0x8,%r15
  movhpd 0x0(%rbp),%xmm0
  add    %r13,%rbp
  movaps %xmm0,0xa0(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r12,%rdi
  movsd  %xmm0,0x18(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x18(%rsp),%xmm1
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm1
  divsd  %xmm1,%xmm2
  movsd  %xmm2,-0x8(%r15)
  cmp    0x38(%rsp),%r12
  jne    L82
  mov    0x138(%rsp),%eax
  mov    0x88(%rsp),%r14
  mov    0x90(%rsp),%rbp
  mov    0x98(%rsp),%r13
  test   %eax,%eax
  je     L8
L352:
  mov    0x74(%rsp),%r15d
  mov    0x78(%rsp),%ecx
  mov    %r14,0x38(%rsp)
  movslq 0x50(%rsp),%r12
  mov    0x58(%rsp),%rsi
  mov    %rbp,0x50(%rsp)
  imul   %r15d,%ecx
  lea    (%r15,%r15,1),%eax
  mov    %r13,0x18(%rsp)
  mov    %r15d,%ebp
  mov    0x80(%rsp),%r10
  cltq
  mov    %r12,0x80(%rsp)
  lea    (%rsi,%rax,8),%rdx
  movslq %ecx,%rcx
  shl    $0x3,%r10
  add    %r12,%rcx
  mov    %r10,%r13
  mov    %rdx,%r12
  shl    $0x3,%rcx
  lea    (%r14,%rcx,1),%r8
  add    0x28(%rsp),%rcx
  mov    %rcx,%r14
  mov    %r8,%r15
  nopl   0x0(%rax,%rax,1)
L146:
  movsd  (%r15),%xmm0
  mov    0x18(%rsp),%rsi
  mov    %r12,%rdx
  mov    %rbx,%rdi
  add    $0x1,%ebp
  add    $0x10,%r12
  movhpd (%r14),%xmm0
  movaps %xmm0,0xa0(%rsp)
  movsd  0x8(%r15),%xmm0
  add    %r13,%r15
  movhpd 0x8(%r14),%xmm0
  add    %r13,%r14
  movaps %xmm0,0xb0(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %ebp,0x10(%rsp)
  jge    L146
  mov    0x10(%rsp),%r10d
  mov    0x74(%rsp),%esi
  mov    0x38(%rsp),%r14
  mov    0x50(%rsp),%rbp
  mov    0x80(%rsp),%r12
  cmp    %esi,%r10d
  jle    L8
  movslq 0x44(%rsp),%r8
  mov    0x58(%rsp),%r9
  lea    (%rsi,%rsi,1),%edx
  sub    %esi,%r10d
  movzbl 0x7e(%rsp),%edi
  movslq %edx,%rdx
  mov    0x60(%rsp),%rcx
  mov    %rbp,0x38(%rsp)
  mov    %r8,%rax
  lea    (%r9,%rdx,8),%r15
  mov    0x20(%rsp),%rdx
  shl    $0x3,%r8
  imul   %esi,%eax
  lea    -0x1(%r10),%esi
  mov    %r14,0x20(%rsp)
  mov    %r8,%r14
  add    %rdi,%rsi
  lea    (%rdx,%rdi,8),%r13
  shl    $0x4,%rsi
  cltq
  add    %r12,%rax
  lea    0x10(%r9,%rsi,1),%r12
  shl    $0x3,%rax
  mov    %r12,0x18(%rsp)
  mov    %r13,%r12
  add    %rax,%rcx
  add    0x68(%rsp),%rax
  mov    %rax,%r13
  mov    %rcx,%rbp
  nopl   (%rax)
L361:
  movsd  0x0(%rbp),%xmm0
  mov    %r15,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r15
  add    %r14,%rbp
  add    $0x8,%r12
  movhpd 0x0(%r13),%xmm0
  add    %r14,%r13
  movaps %xmm0,0xa0(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r15,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,-0x8(%r12)
  cmp    %r15,0x18(%rsp)
  jne    L361
  mov    0x20(%rsp),%r14
  mov    0x38(%rsp),%rbp
L8:
  mov    0x140(%rsp),%esi
  test   %esi,%esi
  je     L1
  mov    0x70(%rsp),%eax
  cmp    %eax,0xc(%rsp)
  jl     L1
  movzbl 0x7f(%rsp),%ecx
  movslq 0x78(%rsp),%r15
  add    %eax,%eax
  mov    %rbp,0x10(%rsp)
  mov    0x48(%rsp),%rsi
  cltq
  lea    0xa0(%rsp),%rbx
  lea    0xb0(%rsp),%r13
  add    %rcx,%r15
  mov    %rcx,0x20(%rsp)
  mov    %rbx,%rbp
  mov    %rcx,%r12
  lea    (%rsi,%rax,8),%rdx
  shl    $0x3,%r15
  mov    %r14,%rax
  mov    %rdx,%rbx
  mov    %r15,%r14
  mov    %rax,%r15
  xchg   %ax,%ax
L116:
  movsd  (%r15,%r12,8),%xmm0
  mov    %rbx,%rdx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  mov    0x28(%rsp),%rax
  add    $0x10,%rbx
  movhpd (%rax,%r12,8),%xmm0
  add    $0x1,%r12
  movaps %xmm0,0xa0(%rsp)
  movsd  (%r15,%r14,1),%xmm0
  movhpd (%rax,%r14,1),%xmm0
  add    $0x8,%r14
  movaps %xmm0,0xb0(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %r12d,0xc(%rsp)
  jge    L116
  mov    %rbp,%rbx
  mov    0x70(%rsp),%eax
  mov    0x10(%rsp),%rbp
  mov    %r15,%r14
  cmp    %eax,0xc(%rsp)
  jle    L1
  mov    0x48(%rsp),%rcx
  add    %eax,%eax
  mov    0x20(%rsp),%r12
  mov    %r14,0x18(%rsp)
  cltq
  mov    %r13,0x38(%rsp)
  lea    (%rcx,%rax,8),%r15
  mov    %r12,%r14
  mov    0x68(%rsp),%r12
  mov    %r15,%r13
  mov    %rbp,%r15
  mov    0x60(%rsp),%rbp
  cs nopw 0x0(%rax,%rax,1)
L260:
  movsd  0x0(%rbp,%r14,8),%xmm0
  mov    %r13,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r13
  movhpd (%r12,%r14,8),%xmm0
  movaps %xmm0,0xa0(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r13,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,(%r15,%r14,8)
  add    $0x1,%r14
  cmp    %r14d,0xc(%rsp)
  jg     L260
  mov    0x148(%rsp),%edx
  mov    0x18(%rsp),%r14
  mov    0x38(%rsp),%r13
  test   %edx,%edx
  je     L96
L210:
  mov    0x78(%rsp),%ecx
  mov    0x40(%rsp),%eax
  mov    0x70(%rsp),%esi
  mov    0x48(%rsp),%rdi
  imul   %ecx,%eax
  mov    0x20(%rsp),%r15
  lea    (%rsi,%rsi,1),%edx
  mov    0x28(%rsp),%rsi
  movslq %edx,%rdx
  lea    (%rdi,%rdx,8),%r12
  movslq %eax,%rdx
  add    %ecx,%eax
  shl    $0x3,%rdx
  cltq
  lea    (%r14,%rdx,1),%rbp
  shl    $0x3,%rax
  add    %rsi,%rdx
  add    %rax,%r14
  mov    %rdx,0x10(%rsp)
  add    %rsi,%rax
  mov    %rax,0x18(%rsp)
  mov    %r13,%rax
  mov    %rbp,%r13
  mov    %r14,%rbp
  mov    %rax,%r14
  nopl   0x0(%rax,%rax,1)
L149:
  movsd  0x0(%r13,%r15,8),%xmm0
  mov    %r12,%rdx
  mov    %r14,%rsi
  mov    %rbx,%rdi
  mov    0x10(%rsp),%rax
  add    $0x10,%r12
  movhpd (%rax,%r15,8),%xmm0
  mov    0x18(%rsp),%rax
  movaps %xmm0,0xa0(%rsp)
  movsd  0x0(%rbp,%r15,8),%xmm0
  movhpd (%rax,%r15,8),%xmm0
  add    $0x1,%r15
  movaps %xmm0,0xb0(%rsp)
  call   <mid_pt_sphere@plt>
  cmp    %r15d,0xc(%rsp)
  jge    L149
  mov    0x70(%rsp),%eax
  cmp    %eax,0xc(%rsp)
  jle    L96
  mov    0x44(%rsp),%r12d
  imul   0x40(%rsp),%r12d
  add    %eax,%eax
  mov    0x48(%rsp),%rcx
  mov    0x60(%rsp),%r15
  cltq
  mov    0x20(%rsp),%r13
  movslq %r12d,%r12
  lea    (%rcx,%rax,8),%rbp
  shl    $0x3,%r12
  add    %r12,%r15
  add    0x68(%rsp),%r12
  mov    %r15,%r14
  mov    %rbp,%r15
  mov    0x30(%rsp),%rbp
  nopl   0x0(%rax,%rax,1)
L217:
  movsd  (%r14,%r13,8),%xmm0
  mov    %r15,%rdi
  mov    %rbx,%rsi
  add    $0x10,%r15
  movhpd (%r12,%r13,8),%xmm0
  movaps %xmm0,0xa0(%rsp)
  call   <great_circle_distance@plt>
  mov    %rbx,%rsi
  mov    %r15,%rdi
  movsd  %xmm0,0x10(%rsp)
  call   <great_circle_distance@plt>
  movsd  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm1
  addsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movsd  %xmm1,0x0(%rbp,%r13,8)
  add    $0x1,%r13
  cmp    %r13d,0xc(%rsp)
  jg     L217
L96:
  mov    0x48(%rsp),%rdi
  call   <free@plt>
  mov    0x58(%rsp),%rdi
  call   <free@plt>
  mov    0xc8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L162
  add    $0xd8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L188:
  mov    0x138(%rsp),%edi
  test   %edi,%edi
  je     L8
  mov    0x74(%rsp),%esi
  cmp    %esi,0x10(%rsp)
  jl     L8
  movslq 0x78(%rsp),%rax
  lea    0xb0(%rsp),%r13
  lea    0xa0(%rsp),%rbx
  mov    %rax,0x80(%rsp)
  jmp    L352
  nopw   0x0(%rax,%rax,1)
L1:
  mov    0x148(%rsp),%ecx
  test   %ecx,%ecx
  je     L96
  mov    0x70(%rsp),%edx
  cmp    %edx,0xc(%rsp)
  jl     L96
  movzbl 0x7f(%rsp),%eax
  lea    0xb0(%rsp),%r13
  lea    0xa0(%rsp),%rbx
  mov    %rax,0x20(%rsp)
  jmp    L210
  nopl   0x0(%rax)
L375:
  mov    0x40(%rsp),%eax
  movsd  D19(%rip),%xmm0
  mov    0x20(%rsp),%rcx
  lea    0x8(,%rax,8),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L196:
  movsd  %xmm0,(%r15,%rax,1)
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L196
  jmp    L349
  nopl   0x0(%rax)
L276:
  mov    0x50(%rsp),%eax
  movsd  D19(%rip),%xmm0
  mov    0x30(%rsp),%rcx
  lea    0x8(,%rax,8),%rdx
  xor    %eax,%eax
  nopl   0x0(%rax,%rax,1)
L218:
  movsd  %xmm0,0x0(%rbp,%rax,1)
  movsd  %xmm0,(%rcx,%rax,1)
  add    $0x8,%rax
  cmp    %rdx,%rax
  jne    L218
  jmp    L295
L162:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: tag: D19
data_type: f64[2]

tool: {"D19": [0.5,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);
}
```