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

```asm
<civil_from_days>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  addq   $0xafa6c,-0x38(%rbp)
  cmpq   $0x0,-0x38(%rbp)
  jns    L7
  mov    -0x38(%rbp),%rax
  lea    -0x23ab0(%rax),%rcx
  movabs $0x396b06bcc8f862ed,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xf,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  jmp    L34
L7:
  mov    -0x38(%rbp),%rcx
  movabs $0x396b06bcc8f862ed,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0xf,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
L34:
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  imul   $0xfffdc54f,%eax,%edx
  mov    -0x38(%rbp),%rax
  add    %edx,%eax
  mov    %eax,-0x24(%rbp)
  mov    -0x24(%rbp),%eax
  shr    $0x2,%eax
  mov    %eax,%eax
  imul   $0x59c67cd9,%rax,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x7,%ecx
  mov    -0x24(%rbp),%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  mov    -0x24(%rbp),%eax
  shr    $0x2,%eax
  mov    %eax,%eax
  imul   $0x396b207f,%rax,%rax
  shr    $0x20,%rax
  shr    $0xb,%eax
  add    %eax,%edx
  mov    -0x24(%rbp),%eax
  shr    $0x4,%eax
  mov    %eax,%eax
  imul   $0x72d641,%rax,%rax
  shr    $0x20,%rax
  mov    %eax,%ecx
  shr    $0x4,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%edx
  imul   $0x6719f361,%rdx,%rdx
  shr    $0x20,%rdx
  sub    %edx,%eax
  shr    %eax
  add    %edx,%eax
  shr    $0x8,%eax
  mov    %eax,-0x20(%rbp)
  mov    -0x8(%rbp),%rax
  imul   $0x190,%eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x1c(%rbp)
  mov    -0x20(%rbp),%eax
  mov    %eax,%eax
  imul   $0x51eb851f,%rax,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x5,%edx
  mov    -0x20(%rbp),%eax
  imul   $0x16d,%eax,%ecx
  mov    -0x20(%rbp),%eax
  shr    $0x2,%eax
  add    %ecx,%eax
  sub    %eax,%edx
  mov    -0x24(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0x18(%rbp)
  mov    -0x18(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    $0x2,%eax
  mov    %eax,%edx
  mov    $0xd62b80d7,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  shr    $0x7,%eax
  mov    %eax,-0x14(%rbp)
  mov    -0x14(%rbp),%eax
  imul   $0x99,%eax,%eax
  add    $0x2,%eax
  mov    %eax,%edx
  mov    $0xcccccccd,%eax
  imul   %rdx,%rax
  shr    $0x20,%rax
  mov    %eax,%edx
  shr    $0x2,%edx
  mov    -0x18(%rbp),%eax
  sub    %edx,%eax
  add    $0x1,%eax
  mov    %eax,-0x10(%rbp)
  cmpl   $0x9,-0x14(%rbp)
  ja     L58
  mov    $0x3,%edx
  jmp    L12
L58:
  mov    $0xfffffff7,%edx
L12:
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  cmpl   $0x2,-0xc(%rbp)
  setbe  %al
  movzbl %al,%eax
  add    %eax,-0x1c(%rbp)
  subl   $0x1,-0xc(%rbp)
  cmpq   $0x0,-0x40(%rbp)
  je     L3
  mov    -0x40(%rbp),%rax
  mov    -0x1c(%rbp),%edx
  mov    %edx,(%rax)
L3:
  cmpq   $0x0,-0x48(%rbp)
  je     L39
  mov    -0x48(%rbp),%rax
  mov    -0xc(%rbp),%edx
  mov    %edx,(%rax)
L39:
  cmpq   $0x0,-0x50(%rbp)
  je     L40
  mov    -0x50(%rbp),%rax
  mov    -0x10(%rbp),%edx
  mov    %edx,(%rax)
L40:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void civil_from_days(long z, int *py, unsigned *pm, unsigned *pd) {
  int y;
  unsigned m;
  unsigned d;
  z += 719468;
  const long era = (z >= 0 ? z : z - 146096) / 146097;
  const unsigned doe = (z - era * 146097);
  const unsigned yoe = (doe - doe / 1460 + doe / 36524 - doe / 146096) / 365;
  y = ((long)yoe) + era * 400;
  const unsigned doy = doe - (365 * yoe + yoe / 4 - yoe / 100);
  const unsigned mp = (5 * doy + 2) / 153;
  d = doy - (153 * mp + 2) / 5 + 1;
  m = mp + (mp < 10 ? 3 : -9);
  y += (m <= 2);
  --m;
  if (py)
    *py = y;
  if (pm)
    *pm = m;
  if (pd)
    *pd = d;
}
```