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

```asm
<moontransit>:
  endbr64
  push   %r15
  mov    %edx,%r15d
  push   %r14
  mov    %edi,%r14d
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %rcx,0x38(%rsp)
  lea    0x50(%rsp),%r12
  lea    0x48(%rsp),%rbp
  movsd  %xmm2,0x30(%rsp)
  movsd  D53(%rip),%xmm2
  lea    0x40(%rsp),%rbx
  movsd  %xmm0,0x20(%rsp)
  movsd  %xmm1,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  mov    %rcx,%rax
  movl   $0x1f,0x1c(%rsp)
  movl   $0x0,(%rax)
  nopl   0x0(%rax,%rax,1)
L37:
  mov    %r15d,%edx
  mov    %r13d,%esi
  mov    %r14d,%edi
  movsd  %xmm2,0x10(%rsp)
  movsd  D44(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  divsd  D43(%rip),%xmm0
  call   <days@plt>
  movapd %xmm0,%xmm1
  movsd  0x20(%rsp),%xmm0
  divsd  D5(%rip),%xmm0
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm1,0x8(%rsp)
  call   <gst@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  addsd  0x30(%rsp),%xmm0
  movsd  0x8(%rsp),%xmm1
  movsd  %xmm0,(%rsp)
  movapd %xmm1,%xmm0
  call   <moonpos@plt>
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  movsd  0x8(%rsp),%xmm1
  movapd %xmm1,%xmm0
  call   <equatorial@plt>
  movsd  (%rsp),%xmm0
  mov    %r12,%rdx
  mov    %rbp,%rsi
  movsd  0x28(%rsp),%xmm1
  mov    %rbx,%rdi
  call   <topo@plt>
  movsd  (%rsp),%xmm0
  subsd  0x40(%rsp),%xmm0
  call   <rangerad@plt>
  movsd  0x10(%rsp),%xmm2
  movapd %xmm0,%xmm1
  movapd %xmm2,%xmm0
  movsd  %xmm2,(%rsp)
  subsd  %xmm1,%xmm0
  call   <rangerad@plt>
  subl   $0x1,0x1c(%rsp)
  movapd %xmm0,%xmm2
  je     L18
  movsd  (%rsp),%xmm0
  subsd  %xmm2,%xmm0
  andpd  D24(%rip),%xmm0
  comisd D32(%rip),%xmm0
  ja     L37
L34:
  mov    0x58(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x68,%rsp
  movapd %xmm2,%xmm0
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L18:
  mov    0x38(%rsp),%rax
  movl   $0x1,(%rax)
  jmp    L34
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D53
datatype: byte[8]
name: read_data
arguments: tag: D44
datatype: f64
name: read_data
arguments: tag: D43
datatype: byte[8]
name: read_data
arguments: tag: D5
datatype: byte[8]
name: read_data
arguments: tag: D24
datatype: qword[2]
name: read_data
arguments: tag: D32
datatype: byte[16]

tool: {"D53": [0x1a,0x2d,0x44,0x54,0xfb,0x21,0x09,0x40]}

tool: D44: 57.2957795130823

tool: {"D43": [0x00,0x00,0x00,0x00,0x00,0x00,0x2e,0x40]}

tool: {"D5": [0x00,0x00,0x00,0x00,0x00,0x00,0x38,0x40]}

tool: {"D24": [0x7fffffffffffffff,0x0000000000000000]}

tool: {"D32": [0x92,0x81,0x5f,0x69,0x5a,0xe0,0x46,0x3f,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
double moontransit(int y, int m, int d, double tz, double glat, double glong, int *notransit) {
  double hm, ht, ht1, lon, lat, rv, dnew, lst;
  int itcount;
  ht1 = 180 * 0.0174532925199433;
  ht = 0;
  itcount = 0;
  *notransit = 0;
  do {
    ht = ht1;
    itcount++;
    dnew = days(y, m, d, ht * 57.2957795130823 / 15) - tz / 24;
    lst = gst(dnew) + glong;
    moonpos(dnew, &lon, &lat, &rv);
    equatorial(dnew, &lon, &lat, &rv);
    topo(lst, glat, &lon, &lat, &rv);
    hm = rangerad(lst - lon);
    ht1 = rangerad(ht - hm);
    if (itcount > 30) {
      *notransit = 1;
      break;
    }
  } while (fabs(ht - ht1) > 0.04 * 0.0174532925199433);
  return (ht1);
}
```