user: Demonstrate the C code that generates the assembly output below:

```asm
<lned_run>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x68,%rsp
  mov    %edi,%r13d
  mov    %rsi,%r14
  mov    %rdx,%r15
  mov    %rcx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x58(%rsp)
  xor    %eax,%eax
  movl   $0xffffffff,0x8(%rsp)
  movl   $0xffffffff,0xc(%rsp)
  lea    0x10(%rsp),%rbp
  mov    $0x40,%edx
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    $0x0,%ebx
  jmp    L22
L112:
  add    $0x1,%ebx
  add    $0x10,%rbp
  cmp    $0x3,%ebx
  je     L81
L22:
  mov    %rbp,%rsi
  mov    %ebx,%edi
  call   <tcgetattr@plt>
  test   %eax,%eax
  jns    L112
  cmp    $0x1,%ebx
  jg     L112
L83:
  mov    %r14,%rsi
  mov    %r13d,%edi
  call   *%r12
L124:
  mov    0x58(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L115
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L81:
  lea    0x8(%rsp),%rcx
  mov    $0x0,%edx
  mov    D4(%rip),%rax
  mov    (%rax),%esi
  mov    D79(%rip),%rax
  mov    (%rax),%edi
  call   <socketpair@plt>
  test   %eax,%eax
  js     L83
  movdqa 0x10(%rsp),%xmm0
  movaps %xmm0,0x40(%rsp)
  mov    D76(%rip),%rax
  mov    (%rax),%eax
  mov    D36(%rip),%rdx
  or     (%rdx),%eax
  not    %eax
  and    %eax,0x40(%rsp)
  mov    D86(%rip),%rax
  mov    (%rax),%rdx
  mov    0x48(%rsp),%rax
  movl   $0x1,(%rax,%rdx,4)
  mov    D15(%rip),%rax
  mov    (%rax),%rdx
  mov    0x48(%rsp),%rax
  movl   $0x0,(%rax,%rdx,4)
  lea    0x40(%rsp),%rdx
  mov    D37(%rip),%rax
  mov    (%rax),%esi
  mov    $0x0,%edi
  call   <tcsetattr@plt>
  test   %eax,%eax
  js     L83
  mov    $0x0,%eax
  call   <fork@plt>
  test   %rax,%rax
  je     L10
  mov    0xc(%rsp),%edi
  call   <close@plt>
  mov    $0x2,%esi
  mov    $0x1,%edi
  call   <dup2@plt>
  mov    %r15,%rsi
  mov    0x8(%rsp),%edi
  call   <shuttle@plt>
  mov    D8(%rip),%rax
  mov    (%rax),%esi
  mov    0x8(%rsp),%edi
  call   <shutdown@plt>
  lea    0x50(%rsp),%rbx
L31:
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    0x8(%rsp),%edi
  call   <read@plt>
  cmp    $0x1,%eax
  jne    L114
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    $0x1,%edi
  call   <write@plt>
  jmp    L31
L10:
  mov    $0x0,%esi
  mov    0xc(%rsp),%edi
  call   <dup2@plt>
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <dup2@plt>
  mov    $0x2,%edi
  call   <isatty@plt>
  test   %rax,%rax
  jne    L33
L95:
  mov    0x8(%rsp),%edi
  call   <close@plt>
  mov    0xc(%rsp),%edi
  call   <close@plt>
  jmp    L83
L33:
  mov    $0x2,%esi
  mov    0xc(%rsp),%edi
  call   <dup2@plt>
  jmp    L95
L114:
  lea    0x4(%rsp),%rdi
  call   <wait@plt>
  lea    0x10(%rsp),%rdx
  mov    D37(%rip),%rax
  mov    (%rax),%esi
  mov    $0x0,%edi
  call   <tcsetattr@plt>
  mov    0x4(%rsp),%eax
  jmp    L124
L115:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int lned_run(int argc, char **argv, const char *prompt, int (*worker)(int, char **)) {
  struct termios tc[4];
  struct termios *t;
  char cb[8];
  int sp[2] = {-1, -1};
  int i;
  int res;
  int st;
  pid_t pid;
  memset(tc, 0, sizeof(tc));
  for (i = 0; i < 3; i++) {
    res = tcgetattr(i, &(tc[i]));
    if (res < 0 && i < 2)
      goto Direct;
  }
  res = socketpair(AF_UNIX, SOCK_STREAM, 0, sp);
  if (res < 0)
    goto Direct;
  t = &(tc[3]);
  *t = tc[0];
  t->c_lflag &= ~(ECHO | ICANON);
  t->c_cc[VMIN] = 1;
  t->c_cc[VTIME] = 0;
  res = tcsetattr(0, TCSANOW, t);
  if (res < 0)
    goto Direct;
  pid = fork();
  if (pid == 0) {
    dup2(sp[1], 0);
    dup2(sp[1], 1);
    if (isatty(2))
      dup2(sp[1], 2);
    close(sp[0]);
    close(sp[1]);
    goto Direct;
  }
  close(sp[1]);
  dup2(1, 2);
  shuttle(sp[0], prompt);
  shutdown(sp[0], SHUT_WR);
  while (read(sp[0], cb, 1) == 1)
    write(1, cb, 1);
  wait(&st);
  tcsetattr(0, TCSANOW, &(tc[0]));
  return (st);
Direct:
  return (worker(argc, argv));
}
```