user: Translate the below assembly code into C programming language:

```asm
<mod_huiliers_area2>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rdx,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  pxor   %xmm4,%xmm4
  movsd  %xmm4,(%rsp)
  cmp    $0x2,%edi
  jg     L116
L138:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L87
  movsd  (%rsp),%xmm0
  add    $0x78,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L116:
  mov    %edi,%r13d
  mov    %rsi,%r14
  mov    %rdx,%r15
  lea    0x10(%rsp),%rdi
  call   <lonlat_to_xyz@plt>
  lea    0x30(%rsp),%rdi
  movsd  (%r15),%xmm1
  movsd  (%r14),%xmm0
  call   <lonlat_to_xyz@plt>
  lea    0x8(%r14),%rbx
  lea    0x8(%r15),%rbp
  lea    -0x2(%r13),%eax
  lea    0x10(%r14,%rax,8),%r15
  pxor   %xmm5,%xmm5
  movsd  %xmm5,(%rsp)
  lea    0x50(%rsp),%r12
  jmp    L137
L13:
  mov    %r12,%rdi
  movsd  0x0(%rbp),%xmm1
  call   <lonlat_to_xyz@plt>
  lea    0x30(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  mov    %r12,%rdx
  call   <mod_tri_area@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  movsd  0x50(%rsp),%xmm0
  movsd  %xmm0,0x30(%rsp)
  movsd  0x58(%rsp),%xmm0
  movsd  %xmm0,0x38(%rsp)
  movsd  0x60(%rsp),%xmm0
  movsd  %xmm0,0x40(%rsp)
L47:
  add    $0x8,%rbx
  add    $0x8,%rbp
  cmp    %r15,%rbx
  je     L45
L137:
  movsd  (%rbx),%xmm0
  movsd  -0x8(%rbx),%xmm1
  comisd %xmm0,%xmm1
  ja     L13
  comisd %xmm1,%xmm0
  ja     L13
  movsd  0x0(%rbp),%xmm2
  movsd  -0x8(%rbp),%xmm1
  comisd %xmm2,%xmm1
  ja     L13
  comisd %xmm1,%xmm2
  ja     L13
  jmp    L47
L45:
  movsd  (%r14),%xmm0
  movslq %r13d,%r13
  shl    $0x3,%r13
  movsd  -0x8(%r14,%r13,1),%xmm1
  comisd %xmm0,%xmm1
  ja     L110
  comisd %xmm1,%xmm0
  ja     L110
  mov    0x8(%rsp),%rax
  movsd  (%rax),%xmm2
  movsd  -0x8(%rax,%r13,1),%xmm1
  comisd %xmm2,%xmm1
  ja     L110
  comisd %xmm1,%xmm2
  jbe    L138
L110:
  lea    0x50(%rsp),%rbx
  mov    %rbx,%rdi
  mov    0x8(%rsp),%rax
  movsd  (%rax),%xmm1
  call   <lonlat_to_xyz@plt>
  lea    0x30(%rsp),%rsi
  lea    0x10(%rsp),%rdi
  mov    %rbx,%rdx
  call   <mod_tri_area@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %rax,%xmm0
  addsd  (%rsp),%xmm0
  movsd  %xmm0,(%rsp)
  jmp    L138
L87:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
double mod_huiliers_area2(int num_corners, double *cell_corner_lon, double *cell_corner_lat, double cell_center_lon, double cell_center_lat) {
  if (num_corners < 3)
    return 0;
  double sum = 0.0;
  double pnt1[3], pnt2[3], pnt3[3];
  lonlat_to_xyz(cell_center_lon, cell_center_lat, pnt1);
  lonlat_to_xyz(cell_corner_lon[0], cell_corner_lat[0], pnt2);
  for (int i = 1; i < num_corners; i++) {
    if ((!(cell_corner_lon[i] < cell_corner_lon[i - 1] || cell_corner_lon[i - 1] < cell_corner_lon[i])) && (!(cell_corner_lat[i] < cell_corner_lat[i - 1] || cell_corner_lat[i - 1] < cell_corner_lat[i])))
      continue;
    lonlat_to_xyz(cell_corner_lon[i], cell_corner_lat[i], pnt3);
    sum += mod_tri_area(pnt1, pnt2, pnt3);
    pnt2[0] = pnt3[0];
    pnt2[1] = pnt3[1];
    pnt2[2] = pnt3[2];
  }
  if (!((!(cell_corner_lon[0] < cell_corner_lon[num_corners - 1] || cell_corner_lon[num_corners - 1] < cell_corner_lon[0])) && (!(cell_corner_lat[0] < cell_corner_lat[num_corners - 1] || cell_corner_lat[num_corners - 1] < cell_corner_lat[0])))) {
    lonlat_to_xyz(cell_corner_lon[0], cell_corner_lat[0], pnt3);
    sum += mod_tri_area(pnt1, pnt2, pnt3);
  }
  return (sum);
}
```