user: What is the c source code of the assembly code below:

```asm
<login>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r12
  push   %rbx
  sub    $0x40,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x18(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%r12
  mov    D39(%rip),%rax
  mov    (%rax),%eax
  lea    0x200(%rax),%ebx
  movslq %ebx,%rax
  sub    $0x1,%rax
  mov    %rax,-0x30(%rbp)
  movslq %ebx,%rax
  mov    %rax,%r10
  mov    $0x0,%r11d
  movslq %ebx,%rax
  mov    %rax,%r8
  mov    $0x0,%r9d
  movslq %ebx,%rax
  mov    $0x10,%edx
  sub    $0x1,%rdx
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L3:
  cmp    %rdx,%rsp
  je     L67
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L3
L67:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L44
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L44:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x28(%rbp)
  mov    -0x28(%rbp),%rax
  mov    %rax,-0x38(%rbp)
  mov    -0x48(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0x40(%rbp)
  mov    D21(%rip),%rax
  mov    (%rax),%eax
  lea    -0x38(%rbp),%rcx
  mov    %ebx,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <tty_name@plt>
  mov    %eax,-0x3c(%rbp)
  cmpl   $0x0,-0x3c(%rbp)
  jns    L18
  mov    D3(%rip),%rax
  mov    (%rax),%eax
  lea    -0x38(%rbp),%rcx
  mov    %ebx,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <tty_name@plt>
  mov    %eax,-0x3c(%rbp)
L18:
  cmpl   $0x0,-0x3c(%rbp)
  jns    L74
  mov    D1(%rip),%rax
  mov    (%rax),%eax
  lea    -0x38(%rbp),%rcx
  mov    %ebx,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <tty_name@plt>
  mov    %eax,-0x3c(%rbp)
L74:
  cmpl   $0x0,-0x3c(%rbp)
  js     L73
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <basename@plt>
  mov    %rax,-0x20(%rbp)
  mov    D39(%rip),%rax
  mov    (%rax),%edx
  mov    -0x40(%rbp),%eax
  mov    -0x20(%rbp),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <strncpy@plt>
  mov    D13(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <utmpname@plt>
  test   %rax,%rax
  jne    L34
  mov    $0x0,%eax
  call   <setutent@plt>
  lea    -0x40(%rbp),%rax
  mov    %rax,%rdi
  call   <pututline@plt>
  mov    $0x0,%eax
  call   <endutent@plt>
L34:
  mov    -0x38(%rbp),%rax
  cmp    %rax,-0x28(%rbp)
  je     L73
  mov    -0x38(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L73:
  mov    D43(%rip),%rax
  mov    (%rax),%eax
  lea    -0x40(%rbp),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <updwtmp@plt>
  mov    %r12,%rsp
  nop
  mov    -0x18(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L42
  call   <__stack_chk_fail@plt>
L42:
  lea    -0x10(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %rbp
  ret
```

assistant: ```c
void login(const struct utmp *ut) {
  char _tty[512 + UT_LINESIZE];
  char *tty = _tty;
  int found_tty;
  const char *ttyp;
  struct utmp copy = *ut;
  found_tty = tty_name(STDIN_FILENO, &tty, sizeof(_tty));
  if (found_tty < 0)
    found_tty = tty_name(STDOUT_FILENO, &tty, sizeof(_tty));
  if (found_tty < 0)
    found_tty = tty_name(STDERR_FILENO, &tty, sizeof(_tty));
  if (found_tty >= 0) {
    ttyp = basename(tty);
    strncpy(copy.ut_line, ttyp, UT_LINESIZE);
    if (utmpname(_PATH_UTMP) == 0) {
      setutent();
      pututline(&copy);
      endutent();
    }
    if (tty != _tty)
      free(tty);
  }
  updwtmp(_PATH_WTMP, &copy);
}
```