user: 请将以下的汇编代码转换成C语言代码:

```asm
<addDay>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x60,%rsp
  mov    %rdi,-0x2058(%rbp)
  mov    %esi,-0x205c(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x22,-0x205c(%rbp)
  jle    L151
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
L151:
  mov    -0x2058(%rbp),%rax
  mov    %rax,%rdi
  call   <grabYear@plt>
  mov    %rax,-0x2038(%rbp)
  mov    -0x2058(%rbp),%rax
  mov    %rax,%rdi
  call   <grabMonth@plt>
  mov    %rax,-0x2030(%rbp)
  mov    -0x2058(%rbp),%rax
  mov    %rax,%rdi
  call   <grabDay@plt>
  mov    %rax,-0x2028(%rbp)
  mov    -0x2058(%rbp),%rax
  mov    %rax,%rdi
  call   <grabHour@plt>
  mov    %rax,-0x2020(%rbp)
  mov    -0x2058(%rbp),%rax
  mov    %rax,%rdi
  call   <grabMinute@plt>
  mov    %rax,-0x2018(%rbp)
  mov    -0x2058(%rbp),%rax
  mov    %rax,%rdi
  call   <grabLSB@plt>
  mov    %eax,-0x2044(%rbp)
  cmpq   $0x1,-0x2030(%rbp)
  je     L163
  cmpq   $0x3,-0x2030(%rbp)
  je     L163
  cmpq   $0x5,-0x2030(%rbp)
  je     L163
  cmpq   $0x7,-0x2030(%rbp)
  je     L163
  cmpq   $0x8,-0x2030(%rbp)
  je     L163
  cmpq   $0xa,-0x2030(%rbp)
  je     L163
  cmpq   $0xc,-0x2030(%rbp)
  jne    L101
L163:
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  add    %rdx,%rax
  cmp    $0x1f,%rax
  jbe    L23
  cmpq   $0xc,-0x2030(%rbp)
  jne    L158
  addq   $0x1,-0x2038(%rbp)
L158:
  mov    -0x2030(%rbp),%rax
  lea    0x1(%rax),%rcx
  movabs $0xaaaaaaaaaaaaaaab,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x3,%rax
  mov    %rax,-0x2030(%rbp)
  mov    -0x2030(%rbp),%rdx
  mov    %rdx,%rax
  add    %rax,%rax
  add    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x2030(%rbp)
  cmpq   $0x0,-0x2030(%rbp)
  jne    L23
  movq   $0x1,-0x2030(%rbp)
L23:
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  movabs $0x842108421084211,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rdx,%rax
  shr    $0x4,%rax
  mov    %rax,-0x2028(%rbp)
  mov    -0x2028(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x5,%rax
  sub    %rdx,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x2028(%rbp)
  cmpq   $0x0,-0x2028(%rbp)
  jne    L154
  movq   $0x1f,-0x2028(%rbp)
  jmp    L154
L101:
  cmpq   $0x4,-0x2030(%rbp)
  je     L50
  cmpq   $0x6,-0x2030(%rbp)
  je     L50
  cmpq   $0x9,-0x2030(%rbp)
  je     L50
  cmpq   $0xb,-0x2030(%rbp)
  jne    L240
L50:
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  add    %rdx,%rax
  cmp    $0x1e,%rax
  jbe    L47
  addq   $0x1,-0x2030(%rbp)
L47:
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  movabs $0x8888888888888889,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rdx,%rax
  shr    $0x4,%rax
  mov    %rax,-0x2028(%rbp)
  mov    -0x2028(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x4,%rax
  sub    %rdx,%rax
  add    %rax,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x2028(%rbp)
  cmpq   $0x0,-0x2028(%rbp)
  jne    L154
  movq   $0x1e,-0x2028(%rbp)
  jmp    L154
L240:
  mov    -0x2038(%rbp),%rax
  and    $0x3,%eax
  test   %rax,%rax
  jne    L208
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  add    %rdx,%rax
  cmp    $0x1d,%rax
  jbe    L19
  addq   $0x1,-0x2030(%rbp)
L19:
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  movabs $0x1a7b9611a7b9611b,%rdx
  mov    %rcx,%rax
  mul    %rdx
  mov    %rcx,%rax
  sub    %rdx,%rax
  shr    %rax
  add    %rdx,%rax
  shr    $0x4,%rax
  mov    %rax,-0x2028(%rbp)
  mov    -0x2028(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x2028(%rbp)
  cmpq   $0x0,-0x2028(%rbp)
  jne    L154
  movq   $0x1d,-0x2028(%rbp)
  jmp    L154
L208:
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  add    %rdx,%rax
  cmp    $0x1c,%rax
  jbe    L268
  addq   $0x1,-0x2030(%rbp)
L268:
  mov    -0x205c(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x2028(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    %rcx,%rax
  shr    $0x2,%rax
  movabs $0x4924924924924925,%rdx
  mul    %rdx
  mov    %rdx,%rax
  shr    %rax
  mov    %rax,-0x2028(%rbp)
  mov    -0x2028(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x3,%rax
  sub    %rdx,%rax
  shl    $0x2,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %rdx,-0x2028(%rbp)
  cmpq   $0x0,-0x2028(%rbp)
  jne    L154
  movq   $0x1c,-0x2028(%rbp)
L154:
  mov    -0x2020(%rbp),%r8
  mov    -0x2028(%rbp),%rdi
  mov    -0x2030(%rbp),%rcx
  mov    -0x2038(%rbp),%rdx
  lea    -0x2010(%rbp),%rax
  mov    -0x2044(%rbp),%esi
  push   %rsi
  push   -0x2018(%rbp)
  mov    %r8,%r9
  mov    %rdi,%r8
  lea    D24(%rip),%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  add    $0x10,%rsp
  lea    -0x2040(%rbp),%rdx
  lea    -0x2010(%rbp),%rax
  lea    D8(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sscanf@plt>
  mov    -0x2040(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L74
  call   <__stack_chk_fail@plt>
L74:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D9
type_guessed: string
name: unpack_data
arguments: data_label: D12
type_guessed: string
name: unpack_data
arguments: data_label: D24
type_guessed: string
name: unpack_data
arguments: data_label: D8
type_guessed: string

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


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


tool: D24: %lu%02lu%02lu%02lu%02lu%d

tool: D8: %lu

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;
}
```