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

```asm
<openpty>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x250,%rsp
  mov    %rdi,-0x228(%rbp)
  mov    %rsi,-0x230(%rbp)
  mov    %rdx,-0x238(%rbp)
  mov    %rcx,-0x240(%rbp)
  mov    %r8,-0x248(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x210(%rbp),%rax
  mov    %rax,-0x218(%rbp)
  mov    $0x0,%eax
  call   <getpt@plt>
  mov    %eax,-0x220(%rbp)
  cmpl   $0xffffffff,-0x220(%rbp)
  jne    L45
  mov    $0xffffffff,%eax
  jmp    L116
L45:
  mov    -0x220(%rbp),%eax
  mov    %eax,%edi
  call   <grantpt@plt>
  test   %rax,%rax
  jne    L149
  mov    -0x220(%rbp),%eax
  mov    %eax,%edi
  call   <unlockpt@plt>
  test   %rax,%rax
  jne    L4
  lea    -0x218(%rbp),%rcx
  mov    -0x220(%rbp),%eax
  mov    $0x200,%edx
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <pts_name@plt>
  test   %rax,%rax
  jne    L34
  mov    D8(%rip),%rax
  mov    (%rax),%edx
  mov    D19(%rip),%rax
  mov    (%rax),%eax
  or     %eax,%edx
  mov    -0x218(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <open@plt>
  mov    %eax,-0x21c(%rbp)
  cmpl   $0xffffffff,-0x21c(%rbp)
  jne    L65
  mov    -0x218(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  cmp    %rax,%rdx
  je     L123
  mov    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  jmp    L123
L65:
  cmpq   $0x0,-0x240(%rbp)
  je     L52
  mov    D31(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x240(%rbp),%rdx
  mov    -0x21c(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <tcsetattr@plt>
L52:
  cmpq   $0x0,-0x248(%rbp)
  je     L69
  mov    D29(%rip),%rax
  mov    (%rax),%ecx
  mov    -0x248(%rbp),%rdx
  mov    -0x21c(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <ioctl@plt>
L69:
  mov    -0x228(%rbp),%rax
  mov    -0x220(%rbp),%edx
  mov    %edx,(%rax)
  mov    -0x230(%rbp),%rax
  mov    -0x21c(%rbp),%edx
  mov    %edx,(%rax)
  cmpq   $0x0,-0x238(%rbp)
  je     L14
  mov    -0x218(%rbp),%rdx
  mov    -0x238(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
L14:
  mov    -0x218(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  cmp    %rax,%rdx
  je     L67
  mov    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
L67:
  mov    $0x0,%eax
  jmp    L116
L149:
  nop
  jmp    L48
L4:
  nop
  jmp    L48
L34:
  nop
  jmp    L48
L123:
  nop
L48:
  mov    -0x220(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    $0xffffffff,%eax
L116:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L139
  call   <__stack_chk_fail@plt>
L139:
  leave
  ret
```

assistant: ```c
int openpty(int *amaster, int *aslave, char *name, const struct termios *termp, const struct winsize *winp) {
  char _buf[512];
  char *buf = _buf;
  int master, slave;
  master = getpt();
  if (master == -1)
    return -1;
  if (grantpt(master))
    goto fail;
  if (unlockpt(master))
    goto fail;
  if (pts_name(master, &buf, sizeof(_buf)))
    goto fail;
  slave = open(buf, O_RDWR | O_NOCTTY);
  if (slave == -1) {
    if (buf != _buf)
      free(buf);
    goto fail;
  }
  if (termp)
    tcsetattr(slave, TCSAFLUSH, termp);
  if (winp)
    ioctl(slave, TIOCSWINSZ, winp);

  *amaster = master;
  *aslave = slave;
  if (name != NULL)
    strcpy(name, buf);
  if (buf != _buf)
    free(buf);
  return 0;
fail:
  close(master);
  return -1;
}
```