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

```asm
<gmtime_r>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  movq   $0x28de80,-0x8(%rbp)
  mov    -0x20(%rbp),%rax
  movl   $0x46,(%rax)
  mov    -0x20(%rbp),%rax
  movq   $0x0,0x20(%rax)
  mov    -0x20(%rbp),%rax
  movl   $0x1,0x4(%rax)
  mov    -0x20(%rbp),%rax
  movq   $0x0,0x18(%rax)
  mov    -0x20(%rbp),%rax
  movq   $0x0,0x10(%rax)
  mov    -0x20(%rbp),%rax
  movl   $0x0,0x8(%rax)
  jmp    L37
L55:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  add    $0x76c,%eax
  mov    %eax,%edi
  call   <is_leap_year@plt>
  test   %rax,%rax
  je     L30
  mov    $0x1e28500,%eax
  jmp    L75
L30:
  mov    $0x1e13380,%eax
L75:
  cmp    -0xc(%rbp),%eax
  jg     L89
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  add    $0x76c,%eax
  mov    %eax,%edi
  call   <is_leap_year@plt>
  test   %rax,%rax
  je     L102
  mov    $0x1e28500,%eax
  jmp    L23
L102:
  mov    $0x1e13380,%eax
L23:
  sub    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
L37:
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  add    $0x76c,%eax
  mov    %eax,%edi
  call   <is_leap_year@plt>
  test   %rax,%rax
  je     L26
  mov    $0x1e28500,%edx
  jmp    L178
L26:
  mov    $0x1e13380,%edx
L178:
  mov    -0xc(%rbp),%eax
  sub    %edx,%eax
  test   %eax,%eax
  jns    L55
  jmp    L257
L89:
  nop
  jmp    L257
L109:
  mov    -0xc(%rbp),%eax
  cltq
  cmp    %rax,-0x8(%rbp)
  jg     L222
  mov    -0xc(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    0x20(%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,0x20(%rax)
  mov    -0x20(%rbp),%rax
  mov    0x20(%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    (%rax),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <days_of_month@plt>
  mov    %rax,-0x8(%rbp)
L257:
  mov    -0xc(%rbp),%eax
  cltq
  sub    -0x8(%rbp),%rax
  test   %rax,%rax
  jns    L109
  jmp    L97
L222:
  nop
  jmp    L97
L153:
  cmpl   $0x1517f,-0xc(%rbp)
  jle    L228
  subl   $0x15180,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    0x4(%rax),%eax
  lea    0x1(%rax),%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,0x4(%rax)
L97:
  cmpl   $0x1517f,-0xc(%rbp)
  jg     L153
  jmp    L120
L228:
  nop
  jmp    L120
L186:
  cmpl   $0xe0f,-0xc(%rbp)
  jle    L170
  subl   $0xe10,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    0x18(%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,0x18(%rax)
L120:
  cmpl   $0xe0f,-0xc(%rbp)
  jg     L186
  jmp    L8
L170:
  nop
  jmp    L8
L221:
  cmpl   $0x3b,-0xc(%rbp)
  jle    L53
  subl   $0x3c,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    0x10(%rax),%rax
  lea    0x1(%rax),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,0x10(%rax)
L8:
  cmpl   $0x3b,-0xc(%rbp)
  jg     L221
  jmp    L146
L53:
  nop
L146:
  mov    -0x20(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,0x8(%rax)
  mov    -0x20(%rbp),%rax
  leave
  ret
```

assistant: ```c
struct tm *gmtime_r(const time_t *timep, struct tm *result) {
  time_t time = *timep;
  long day_of_month = 2678400;
  result->tm_year = 1970 - 1900;
  result->tm_mon = 0;
  result->tm_mday = 1;
  result->tm_hour = 0;
  result->tm_min = 0;
  result->tm_sec = 0;
  while (time - (is_leap_year(result->tm_year + 1900) ? 31622400 : 31536000) >= 0) {
    if (time >= (is_leap_year(result->tm_year + 1900) ? 31622400 : 31536000))
      time -= (is_leap_year(result->tm_year + 1900) ? 31622400 : 31536000);
    else
      break;
    result->tm_year++;
  }
  while (time - day_of_month >= 0) {
    if (time >= day_of_month)
      time -= day_of_month;
    else
      break;
    result->tm_mon++;
    day_of_month = days_of_month(result->tm_year, result->tm_mon + 1);
  }
  while (time - 86400 >= 0) {
    if (time >= 86400)
      time -= 86400;
    else
      break;
    result->tm_mday++;
  }
  while (time - 3600 >= 0) {
    if (time >= 3600)
      time -= 3600;
    else
      break;
    result->tm_hour++;
  }
  while (time - 60 >= 0) {
    if (time >= 60)
      time -= 60;
    else
      break;
    result->tm_min++;
  }
  result->tm_sec = time;
  return result;
}
```