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

```asm
<cmd_exec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <detect_out_direction@plt>
  mov    %eax,%r13d
  mov    %r12,%rdi
  call   <detect_in_direction@plt>
  cmp    $0xffffffff,%r13d
  je     L79
  mov    %rsp,-0x48(%rbp)
  lea    0x1(%r13),%eax
  mov    %eax,-0x4c(%rbp)
  cltq
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L88:
  cmp    %rdx,%rsp
  je     L23
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L88
L23:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L121
  orq    $0x0,-0x8(%rsp,%rax,1)
L121:
  mov    %rsp,%r14
  test   %r13d,%r13d
  jle    L25
  mov    %r13d,%r15d
  mov    $0x0,%ebx
L62:
  mov    %ebx,%esi
  mov    %r12,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,(%r14,%rbx,8)
  add    $0x1,%rbx
  cmp    %r15,%rbx
  jne    L62
L25:
  movslq %r13d,%r13
  movq   $0x0,(%r14,%r13,8)
  mov    -0x4c(%rbp),%esi
  mov    %r12,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,%rsi
  mov    %r14,%rdi
  call   <cmd_output_direction@plt>
  mov    -0x48(%rbp),%rsp
L47:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L83
  mov    $0x1,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L79:
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  je     L114
  mov    %rsp,-0x48(%rbp)
  lea    0x1(%rax),%eax
  mov    %eax,-0x4c(%rbp)
  cltq
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L155:
  cmp    %rdx,%rsp
  je     L54
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L155
L54:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L3
  orq    $0x0,-0x8(%rsp,%rax,1)
L3:
  mov    %rsp,%r13
  test   %r14d,%r14d
  jle    L90
  mov    %r14d,%r15d
  mov    $0x0,%ebx
L72:
  mov    %ebx,%esi
  mov    %r12,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,0x0(%r13,%rbx,8)
  add    $0x1,%rbx
  cmp    %r15,%rbx
  jne    L72
L90:
  movslq %r14d,%r14
  movq   $0x0,0x0(%r13,%r14,8)
  mov    -0x4c(%rbp),%esi
  mov    %r12,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,%rsi
  mov    %r13,%rdi
  call   <cmd_input_direction@plt>
  mov    -0x48(%rbp),%rsp
  jmp    L47
L114:
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,%rdi
  mov    %r12,%rsi
  call   <cmd_exec_helper@plt>
  lea    D25(%rip),%rdi
  call   <getenv@plt>
  mov    %rax,%rdi
  lea    D28(%rip),%rsi
  call   <strtok@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L47
  lea    D36(%rip),%r15
  lea    D28(%rip),%r14
L17:
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %rax,%rbx
  mov    %r13,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    %r15,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    %r14,%rsi
  mov    $0x0,%edi
  call   <strtok@plt>
  mov    %rax,%r13
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <cmd_exec_helper@plt>
  test   %r13,%r13
  jne    L17
  jmp    L47
L83:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D25
data_type: string
name: retrieve_data
arguments: data_label: D28
data_type: string
name: retrieve_data
arguments: data_label: D36
data_type: string

tool: D25: PATH

tool: D28: :

tool: D36: /

assistant: ```c
int cmd_exec(struct tokens *tokens) {
  int out = detect_out_direction(tokens);
  int in = detect_in_direction(tokens);
  if (out != -1) {
    char *argv[out + 1];
    int j;
    for (j = 0; j < out; j++) {
      argv[j] = tokens_get_token(tokens, j);
    }
    argv[out] = NULL;
    char *filename = tokens_get_token(tokens, out + 1);
    cmd_output_direction(argv, filename);
  } else if (in != -1) {
    char *argv[in + 1];
    int j;
    for (j = 0; j < in; j++) {
      argv[j] = tokens_get_token(tokens, j);
    }
    argv[in] = NULL;
    char *filename = tokens_get_token(tokens, in + 1);
    cmd_input_direction(argv, filename);
  } else {
    cmd_exec_helper(tokens_get_token(tokens, 0), tokens);
    char *path = getenv("PATH");
    char *pch;
    pch = strtok(path, ":");
    while (pch != NULL) {
      char *str = malloc(100);
      strcat(str, pch);
      strcat(str, "/");
      strcat(str, tokens_get_token(tokens, 0));
      pch = strtok(NULL, ":");
      cmd_exec_helper(str, tokens);
    }
  }
  return 1;
}
```