user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<add_a_day>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x14(%rbp),%rcx
  lea    -0x18(%rbp),%rdx
  lea    -0x1c(%rbp),%rsi
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <long_to_date@plt>
  mov    -0x14(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  cmp    $0x1c,%eax
  jle    L4
  mov    -0x18(%rbp),%eax
  cmp    $0xc,%eax
  jg     L129
  cmp    $0x3,%eax
  jge    L96
  cmp    $0x1,%eax
  je     L225
  cmp    $0x2,%eax
  je     L115
  jmp    L129
L96:
  mov    $0x1,%edx
  mov    %eax,%ecx
  shl    %cl,%rdx
  mov    %rdx,%rax
  mov    %rax,%rdx
  and    $0x5a8,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L225
  mov    %rax,%rdx
  and    $0xa50,%edx
  test   %rdx,%rdx
  setne  %dl
  test   %dl,%dl
  jne    L0
  and    $0x1000,%eax
  test   %rax,%rax
  setne  %al
  test   %al,%al
  je     L129
  mov    -0x14(%rbp),%eax
  cmp    $0x20,%eax
  jne    L233
  movl   $0x1,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x1c(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x1c(%rbp)
  jmp    L233
L115:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <is_leap_year@plt>
  test   %eax,%eax
  je     L52
  mov    -0x14(%rbp),%eax
  cmp    $0x1e,%eax
  je     L55
L52:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edi
  call   <is_leap_year@plt>
  test   %eax,%eax
  jne    L202
  mov    -0x14(%rbp),%eax
  cmp    $0x1d,%eax
  jne    L202
L55:
  movl   $0x3,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L202
L225:
  mov    -0x14(%rbp),%eax
  cmp    $0x20,%eax
  jne    L118
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L118
L0:
  mov    -0x14(%rbp),%eax
  cmp    $0x1f,%eax
  jne    L106
  mov    -0x18(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x18(%rbp)
  movl   $0x1,-0x14(%rbp)
  jmp    L106
L129:
  mov    $0x0,%edi
  call   <assert@plt>
  jmp    L4
L233:
  nop
  jmp    L4
L202:
  nop
  jmp    L4
L118:
  nop
  jmp    L4
L106:
  nop
L4:
  mov    -0x14(%rbp),%edx
  mov    -0x18(%rbp),%ecx
  mov    -0x1c(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <date_to_long@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  mov    %rax,%rdi
  call   <is_valid_date@plt>
  mov    %eax,%edi
  call   <assert@plt>
  mov    -0x10(%rbp),%rax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L69
  call   <__stack_chk_fail@plt>
L69:
  leave
  ret
```

assistant: ```c
int add_a_day(long l) {
  int y, m, d;
  long_to_date(l, &y, &m, &d);
  ++d;
  if (d > 28) {
    switch (m) {
    case 12:
      if (d == 32) {
        m = d = 1;
        ++y;
      }
      break;
    case 2:
      if ((is_leap_year(y) && d == 30) || (!is_leap_year(y) && d == 29)) {
        m = 3;
        d = 1;
      }
      break;
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
      if (d == 32) {
        ++m;
        d = 1;
      }
      break;
    case 4:
    case 6:
    case 9:
    case 11:
      if (d == 31) {
        ++m;
        d = 1;
      }
      break;
    default:
      assert(0);
      break;
    }
  }
  long l2 = date_to_long(y, m, d);
  assert(is_valid_date(l2));
  return l2;
}
```