user: Translate the below assembly code into C programming language:

```asm
<prompt>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x2c8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x2b8(%rsp)
  xor    %eax,%eax
  lea    D23(%rip),%rbx
  lea    D14(%rip),%r12
  lea    D181(%rip),%r14
  jmp    L232
L20:
  call   <print_help@plt>
L232:
  mov    $0x0,%esi
  mov    $0x0,%edi
  call   <fstat@plt>
  mov    $0x4c,%edx
  mov    %rbx,%rsi
  shr    $0x3f,%rax
  mov    %rax,%rdi
  call   <_assert@plt>
  mov    $0x0,%esi
  mov    $0x1,%edi
  call   <fstat@plt>
  mov    $0x4d,%edx
  mov    %rbx,%rsi
  shr    $0x3f,%rax
  mov    %rax,%rdi
  call   <_assert@plt>
  mov    $0x0,%esi
  mov    $0x2,%edi
  call   <fstat@plt>
  mov    $0x4e,%edx
  mov    %rbx,%rsi
  shr    $0x3f,%rax
  mov    %rax,%rdi
  call   <_assert@plt>
  lea    0x10(%rsp),%r13
  mov    %r13,%rdi
  call   <getcwd@plt>
  lea    0x60(%rsp),%rbp
  mov    %rbp,%rdi
  call   <gettty@plt>
  mov    %r13,%rdx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <printf@plt>
  lea    0xb0(%rsp),%rbp
  mov    $0xff,%edx
  mov    %rbp,%rsi
  mov    $0x0,%edi
  call   <get_line@plt>
  mov    $0x2,%edx
  lea    D45(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L20
  lea    0xb0(%rsp),%rdi
  mov    $0x7,%edx
  lea    D233(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L135
  call   <logout@plt>
  jmp    L232
L135:
  lea    0xb0(%rsp),%rdi
  mov    $0x1,%edx
  lea    D176(%rip),%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L232
  call   <fork@plt>
  test   %eax,%eax
  je     L81
  mov    $0x0,%eax
  call   <wait@plt>
  jmp    L232
L81:
  lea    0x1b0(%rsp),%rdi
  lea    D22(%rip),%rsi
  call   <strcpy@plt>
  lea    0xb0(%rsp),%rdi
  lea    D8(%rip),%rsi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L56
  lea    D166(%rip),%r13
  lea    D215(%rip),%r15
  jmp    L306
L1:
  lea    D11(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L58
L216:
  mov    $0x2,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L0
  lea    D8(%rip),%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L186
L302:
  mov    $0x1,%edi
  call   <close@plt>
  mov    %rbp,%rdi
  call   <creat@plt>
  mov    $0x1,%esi
  mov    %rbp,%rdi
  call   <open@plt>
  test   %rax,%rax
  js     L233
L48:
  lea    D8(%rip),%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L56
L306:
  mov    $0x3,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L216
  lea    D8(%rip),%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L1
L58:
  mov    %rbp,%rdi
  call   <creat@plt>
  mov    $0x1,%edi
  call   <close@plt>
  mov    $0x401,%esi
  mov    %rbp,%rdi
  call   <open@plt>
  test   %rax,%rax
  jns    L48
  mov    %rbp,%rdx
  lea    D50(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L48
L186:
  lea    D11(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L302
L233:
  mov    %rbp,%rdx
  lea    D50(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L48
L0:
  mov    $0x2,%edx
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L65
  lea    D8(%rip),%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L161
L107:
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <stat@plt>
  test   %rax,%rax
  js     L193
L312:
  mov    $0x0,%edi
  call   <close@plt>
  mov    $0x0,%esi
  mov    %rbp,%rdi
  call   <open@plt>
  test   %rax,%rax
  jns    L48
  mov    %rbp,%rdx
  lea    D9(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L48
L161:
  lea    D11(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L107
L193:
  mov    %rbp,%rdx
  lea    D9(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L312
L65:
  mov    $0x2,%edx
  lea    D86(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L210
  lea    0x8(%rsp),%rdi
  call   <pipe@plt>
  call   <fork@plt>
  test   %eax,%eax
  jne    L76
  lea    0x1b0(%rsp),%rdi
  lea    D22(%rip),%rsi
  call   <strcpy@plt>
  mov    0xc(%rsp),%edi
  call   <close@plt>
  mov    $0x0,%edi
  call   <close@plt>
  mov    $0x0,%esi
  mov    0x8(%rsp),%edi
  call   <dup2@plt>
  jmp    L48
L76:
  mov    0x8(%rsp),%edi
  call   <close@plt>
  mov    $0x1,%edi
  call   <close@plt>
  mov    $0x1,%esi
  mov    0xc(%rsp),%edi
  call   <dup2@plt>
L56:
  lea    0x1b0(%rsp),%rdi
  call   <exec@plt>
  mov    $0x0,%eax
  call   <getpid@plt>
  mov    %eax,%edx
  lea    D102(%rip),%rsi
  mov    $0x2,%edi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
  jmp    L232
L210:
  lea    0x1b0(%rsp),%rax
  mov    %rbp,%rsi
  mov    %rax,%rbp
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    D8(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  jmp    L48
```

