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

```asm
<cmd_exec>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x28,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  call   <detect_out_direction@plt>
  mov    %r14,%rdi
  movslq %eax,%r12
  call   <detect_in_direction@plt>
  cmp    $0xffffffff,%r12d
  je     L83
  lea    0x1(%r12),%r15d
  mov    %rsp,%rcx
  mov    %rsp,-0x48(%rbp)
  movslq %r15d,%rax
  lea    0xf(,%rax,8),%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L34
L121:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L121
L34:
  and    $0xfff,%edx
  sub    %rdx,%rsp
  test   %rdx,%rdx
  je     L4
  orq    $0x0,-0x8(%rsp,%rdx,1)
L4:
  mov    %rsp,%r13
  test   %r12d,%r12d
  jle    L166
  xor    %ebx,%ebx
L86:
  mov    %ebx,%esi
  mov    %r14,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,0x0(%r13,%rbx,8)
  add    $0x1,%rbx
  cmp    %rbx,%r12
  jne    L86
L166:
  movq   $0x0,0x0(%r13,%r12,8)
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <tokens_get_token@plt>
  mov    %r13,%rdi
  mov    %rax,%rsi
  call   <cmd_output_direction@plt>
  mov    -0x48(%rbp),%rsp
L112:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  lea    -0x28(%rbp),%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L83:
  cmp    $0xffffffff,%eax
  je     L109
  lea    0x1(%rax),%r13d
  mov    %rsp,-0x48(%rbp)
  mov    %rsp,%rsi
  movslq %r13d,%rdx
  lea    0xf(,%rdx,8),%rdx
  mov    %rdx,%rcx
  and    $0xfffffffffffff000,%rdx
  and    $0xfffffffffffffff0,%rcx
  sub    %rdx,%rsi
L160:
  cmp    %rsi,%rsp
  je     L25
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L160
  nop
L25:
  and    $0xfff,%ecx
  sub    %rcx,%rsp
  test   %rcx,%rcx
  jne    L137
L60:
  mov    %rsp,%r12
  movslq %eax,%rbx
  xor    %r15d,%r15d
  test   %eax,%eax
  jle    L17
  nop
L144:
  mov    %r15d,%esi
  mov    %r14,%rdi
  call   <tokens_get_token@plt>
  mov    %rax,(%r12,%r15,8)
  add    $0x1,%r15
  cmp    %rbx,%r15
  jne    L144
L17:
  movq   $0x0,(%r12,%rbx,8)
  mov    %r13d,%esi
  mov    %r14,%rdi
  call   <tokens_get_token@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  call   <cmd_input_direction@plt>
  mov    -0x48(%rbp),%rsp
  jmp    L112
  nop
L109:
  xor    %esi,%esi
  mov    %r14,%rdi
  lea    D17(%rip),%rbx
  call   <tokens_get_token@plt>
  mov    %r14,%rsi
  mov    %rax,%rdi
  call   <cmd_exec_helper@plt>
  lea    D28(%rip),%rdi
  call   <getenv@plt>
  mov    %rbx,%rsi
  mov    %rax,%rdi
  call   <strtok@plt>
  mov    %rax,%r13
  test   %rax,%rax
  je     L112
  lea    D21(%rip),%r15
  cs nopw 0x0(%rax,%rax,1)
L128:
  mov    $0x64,%edi
  call   <malloc@plt>
  mov    %r13,%rsi
  mov    %rax,%r12
  mov    %rax,%rdi
  call   <strcat@plt>
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  xor    %esi,%esi
  mov    %r14,%rdi
  call   <tokens_get_token@plt>
  mov    %r12,%rdi
  mov    %rax,%rsi
  call   <strcat@plt>
  xor    %edi,%edi
  mov    %rbx,%rsi
  call   <strtok@plt>
  mov    %r14,%rsi
  mov    %r12,%rdi
  mov    %rax,%r13
  call   <cmd_exec_helper@plt>
  test   %r13,%r13
  jne    L128
  jmp    L112
L137:
  orq    $0x0,-0x8(%rsp,%rcx,1)
  jmp    L60
L41:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D17
data_type: string
name: unpack_data
arguments: tag: D28
data_type: string
name: unpack_data
arguments: tag: D21
data_type: string

tool: D17: :

tool: D28: PATH

tool: D21: /

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;
}
```