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

```asm
<decode_julday>:
  endbr64
  pxor   %xmm1,%xmm1
  push   %r14
  mov    %esi,%r14d
  cvtsi2sd %esi,%xmm1
  push   %r13
  mov    %edi,%r13d
  push   %r12
  mov    %r8,%r12
  push   %rbp
  mov    %rcx,%rbp
  push   %rbx
  mov    %rdx,%rbx
  movapd %xmm1,%xmm0
  sub    $0x20,%rsp
  subsd  D3(%rip),%xmm0
  divsd  D93(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  movsd  %xmm1,0x8(%rsp)
  call   <floor@plt>
  movsd  0x8(%rsp),%xmm1
  addsd  %xmm0,%xmm1
  mulsd  D41(%rip),%xmm0
  movsd  %xmm1,0x8(%rsp)
  cvttsd2si %xmm0,%edi
  call   <floor@plt>
  movsd  0x8(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  addsd  D69(%rip),%xmm1
  cmp    $0x231518,%r14d
  jg     L25
  test   %r13d,%r13d
  je     L3
L25:
  movapd %xmm1,%xmm0
  subsd  D56(%rip),%xmm0
  movsd  %xmm1,0x8(%rsp)
  divsd  D98(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  call   <floor@plt>
  movapd %xmm0,%xmm2
  movsd  D98(%rip),%xmm0
  movsd  %xmm2,0x18(%rsp)
  mulsd  %xmm2,%xmm0
  cvttsd2si %xmm0,%edi
  call   <floor@plt>
  movsd  0x8(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  divsd  D48(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  movsd  %xmm1,0x10(%rsp)
  call   <floor@plt>
  movapd %xmm0,%xmm3
  movsd  D48(%rip),%xmm0
  movsd  %xmm3,0x8(%rsp)
  mulsd  %xmm3,%xmm0
  cvttsd2si %xmm0,%edi
  call   <floor@plt>
  movsd  0x10(%rsp),%xmm1
  subsd  %xmm0,%xmm1
  movsd  0x8(%rsp),%xmm0
  divsd  D7(%rip),%xmm0
  cvttsd2si %xmm0,%edi
  cvttsd2si %xmm1,%eax
  mov    %eax,(%r12)
  call   <floor@plt>
  mulsd  D10(%rip),%xmm0
  movsd  0x8(%rsp),%xmm1
  subsd  D39(%rip),%xmm1
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%eax
  mov    %eax,0x0(%rbp)
  add    $0x7,%eax
  movslq %eax,%rdi
  sar    $0x1f,%eax
  imul   $0x66666667,%rdi,%rdi
  sar    $0x22,%rdi
  sub    %eax,%edi
  call   <floor@plt>
  movsd  0x18(%rsp),%xmm2
  subsd  D60(%rip),%xmm2
  subsd  %xmm0,%xmm2
  cvttsd2si %xmm2,%eax
  mov    %eax,(%rbx)
  add    $0x20,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L3:
  add    $0x5f4,%r14d
  pxor   %xmm1,%xmm1
  cvtsi2sd %r14d,%xmm1
  jmp    L25
```

tool_calls: name: read_data
arguments: tag: D3
type_guessed: f64
name: read_data
arguments: tag: D93
type_guessed: f64
name: read_data
arguments: tag: D41
type_guessed: byte[8]
name: read_data
arguments: tag: D69
type_guessed: byte[8]
name: read_data
arguments: tag: D56
type_guessed: f64
name: read_data
arguments: tag: D98
type_guessed: f64
name: read_data
arguments: tag: D48
type_guessed: f64
name: read_data
arguments: tag: D7
type_guessed: byte[8]
name: read_data
arguments: tag: D10
type_guessed: byte[8]
name: read_data
arguments: tag: D39
type_guessed: byte[8]
name: read_data
arguments: tag: D60
type_guessed: byte[8]

tool: D3: 1867216.25

tool: D93: 36524.25

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

tool: {"D69": [0x00,0x00,0x00,0x00,0x00,0xd4,0x97,0x40]}

tool: D56: 122.1

tool: D98: 365.25

tool: D48: 30.6001

tool: {"D7": [0x00,0x00,0x00,0x00,0x00,0x00,0x2c,0x40]}

tool: {"D10": [0x00,0x00,0x00,0x00,0x00,0x00,0x28,0x40]}

tool: {"D39": [0x00,0x00,0x00,0x00,0x00,0x00,0xf0,0x3f]}

tool: {"D60": [0x00,0x00,0x00,0x00,0x00,0x6b,0xb2,0x40]}

assistant: ```c
void decode_julday(int calendar, int julday, int *year, int *mon, int *day) {
  int a = julday;
  double b, c;
  double d, e, f;
  b = floor((a - 1867216.25) / 36524.25);
  c = a + b - floor(b / 4) + 1525;
  if (calendar == 0)
    if (a < 2299161) {
      c = a + 1524;
    }
  d = floor((c - 122.1) / 365.25);
  e = floor(365.25 * d);
  f = floor((c - e) / 30.6001);
  *day = (int)(c - e - floor(30.6001 * f));
  *mon = (int)(f - 1 - 12 * floor(f / 14));
  *year = (int)(d - 4715 - floor((7 + *mon) / 10));
}
```