user: Converte this assembly snippet into its equivalent C code:

```asm
<astro_julday_d>:
  endbr64
  movapd %xmm0,%xmm5
  pxor   %xmm1,%xmm1
  pxor   %xmm0,%xmm0
  movsd  D106(%rip),%xmm8
  cvtsi2sd %edi,%xmm1
  cvtsi2sd %esi,%xmm0
  cmp    $0x2,%esi
  jg     L87
  subsd  %xmm8,%xmm1
  addsd  D111(%rip),%xmm0
L87:
  cmp    $0x62e,%edi
  jg     L4
  je     L10
L80:
  movsd  D118(%rip),%xmm4
  movq   D36(%rip),%xmm2
  pxor   %xmm3,%xmm3
  jmp    L67
  cs nopw 0x0(%rax,%rax,1)
L10:
  cmp    $0xa,%esi
  jg     L4
  jne    L80
  comisd D14(%rip),%xmm5
  jbe    L80
  nopl   0x0(%rax)
L4:
  movq   D36(%rip),%xmm2
  movsd  D118(%rip),%xmm4
  movapd %xmm1,%xmm6
  divsd  D32(%rip),%xmm6
  movapd %xmm6,%xmm7
  andpd  %xmm2,%xmm7
  movapd %xmm2,%xmm3
  ucomisd %xmm7,%xmm4
  ja     L95
L125:
  movsd  D93(%rip),%xmm7
  movapd %xmm2,%xmm3
  mulsd  %xmm6,%xmm7
  movapd %xmm7,%xmm9
  andpd  %xmm2,%xmm9
  ucomisd %xmm9,%xmm4
  ja     L11
L14:
  movsd  D5(%rip),%xmm3
  subsd  %xmm6,%xmm3
  addsd  %xmm7,%xmm3
L67:
  addsd  D8(%rip),%xmm1
  mulsd  D3(%rip),%xmm1
  movapd %xmm2,%xmm6
  movapd %xmm1,%xmm7
  andpd  %xmm2,%xmm7
  ucomisd %xmm7,%xmm4
  jbe    L126
  cvttsd2si %xmm1,%rax
  pxor   %xmm7,%xmm7
  andnpd %xmm1,%xmm6
  cvtsi2sd %rax,%xmm7
  orpd   %xmm6,%xmm7
  movapd %xmm7,%xmm1
L126:
  addsd  %xmm8,%xmm0
  mulsd  D134(%rip),%xmm0
  movapd %xmm0,%xmm6
  andpd  %xmm2,%xmm6
  ucomisd %xmm6,%xmm4
  jbe    L62
  cvttsd2si %xmm0,%rax
  pxor   %xmm6,%xmm6
  andnpd %xmm0,%xmm2
  cvtsi2sd %rax,%xmm6
  orpd   %xmm2,%xmm6
  movapd %xmm6,%xmm0
L62:
  addsd  %xmm0,%xmm1
  addsd  %xmm5,%xmm1
  addsd  %xmm3,%xmm1
  subsd  D13(%rip),%xmm1
  movapd %xmm1,%xmm0
  ret
  nopl   0x0(%rax)
L11:
  cvttsd2si %xmm7,%rax
  pxor   %xmm9,%xmm9
  andnpd %xmm7,%xmm3
  cvtsi2sd %rax,%xmm9
  movapd %xmm9,%xmm7
  orpd   %xmm3,%xmm7
  jmp    L14
  nopl   0x0(%rax)
L95:
  cvttsd2si %xmm6,%rax
  pxor   %xmm7,%xmm7
  andnpd %xmm6,%xmm3
  cvtsi2sd %rax,%xmm7
  orpd   %xmm3,%xmm7
  movapd %xmm7,%xmm6
  jmp    L125
```

tool_calls: name: unpack_data
arguments: label: D106
type_infered: f64
name: unpack_data
arguments: label: D111
type_infered: f64
name: unpack_data
arguments: label: D118
type_infered: byte[8]
name: unpack_data
arguments: label: D36
type_infered: byte[8]
name: unpack_data
arguments: label: D14
type_infered: f64[2]
name: unpack_data
arguments: label: D32
type_infered: f64
name: unpack_data
arguments: label: D93
type_infered: byte[8]
name: unpack_data
arguments: label: D5
type_infered: f64
name: unpack_data
arguments: label: D8
type_infered: f64
name: unpack_data
arguments: label: D3
type_infered: f64
name: unpack_data
arguments: label: D134
type_infered: f64
name: unpack_data
arguments: label: D13
type_infered: f64

tool: D106: 1

tool: D111: 12

tool: {"D118": [0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x43]}

tool: {"D36": [0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x7f]}

tool: {"D14": [5.0,100.0]}

tool: D32: 100

tool: {"D93": [0x00,0x00,0x00,0x00,0x00,0x00,0xd0,0x3f]}

tool: D5: 2

tool: D8: 4716

tool: D3: 365.25

tool: D134: 30.6001

tool: D13: 1524.5

assistant: ```c
double astro_julday_d(int year, int month, double day) {
  double A, B;
  double Y = (double)year;
  double M = (double)month;
  if (month <= 2) {
    Y -= 1.0;
    M += 12.0;
  }
  if (year > 1582 || (year == 1582 && (month > 10 || (month == 10 && day > 5.0)))) {
    A = trunc(Y / 100.0);
    B = 2.0 - A + trunc(A / 4.0);
  } else {
    B = 0;
  }
  return trunc(365.25 * (Y + 4716.0)) + trunc(30.6001 * (M + 1)) + day + B - 1524.5;
}
```