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

```asm
<addDay>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x38,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2028(%rsp)
  xor    %eax,%eax
  mov    %rdi,%r15
  mov    %esi,%r14d
  cmp    $0x22,%esi
  jg     L93
L84:
  mov    %r15,%rdi
  call   <grabYear@plt>
  mov    %r15,%rdi
  mov    %rax,%r13
  call   <grabMonth@plt>
  mov    %r15,%rdi
  mov    %rax,%r12
  call   <grabDay@plt>
  mov    %r15,%rdi
  mov    %rax,0x8(%rsp)
  call   <grabHour@plt>
  mov    %r15,%rdi
  mov    %rax,%rbx
  call   <grabMinute@plt>
  mov    %r15,%rdi
  mov    %rax,%rbp
  call   <grabLSB@plt>
  movslq %r14d,%rsi
  mov    %eax,%edi
  mov    %r12,%rax
  and    $0xfffffffffffffffd,%rax
  cmp    $0x1,%rax
  jne    L47
  mov    0x8(%rsp),%rax
  add    %rax,%rsi
L83:
  cmp    $0x1f,%rsi
  ja     L4
L16:
  movabs $0x842108421084211,%r8
  mov    %rsi,%rax
  mul    %r8
  mov    %rsi,%rax
  sub    %rdx,%rax
  shr    %rax
  lea    (%rdx,%rax,1),%r8
  shr    $0x4,%r8
  mov    %r8,%rax
  shl    $0x5,%rax
  sub    %r8,%rax
  sub    %rax,%rsi
  mov    $0x1f,%eax
  mov    %rsi,%r8
  cmove  %rax,%r8
L13:
  lea    0x20(%rsp),%r14
  push   %rdi
  mov    %r12,%rcx
  mov    %rbx,%r9
  push   %rbp
  mov    %r13,%rdx
  lea    D10(%rip),%rsi
  mov    %r14,%rdi
  call   <sprintf@plt>
  lea    0x28(%rsp),%rdx
  lea    D7(%rip),%rsi
  mov    %r14,%rdi
  call   <sscanf@plt>
  mov    0x28(%rsp),%rax
  pop    %rdx
  pop    %rcx
  mov    0x2028(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L3
  add    $0x2038,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopw   0x0(%rax,%rax,1)
L4:
  xor    %eax,%eax
  cmp    $0xc,%r12
  lea    0x1(%r12),%rcx
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  sete   %al
  add    %rax,%r13
  mov    %rcx,%rax
  mul    %rdx
  shr    $0x3,%rdx
  lea    (%rdx,%rdx,2),%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    $0x1,%eax
  mov    %rcx,%r12
  cmove  %rax,%r12
  jmp    L16
  nopl   0x0(%rax)
L47:
  add    0x8(%rsp),%rsi
  cmp    $0xc,%r12
  ja     L35
  mov    $0x1,%eax
  mov    %r12d,%ecx
  shl    %cl,%rax
  test   $0x15a0,%eax
  jne    L83
  test   $0xa50,%eax
  je     L35
  cmp    $0x1f,%rsi
  mov    %rsi,%rax
  movabs $0x8888888888888889,%rdx
  sbb    $0xffffffffffffffff,%r12
  mul    %rdx
  mov    $0x1e,%eax
  mov    %rdx,%r8
  and    $0xfffffffffffffff0,%rdx
  shr    $0x4,%r8
  sub    %r8,%rdx
  add    %rdx,%rdx
  sub    %rdx,%rsi
  mov    %rsi,%r8
  cmove  %rax,%r8
  jmp    L13
  nopl   (%rax)
L93:
  lea    D32(%rip),%rdi
  call   <printf@plt>
  lea    D37(%rip),%rdi
  call   <printf@plt>
  jmp    L84
  nopl   (%rax)
L35:
  test   $0x3,%r13b
  jne    L66
  cmp    $0x1e,%rsi
  mov    %rsi,%rax
  movabs $0x1a7b9611a7b9611b,%rdx
  sbb    $0xffffffffffffffff,%r12
  mul    %rdx
  mov    %rsi,%rax
  sub    %rdx,%rax
  shr    %rax
  lea    (%rdx,%rax,1),%r8
  shr    $0x4,%r8
  lea    0x0(,%r8,8),%rax
  sub    %r8,%rax
  lea    (%r8,%rax,4),%rax
  sub    %rax,%rsi
  mov    $0x1d,%eax
  mov    %rsi,%r8
  cmove  %rax,%r8
  jmp    L13
  nopw   0x0(%rax,%rax,1)
L66:
  cmp    $0x1d,%rsi
  mov    %rsi,%rdx
  movabs $0x4924924924924925,%rcx
  sbb    $0xffffffffffffffff,%r12
  shr    $0x2,%rdx
  mov    %rdx,%rax
  mul    %rcx
  shr    %rdx
  lea    0x0(,%rdx,8),%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rsi
  mov    $0x1c,%eax
  mov    %rsi,%r8
  cmove  %rax,%r8
  jmp    L13
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D10
type_infered: string
name: read_data
arguments: label: D7
type_infered: string
name: read_data
arguments: label: D32
type_infered: string
name: read_data
arguments: label: D37
type_infered: string

tool: D10: %lu%02lu%02lu%02lu%02lu%d

tool: D7: %lu

tool: D32: Warning: This function only supports a max of 30 days


tool: D37: You may improve this feature later. :)


assistant: ```c
unsigned long addDay(unsigned long encoding, int days) {
  if (days > 34) {
    printf("Warning: This function only supports a max of 30 days\n");
    printf("You may improve this feature later. :)\n");
  }
  char buf[8192];
  unsigned long encoding2;
  unsigned long y, m, d, h, min;
  int b;
  y = grabYear(encoding);
  m = grabMonth(encoding);
  d = grabDay(encoding);
  h = grabHour(encoding);
  min = grabMinute(encoding);
  b = grabLSB(encoding);
  if (m == 1 || m == 3 || m == 5 || m == 7 || m == 8 || m == 10 || m == 12) {
    if (d + days > 31) {
      if (m == 12)
        y++;
      m = (m + 1) % 12;
      if (m == 0)
        m = 1;
    }
    d = (d + days) % 31;
    if (d == 0)
      d = 31;
  } else if (m == 4 || m == 6 || m == 9 || m == 11) {
    if (d + days > 30)
      m++;
    d = (d + days) % 30;
    if (d == 0)
      d = 30;
  } else {
    if (y % 4 == 0) {
      if (d + days > 29)
        m++;
      d = (d + days) % 29;
      if (d == 0)
        d = 29;
    } else {
      if (d + days > 28)
        m++;
      d = (d + days) % 28;
      if (d == 0)
        d = 28;
    }
  }
  sprintf(buf, "%lu%02lu%02lu%02lu%02lu%d", y, m, d, h, min, b);
  sscanf(buf, "%lu", &encoding2);
  return encoding2;
}
```