user: What would the C source look like for the assembly code provided here:

```asm
<gmtime_r>:
  endbr64
  movabs $0x100000046,%rax
  push   %r12
  mov    %rsi,%r12
  push   %rbx
  sub    $0x8,%rsp
  mov    (%rdi),%ebx
  mov    %rax,(%rsi)
  mov    $0x46,%edi
  movq   $0x0,0x20(%rsi)
  movq   $0x0,0x18(%rsi)
  movq   $0x0,0x10(%rsi)
  movl   $0x0,0x8(%rsi)
  jmp    L36
  nopl   0x0(%rax,%rax,1)
L53:
  mov    (%r12),%eax
  lea    0x76c(%rax),%edi
  call   <is_leap_year@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0xfffeae80,%eax
  add    $0x1e28500,%eax
  cmp    %eax,%ebx
  jl     L35
  mov    (%r12),%eax
  lea    0x76c(%rax),%edi
  call   <is_leap_year@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0xfffeae80,%eax
  add    $0x1e28500,%eax
  sub    %eax,%ebx
  mov    (%r12),%eax
  lea    0x1(%rax),%edi
  mov    %edi,(%r12)
L36:
  add    $0x76c,%edi
  call   <is_leap_year@plt>
  cmp    $0x1,%rax
  sbb    %eax,%eax
  and    $0xfffeae80,%eax
  add    $0x1e28500,%eax
  cmp    %eax,%ebx
  jge    L53
L35:
  mov    $0x28de80,%eax
  cmp    $0x28de7f,%ebx
  jg     L48
  jmp    L100
  nopl   (%rax)
L86:
  jl     L100
L48:
  mov    0x20(%r12),%rsi
  sub    %eax,%ebx
  mov    (%r12),%edi
  lea    0x1(%rsi),%rax
  add    $0x2,%rsi
  mov    %rax,0x20(%r12)
  call   <days_of_month@plt>
  movslq %ebx,%rdx
  cmp    %rax,%rdx
  jge    L86
L100:
  cmp    $0x1517f,%ebx
  jle    L39
  mov    0x4(%r12),%eax
  add    $0x1,%eax
  nop
L28:
  sub    $0x15180,%ebx
  mov    %eax,%edx
  add    $0x1,%eax
  cmp    $0x1517f,%ebx
  jg     L28
  mov    %edx,0x4(%r12)
L39:
  cmp    $0xe0f,%ebx
  jle    L18
  mov    0x18(%r12),%rax
  add    $0x1,%rax
  nopl   0x0(%rax)
L116:
  sub    $0xe10,%ebx
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    $0xe0f,%ebx
  jg     L116
  mov    %rdx,0x18(%r12)
L18:
  cmp    $0x3b,%ebx
  jle    L127
  mov    0x10(%r12),%rax
  add    $0x1,%rax
  nopl   0x0(%rax,%rax,1)
L24:
  sub    $0x3c,%ebx
  mov    %rax,%rdx
  add    $0x1,%rax
  cmp    $0x3b,%ebx
  jg     L24
  mov    %rdx,0x10(%r12)
L127:
  mov    %ebx,0x8(%r12)
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %r12
  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;
}
```