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

```asm
<ephcom_cal2jd>:
  endbr64
  pxor   %xmm1,%xmm1
  pxor   %xmm2,%xmm2
  mov    (%rdi),%eax
  mov    0x4(%rdi),%ecx
  cvtsi2sdl 0x14(%rdi),%xmm1
  movsd  D7(%rip),%xmm0
  cvtsi2sdl 0x10(%rdi),%xmm2
  divsd  %xmm0,%xmm1
  addsd  %xmm2,%xmm1
  divsd  %xmm0,%xmm1
  pxor   %xmm0,%xmm0
  cvtsi2sdl 0xc(%rdi),%xmm0
  mov    0x8(%rdi),%edi
  addsd  %xmm0,%xmm1
  divsd  D21(%rip),%xmm1
  subsd  D14(%rip),%xmm1
  cmp    $0xffffffff,%esi
  je     L49
  test   %esi,%esi
  jne    L46
  cmp    $0x62d,%eax
  jg     L13
L49:
  lea    -0x9(%rcx),%esi
  pxor   %xmm0,%xmm0
  movslq %esi,%rdx
  imul   $0xffffffff92492493,%rdx,%rdx
  shr    $0x20,%rdx
  add    %esi,%edx
  sar    $0x1f,%esi
  sar    $0x2,%edx
  sub    %esi,%edx
  lea    0x1389(%rax,%rdx,1),%edx
  lea    0x0(,%rdx,8),%esi
  sub    %edx,%esi
  lea    0x3(%rsi),%edx
  cmovns %esi,%edx
  imul   $0x113,%ecx,%ecx
  imul   $0x16f,%eax,%eax
  sar    $0x2,%edx
  sub    %edx,%eax
  movslq %ecx,%rdx
  sar    $0x1f,%ecx
  imul   $0x38e38e39,%rdx,%rdx
  sar    $0x21,%rdx
  sub    %ecx,%edx
  add    %edx,%eax
  lea    0x1a64f1(%rdi,%rax,1),%eax
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  ret
  xchg   %ax,%ax
L13:
  cmp    $0x62e,%eax
  jne    L46
  cmp    $0x9,%ecx
  jle    L49
  cmp    $0xa,%ecx
  jne    L46
  cmp    $0xe,%edi
  jle    L49
L46:
  lea    -0xe(%rcx),%edx
  pxor   %xmm0,%xmm0
  movslq %edx,%rsi
  sar    $0x1f,%edx
  imul   $0x2aaaaaab,%rsi,%rsi
  sar    $0x21,%rsi
  sub    %edx,%esi
  lea    0x0(,%rsi,4),%r8d
  mov    %esi,%edx
  sub    %r8d,%edx
  lea    0x12c0(%rsi,%rax,1),%r8d
  imul   $0x5b5,%r8d,%r8d
  lea    -0x2(%rcx,%rdx,4),%ecx
  imul   $0x16f,%ecx,%ecx
  movslq %ecx,%rdx
  sar    $0x1f,%ecx
  imul   $0x2aaaaaab,%rdx,%rdx
  sar    $0x21,%rdx
  sub    %ecx,%edx
  test   %r8d,%r8d
  lea    0x3(%r8),%ecx
  cmovns %r8d,%ecx
  sar    $0x2,%ecx
  add    %ecx,%edx
  lea    0x1324(%rsi,%rax,1),%ecx
  movslq %ecx,%rax
  sar    $0x1f,%ecx
  imul   $0x51eb851f,%rax,%rax
  sar    $0x25,%rax
  sub    %ecx,%eax
  lea    (%rax,%rax,2),%eax
  test   %eax,%eax
  lea    0x3(%rax),%ecx
  cmovns %eax,%ecx
  mov    %edx,%eax
  sar    $0x2,%ecx
  sub    %ecx,%eax
  lea    -0x7d4b(%rdi,%rax,1),%eax
  cvtsi2sd %eax,%xmm0
  addsd  %xmm1,%xmm0
  ret
```

tool_calls: name: parse_data
arguments: data_tag: D7
datatype: f64
name: parse_data
arguments: data_tag: D21
datatype: f64
name: parse_data
arguments: data_tag: D14
datatype: f64

tool: D7: 60

tool: D21: 24

tool: D14: 0.5

assistant: ```c
double ephcom_cal2jd(int idate[6], int calendar_type) {
  double tjd;
  int jd;
  tjd = (idate[3] + (idate[4] + idate[5] / 60.0) / 60.0) / 24.0 - 0.5;
  if (calendar_type == -1 || (calendar_type == 0 && (idate[0] < 1582 || (idate[0] == 1582 && (idate[1] < 10 || (idate[1] == 10 && idate[2] < 15)))))) {
    jd = 367 * idate[0] - (7 * (idate[0] + 5001 + (idate[1] - 9) / 7)) / 4 + (275 * idate[1]) / 9 + idate[2] + 1729777;
  } else {
    jd = (1461 * (idate[0] + 4800 + (idate[1] - 14) / 12)) / 4 + (367 * (idate[1] - 2 - 12 * ((idate[1] - 14) / 12))) / 12 - (3 * ((idate[0] + 4900 + (idate[1] - 14) / 12) / 100)) / 4 + idate[2] - 32075;
  }
  tjd += (double)jd;
  return (tjd);
}
```