tool_calls: name: unpack_data
arguments: label: D23
data_type: string
name: unpack_data
arguments: label: D14
data_type: string
name: unpack_data
arguments: label: D181
data_type: string
name: unpack_data
arguments: label: D45
data_type: string
name: unpack_data
arguments: label: D233
data_type: string
name: unpack_data
arguments: label: D176
data_type: string
name: unpack_data
arguments: label: D22
data_type: string
name: unpack_data
arguments: label: D8
data_type: string
name: unpack_data
arguments: label: D166
data_type: string
name: unpack_data
arguments: label: D215
data_type: string
name: unpack_data
arguments: label: D11
data_type: string
name: unpack_data
arguments: label: D50
data_type: string
name: unpack_data
arguments: label: D9
data_type: string
name: unpack_data
arguments: label: D86
data_type: string
name: unpack_data
arguments: label: D102
data_type: string

tool: D23: /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fossum/wsu_cs460/refs/heads/master/final/fsh.c

tool: D14: %s@%s$ 

tool: D181: >

tool: D45: ?

tool: D233: logout

tool: 

tool: D22: /bin/

tool: D8:  

tool: D166: >>

tool: D215: <

tool: D11: NULL output filename


tool: D50: %s: Could not open for writing


tool: D9: Could not open %s for reading


tool: D86: |

tool: D102: PID:%d failed to execute


assistant: ```c
int prompt() {
  int cid;
  char cwd[80], tty[80], request[255], command[255];
  while (1) {
    _assert(fstat(0, 0) < 0, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fossum/wsu_cs460/refs/heads/master/final/fsh.c", 76);
    _assert(fstat(1, 0) < 0, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fossum/wsu_cs460/refs/heads/master/final/fsh.c", 77);
    _assert(fstat(2, 0) < 0, "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/fossum/wsu_cs460/refs/heads/master/final/fsh.c", 78);
    getcwd(cwd);
    gettty(tty);
    printf("%s@%s$ ", tty, cwd);
    get_line(0, request, 255);
    if (strncmp(request, "?", 2) == 0) {
      print_help();
      continue;
    } else if (strncmp(request, "logout", 7) == 0) {
      logout();
    } else if (strncmp(request, "", 1) == 0) {
      continue;
    } else {
      char *tok;
      cid = fork();
      if (!cid) {
        strcpy(command, "/bin/");
        tok = strtok(request, " ");
        while (tok != 0) {
          if (strncmp(tok, ">>", 3) == 0) {
            tok = strtok(0, " ");
            if (tok == 0) {
              fprintf(2, "NULL output filename\n");
              exit(-1);
            }
            creat(tok);
            close(1);
            if (open(tok, 01 | 02000) < 0) {
              fprintf(2, "%s: Could not open for writing\n", tok);
              exit(-1);
            }
          } else if (strncmp(tok, ">", 2) == 0) {
            tok = strtok(0, " ");
            if (tok == 0) {
              fprintf(2, "NULL output filename\n");
              exit(-1);
            }
            close(1);
            creat(tok);
            if (open(tok, 01) < 0) {
              fprintf(2, "%s: Could not open for writing\n", tok);
              exit(-1);
            }
          } else if (strncmp(tok, "<", 2) == 0) {
            tok = strtok(0, " ");
            if (tok == 0) {
              fprintf(2, "NULL output filename\n");
              exit(-1);
            }
            if (stat(tok, 0) < 0) {
              fprintf(2, "Could not open %s for reading\n", tok);
              exit(-1);
            }
            close(0);
            if (open(tok, 00) < 0) {
              fprintf(2, "Could not open %s for reading\n", tok);
              exit(-1);
            }
          } else if (strncmp(tok, "|", 2) == 0) {
            int new_pipe[2], pipe_pid;
            pipe(new_pipe);
            pipe_pid = fork();
            if (!pipe_pid) {
              strcpy(command, "/bin/");
              close(new_pipe[1]);
              close(0);
              dup2(new_pipe[0], 0);
            } else {
              tok = 0;
              close(new_pipe[0]);
              close(1);
              dup2(new_pipe[1], 1);
              continue;
            }
          } else {
            strcat(command, tok);
            strcat(command, " ");
          }
          tok = strtok(0, " ");
        }
        exec(command);
        fprintf(2, "PID:%d failed to execute\r\n", getpid());
        exit(-1);
      } else {
        wait();
      }
    }
  }
  return (-1);
}
```