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

```asm
<__year_to_secs>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x38(%rbp),%rax
  sub    $0x2,%rax
  cmp    $0x88,%rax
  ja     L96
  mov    -0x38(%rbp),%rax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%eax
  sub    $0x44,%eax
  sar    $0x2,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0xc(%rbp),%eax
  and    $0x3,%eax
  test   %eax,%eax
  jne    L67
  subl   $0x1,-0x20(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  je     L156
  mov    -0x40(%rbp),%rax
  movl   $0x1,(%rax)
  jmp    L156
L67:
  cmpq   $0x0,-0x40(%rbp)
  je     L156
  mov    -0x40(%rbp),%rax
  movl   $0x0,(%rax)
L156:
  mov    -0xc(%rbp),%eax
  sub    $0x46,%eax
  imul   $0x1e13380,%eax,%edx
  mov    -0x20(%rbp),%eax
  imul   $0x15180,%eax,%eax
  add    %edx,%eax
  cltq
  jmp    L33
L96:
  cmpq   $0x0,-0x40(%rbp)
  jne    L126
  movl   $0x0,-0x24(%rbp)
  lea    -0x24(%rbp),%rax
  mov    %rax,-0x40(%rbp)
L126:
  mov    -0x38(%rbp),%rax
  lea    -0x64(%rax),%rcx
  movabs $0xa3d70a3d70a3d70b,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x8,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  mov    %eax,-0x1c(%rbp)
  mov    -0x38(%rbp),%rax
  lea    -0x64(%rax),%rcx
  movabs $0xa3d70a3d70a3d70b,%rdx
  mov    %rcx,%rax
  imul   %rdx
  lea    (%rdx,%rcx,1),%rax
  sar    $0x8,%rax
  mov    %rcx,%rsi
  sar    $0x3f,%rsi
  sub    %rsi,%rax
  mov    %rax,%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  lea    0x0(,%rax,4),%rdx
  add    %rdx,%rax
  shl    $0x4,%rax
  sub    %rax,%rcx
  mov    %rcx,%rdx
  mov    %edx,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  jns    L184
  subl   $0x1,-0x1c(%rbp)
  addl   $0x190,-0x10(%rbp)
L184:
  cmpl   $0x0,-0x10(%rbp)
  jne    L11
  mov    -0x40(%rbp),%rax
  movl   $0x1,(%rax)
  movl   $0x0,-0x18(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L84
L11:
  cmpl   $0xc7,-0x10(%rbp)
  jle    L146
  cmpl   $0x12b,-0x10(%rbp)
  jle    L161
  movl   $0x3,-0x18(%rbp)
  subl   $0x12c,-0x10(%rbp)
  jmp    L62
L161:
  movl   $0x2,-0x18(%rbp)
  subl   $0xc8,-0x10(%rbp)
  jmp    L62
L146:
  cmpl   $0x63,-0x10(%rbp)
  jle    L134
  movl   $0x1,-0x18(%rbp)
  subl   $0x64,-0x10(%rbp)
  jmp    L62
L134:
  movl   $0x0,-0x18(%rbp)
L62:
  cmpl   $0x0,-0x10(%rbp)
  jne    L187
  mov    -0x40(%rbp),%rax
  movl   $0x0,(%rax)
  movl   $0x0,-0x14(%rbp)
  jmp    L84
L187:
  mov    -0x10(%rbp),%eax
  shr    $0x2,%eax
  mov    %eax,-0x14(%rbp)
  andl   $0x3,-0x10(%rbp)
  cmpl   $0x0,-0x10(%rbp)
  sete   %al
  movzbl %al,%edx
  mov    -0x40(%rbp),%rax
  mov    %edx,(%rax)
L84:
  mov    -0x1c(%rbp),%eax
  imul   $0x61,%eax,%ecx
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  add    %eax,%eax
  add    %edx,%eax
  shl    $0x3,%eax
  lea    (%rcx,%rax,1),%edx
  mov    -0x40(%rbp),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  add    %eax,-0x14(%rbp)
  mov    -0x38(%rbp),%rax
  sub    $0x64,%rax
  imul   $0x1e13380,%rax,%rdx
  mov    -0x14(%rbp),%eax
  cltq
  imul   $0x15180,%rax,%rax
  add    %rdx,%rax
  add    $0x386e9500,%rax
L33:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L76
  call   <__stack_chk_fail@plt>
L76:
  leave
  ret
```

assistant: ```c
long long __year_to_secs(long long year, int *is_leap) {
  if (year - 2ULL <= 136) {
    int y = year;
    int leaps = (y - 68) >> 2;
    if (!((y - 68) & 3)) {
      leaps--;
      if (is_leap)
        *is_leap = 1;
    } else if (is_leap)
      *is_leap = 0;
    return 31536000 * (y - 70) + 86400 * leaps;
  }
  int cycles, centuries, leaps, rem;
  if (!is_leap)
    is_leap = &(int){0};
  cycles = (year - 100) / 400;
  rem = (year - 100) % 400;
  if (rem < 0) {
    cycles--;
    rem += 400;
  }
  if (!rem) {
    *is_leap = 1;
    centuries = 0;
    leaps = 0;
  } else {
    if (rem >= 200) {
      if (rem >= 300)
        centuries = 3, rem -= 300;
      else
        centuries = 2, rem -= 200;
    } else {
      if (rem >= 100)
        centuries = 1, rem -= 100;
      else
        centuries = 0;
    }
    if (!rem) {
      *is_leap = 0;
      leaps = 0;
    } else {
      leaps = rem / 4U;
      rem %= 4U;
      *is_leap = !rem;
    }
  }
  leaps += 97 * cycles + 24 * centuries - *is_leap;
  return (year - 100) * 31536000LL + leaps * 86400LL + 946684800 + 86400;
}
```