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

```asm
<dayno>:
  endbr64
  mov    %edx,%r8d
  mov    %ecx,%r9d
  movslq %edi,%rdx
  imul   $0x51eb851f,%rdx,%rdx
  sar    $0x27,%rdx
  mov    %edi,%eax
  sar    $0x1f,%eax
  sub    %eax,%edx
  imul   $0x190,%edx,%eax
  mov    %edi,%edx
  sub    %eax,%edx
  lea    0x9(%rsi),%eax
  movslq %eax,%rcx
  imul   $0x2aaaaaab,%rcx,%rcx
  sar    $0x21,%rcx
  mov    %eax,%r10d
  sar    $0x1f,%r10d
  sub    %r10d,%ecx
  lea    (%rcx,%rcx,2),%ecx
  shl    $0x2,%ecx
  sub    %ecx,%eax
  add    $0x1,%eax
  imul   $0x1a,%eax,%eax
  sub    $0x2,%eax
  movslq %eax,%rcx
  imul   $0x66666667,%rcx,%rcx
  sar    $0x22,%rcx
  sar    $0x1f,%eax
  sub    %eax,%ecx
  lea    0x191(%rdx,%rcx,1),%r10d
  lea    0x193(%rdx),%ecx
  mov    %edx,%eax
  add    $0x190,%eax
  cmovns %eax,%ecx
  sar    $0x2,%ecx
  add    %ecx,%r10d
  movslq %eax,%rcx
  imul   $0x51eb851f,%rcx,%rcx
  sar    $0x25,%rcx
  sar    $0x1f,%eax
  sub    %ecx,%eax
  add    %eax,%r10d
  cmp    $0x2,%esi
  jg     L85
  mov    %edi,%r11d
  and    $0x3,%r11d
  jne    L109
  movslq %edi,%rax
  imul   $0x51eb851f,%rax,%rax
  sar    $0x25,%rax
  mov    %edi,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  imul   $0x64,%eax,%eax
  cmp    %eax,%edi
  jne    L30
L109:
  cmp    $0x1,%edx
  sbb    $0xfffffffa,%r10d
  movslq %r10d,%rax
  imul   $0xffffffff92492493,%rax,%rax
  shr    $0x20,%rax
  add    %r10d,%eax
  sar    $0x2,%eax
  mov    %r10d,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    0x0(,%rax,8),%ecx
  sub    %eax,%ecx
  mov    %r10d,%eax
  sub    %ecx,%eax
  lea    0x0(,%r8,8),%ecx
  sub    %r8d,%ecx
  add    %r9d,%ecx
  lea    -0x1(%rsi),%r8d
  movslq %r8d,%r8
  lea    D14(%rip),%r9
  mov    (%r9,%r8,4),%r8d
  cmp    $0x2,%esi
  jne    L37
  test   %r11d,%r11d
  je     L33
L70:
  test   %edx,%edx
  jne    L37
L75:
  add    $0x1,%r8d
  jmp    L37
L33:
  movslq %edi,%rsi
  imul   $0x51eb851f,%rsi,%rsi
  sar    $0x25,%rsi
  mov    %edi,%r9d
  sar    $0x1f,%r9d
  sub    %r9d,%esi
  imul   $0x64,%esi,%esi
  cmp    %esi,%edi
  je     L70
  jmp    L75
L85:
  movslq %r10d,%rax
  imul   $0xffffffff92492493,%rax,%rax
  shr    $0x20,%rax
  add    %r10d,%eax
  sar    $0x2,%eax
  mov    %r10d,%edx
  sar    $0x1f,%edx
  sub    %edx,%eax
  lea    0x0(,%rax,8),%edx
  sub    %eax,%edx
  mov    %r10d,%eax
  sub    %edx,%eax
  lea    0x0(,%r8,8),%ecx
  sub    %r8d,%ecx
  add    %r9d,%ecx
  sub    $0x1,%esi
  movslq %esi,%rsi
  lea    D14(%rip),%rdx
  mov    (%rdx,%rsi,4),%r8d
L37:
  mov    $0x0,%edx
  cmp    %ecx,%eax
  jg     L29
  sub    %eax,%ecx
  lea    0x1(%rcx),%edx
  cmp    %r8d,%ecx
  mov    $0x0,%eax
  cmovge %eax,%edx
L29:
  mov    %edx,%eax
  ret
L30:
  lea    0x5(%r10),%edx
  movslq %edx,%rax
  imul   $0xffffffff92492493,%rax,%rax
  shr    $0x20,%rax
  add    %edx,%eax
  sar    $0x2,%eax
  mov    %edx,%ecx
  sar    $0x1f,%ecx
  sub    %ecx,%eax
  lea    0x0(,%rax,8),%ecx
  sub    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  lea    0x0(,%r8,8),%ecx
  sub    %r8d,%ecx
  add    %r9d,%ecx
  lea    -0x1(%rsi),%edx
  movslq %edx,%rdx
  lea    D14(%rip),%rdi
  mov    (%rdi,%rdx,4),%r8d
  cmp    $0x2,%esi
  je     L75
  jmp    L37
```

tool_calls: name: read_data
arguments: data_label: D14
type: string

tool: D14: 

assistant: ```c
int dayno(int yyyy, int mm, int x, int y) {
  static int daytab[] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
  int a, b, c;
  a = ((((((mm) + 9) % 12 + 1) * 26 - 2) / 10 + (1) + ((yyyy) % 400 + 400) + ((yyyy) % 400 + 400) / 4 - ((yyyy) % 400 + 400) / 100 + (((mm) <= 2) ? ((((((yyyy) % 4) == 0) && (((yyyy) % 100) != 0)) || (((yyyy) % 400) == 0)) ? 5 : 6) : 0)) % 7);
  b = x * 7 + y;
  c = daytab[mm - 1];
  if ((mm == 2) && ((((yyyy % 4) == 0) && ((yyyy % 100) != 0)) || ((yyyy % 400) == 0)))
    c++;
  if (b < a)
    return (0);
  if ((b - a) >= c)
    return (0);
  return ((b - a + 1));
}
```