user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<new_grid_lambertc>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,%r13d
  mov    %esi,%r14d
  movapd %xmm0,%xmm8
  movq   %xmm6,%r15
  movq   %xmm7,%rbx
  mov    %rdx,%rbp
  mov    %rcx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movsd  D20(%rip),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  %xmm2,(%rsp)
  mulsd  %xmm0,%xmm3
  movsd  %xmm3,0x8(%rsp)
  mulsd  %xmm0,%xmm4
  movsd  %xmm4,0x10(%rsp)
  mulsd  %xmm0,%xmm5
  movsd  %xmm5,0x18(%rsp)
  mulsd  %xmm0,%xmm8
  movsd  %xmm8,0x20(%rsp)
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,0x28(%rsp)
  pxor   %xmm7,%xmm7
  movapd %xmm7,%xmm6
  movq   %rbx,%xmm1
  movq   %r15,%xmm0
  call   <lamccforint@plt>
  test   %rax,%rax
  jne    L97
L25:
  lea    0x40(%rsp),%rsi
  lea    0x38(%rsp),%rdi
  movsd  0x28(%rsp),%xmm1
  movsd  0x20(%rsp),%xmm0
  call   <lamccfor@plt>
  test   %rax,%rax
  jne    L119
L64:
  sub    $0x1,%r13d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r13d,%xmm0
  movsd  D11(%rip),%xmm2
  mulsd  %xmm2,%xmm0
  mulsd  0xa0(%rsp),%xmm0
  movsd  0x38(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x38(%rsp)
  sub    $0x1,%r14d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r14d,%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  0xa8(%rsp),%xmm0
  movsd  0x40(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  %xmm1,0x40(%rsp)
  pxor   %xmm7,%xmm7
  movapd %xmm7,%xmm6
  movsd  0x18(%rsp),%xmm5
  movsd  0x10(%rsp),%xmm4
  movsd  0x8(%rsp),%xmm3
  movsd  (%rsp),%xmm2
  movq   %rbx,%xmm1
  movq   %r15,%xmm0
  call   <lamccinvint@plt>
  test   %rax,%rax
  jne    L72
L14:
  lea    0x50(%rsp),%rsi
  lea    0x48(%rsp),%rdi
  movsd  0x40(%rsp),%xmm1
  movsd  0x38(%rsp),%xmm0
  call   <lamccinv@plt>
  test   %rax,%rax
  jne    L78
L63:
  movsd  D84(%rip),%xmm0
  movapd %xmm0,%xmm1
  mulsd  0x48(%rsp),%xmm1
  movsd  %xmm1,0x48(%rsp)
  mulsd  0x50(%rsp),%xmm0
  pxor   %xmm2,%xmm2
  comisd %xmm1,%xmm2
  ja     L43
L116:
  movsd  0x48(%rsp),%xmm1
  comisd D71(%rip),%xmm1
  jb     L82
  subsd  D71(%rip),%xmm1
  movsd  %xmm1,0x48(%rsp)
L82:
  movsd  0x48(%rsp),%xmm1
  movsd  %xmm1,0x0(%rbp)
  movsd  %xmm0,(%r12)
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L36
  mov    $0x0,%eax
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L97:
  mov    %rax,%rsi
  lea    D60(%rip),%rdi
  call   <fatal_error_i@plt>
  jmp    L25
L119:
  mov    %rax,%rsi
  lea    D87(%rip),%rdi
  call   <fatal_error_i@plt>
  jmp    L64
L72:
  mov    %rax,%rsi
  lea    D28(%rip),%rdi
  call   <fatal_error_i@plt>
  jmp    L14
L78:
  mov    %rax,%rsi
  lea    D68(%rip),%rdi
  call   <fatal_error_i@plt>
  jmp    L63
L43:
  addsd  D71(%rip),%xmm1
  movsd  %xmm1,0x48(%rsp)
  jmp    L116
L36:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D20
type: byte[8]
name: read_data
arguments: tag: D11
type: f64
name: read_data
arguments: tag: D84
type: byte[8]
name: read_data
arguments: tag: D71
type: f64
name: read_data
arguments: tag: D60
type: string
name: read_data
arguments: tag: D87
type: string
name: read_data
arguments: tag: D28
type: string
name: read_data
arguments: tag: D68
type: string

tool: {"D20": [0x39,0x9d,0x52,0xa2,0x46,0xdf,0x91,0x3f]}

tool: D11: 0.5

tool: {"D84": [0xf8,0xc1,0x63,0x1a,0xdc,0xa5,0x4c,0x40]}

tool: D71: 360

tool: D60: new_grid_lambertc lamccforint: returns %ld

tool: D87: new_grid_lambertc lamccfor: returns %ld

tool: D28: new_grid_lambertc lamccinvint: returns %ld

tool: D68: new_grid_lambertc lamccinv: returns %ld

assistant: ```c
int new_grid_lambertc(int nx, int ny, double center_lon, double center_lat, double true_lat1, double true_lat2, double stand_lon, double stand_lat, double r_maj, double r_min, double dx, double dy, double *lon_0, double *lat_0) {
  double x_0, y_0, rlon, rlat;
  double false_east, false_north;
  long long_i;
  true_lat1 *= (3.14159265358979323846 / 180.0);
  true_lat2 *= (3.14159265358979323846 / 180.0);
  stand_lon *= (3.14159265358979323846 / 180.0);
  stand_lat *= (3.14159265358979323846 / 180.0);
  center_lon *= (3.14159265358979323846 / 180.0);
  center_lat *= (3.14159265358979323846 / 180.0);
  false_east = false_north = 0.0;
  long_i = lamccforint(r_maj, r_min, true_lat1, true_lat2, stand_lon, stand_lat, false_east, false_north);
  if (long_i)
    fatal_error_i("new_grid_lambertc lamccforint: returns %ld", long_i);
  long_i = lamccfor(center_lon, center_lat, &x_0, &y_0);
  if (long_i)
    fatal_error_i("new_grid_lambertc lamccfor: returns %ld", long_i);
  x_0 = x_0 - dx * ((nx - 1) * 0.5);
  y_0 = y_0 - dy * ((ny - 1) * 0.5);
  long_i = lamccinvint(r_maj, r_min, true_lat1, true_lat2, stand_lon, stand_lat, false_east, false_north);
  if (long_i)
    fatal_error_i("new_grid_lambertc lamccinvint: returns %ld", long_i);
  long_i = lamccinv(x_0, y_0, &rlon, &rlat);
  if (long_i)
    fatal_error_i("new_grid_lambertc lamccinv: returns %ld", long_i);
  rlon *= (180.0 / 3.14159265358979323846);
  rlat *= (180.0 / 3.14159265358979323846);
  if (rlon < 0.0)
    rlon += 360.0;
  if (rlon >= 360.0)
    rlon -= 360.0;
  *lon_0 = rlon;
  *lat_0 = rlat;
  return 0;
}
```