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

```asm
<getApplicationCommandLineTemplate>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x28,%rsp
  mov    %rdi,%r12
  mov    %rcx,(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x2018(%rsp)
  xor    %eax,%eax
  test   %r8,%r8
  je     L110
  mov    %rsi,%rbx
  mov    %rdx,%r14
  mov    %r8,%rbp
  mov    $0x0,%r13d
L182:
  mov    (%rbx,%r13,8),%rsi
  mov    %r12,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L24
  add    $0x1,%r13
  cmp    %r13,%rbp
  jne    L182
  mov    %r12,%rdi
  call   <getCommandExecutableName@plt>
  mov    %rax,%r15
  test   %rbp,%rbp
  je     L25
L225:
  mov    $0x0,%r13d
L69:
  mov    (%rbx,%r13,8),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L108
  add    $0x1,%r13
  cmp    %r13,%rbp
  ja     L69
L25:
  mov    %r15,%rdi
  call   <free@plt>
  movb   $0x0,0x10(%rsp)
  jmp    L36
L24:
  mov    %r13d,0xc(%rsp)
  cmp    $0xffffffff,%r13d
  je     L17
  movb   $0x0,0x10(%rsp)
L221:
  movslq 0xc(%rsp),%r13
  lea    0x0(,%r13,8),%rbp
  mov    (%r14,%r13,8),%rdi
  lea    D136(%rip),%rsi
  call   <strcmp@plt>
  mov    %rax,%r14
  add    (%rsp),%rbp
  mov    0x0(%rbp),%r15
  mov    %r15,%rdi
  call   <strlen@plt>
  test   %r14,%r14
  je     L213
  test   %rax,%rax
  jg     L6
  lea    0x10(%rsp),%rdi
  mov    %r12,%rsi
  call   <strcat@plt>
L64:
  mov    (%rbx,%r13,8),%rdi
  lea    D165(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L228
  lea    0x10(%rsp),%rdi
  lea    D152(%rip),%rsi
  call   <strcat@plt>
  jmp    L145
L108:
  mov    %r13d,0xc(%rsp)
  mov    %r15,%rdi
  call   <free@plt>
  movb   $0x0,0x10(%rsp)
  cmp    $0xffffffff,%r13d
  jne    L221
L36:
  lea    0x10(%rsp),%rbx
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D69(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
L145:
  lea    0x10(%rsp),%rdi
  call   <strdup@plt>
  mov    0x2018(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L140
  add    $0x2028,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L213:
  lea    0x10(%rsp),%r14
  lea    D67(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r12,%rdi
  call   <escapeQuotesAndBackslashes@plt>
  mov    %rax,%rbp
  mov    %rax,%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %rbp,%rdi
  call   <free@plt>
  mov    (%rbx,%r13,8),%rdi
  lea    D165(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L190
  lea    0x10(%rsp),%rbx
  lea    D21(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D112(%rip),%rbp
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D177(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
L21:
  lea    0x10(%rsp),%rdi
  lea    D94(%rip),%rsi
  call   <strcat@plt>
  jmp    L145
L6:
  lea    D77(%rip),%rsi
  mov    %r15,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L63
  lea    0x10(%rsp),%rdi
  lea    D16(%rip),%rsi
  call   <strcat@plt>
  jmp    L64
L63:
  lea    0x10(%rsp),%r12
  lea    D169(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D94(%rip),%r14
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    0x0(%rbp),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  jmp    L64
L228:
  lea    0x10(%rsp),%rbx
  lea    D21(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D94(%rip),%rbp
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D177(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  jmp    L145
L17:
  mov    %r12,%rdi
  call   <getCommandExecutableName@plt>
  mov    %rax,%r15
  jmp    L225
L190:
  lea    0x10(%rsp),%rdi
  lea    D152(%rip),%rsi
  call   <strcat@plt>
  jmp    L21
L110:
  call   <getCommandExecutableName@plt>
  mov    %rax,%r15
  jmp    L25
L140:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: label: D136
type: string
name: read_data
arguments: label: D165
type: string
name: read_data
arguments: label: D152
type: string
name: read_data
arguments: label: D69
type: string
name: read_data
arguments: label: D67
type: string
name: read_data
arguments: label: D21
type: string
name: read_data
arguments: label: D112
type: string
name: read_data
arguments: label: D177
type: string
name: read_data
arguments: label: D94
type: string
name: read_data
arguments: label: D77
type: string
name: read_data
arguments: label: D16
type: string
name: read_data
arguments: label: D169
type: string

tool: D136: y

tool: D165: netscape

tool: D152:  -remote "openFile(%s)"

tool: D69:  "%s"

tool: D67: xterm -e "

tool: D21:  

tool: D112: \"

tool: D177: %s

tool: D94: "

tool: D77: Finder

tool: D16: open -R 

tool: D169: open -a 

assistant: ```c
char *getApplicationCommandLineTemplate(char *cmd, char *known[], char *xterm[], char *opencmd[], size_t total) {
  size_t i;
  int match;
  char *name;
  char localResult[2048 * 4];
  int isXterm;
  int isOpencmd;
  char *result;
  char *escaped;
  match = -1;
  for (i = 0; i < total; i++) {
    if (strcmp(cmd, known[i]) == 0) {
      match = i;
      break;
    }
  }
  if (match == -1) {
    name = getCommandExecutableName(cmd);
    for (i = 0; i < total; i++) {
      if (strcmp(name, known[i]) == 0) {
        match = i;
        break;
      }
    }
    free(name);
  }
  localResult[0] = '\0';
  if (match != -1) {
    isXterm = 0;
    isOpencmd = 0;
    if (strcmp(xterm[match], "y") == 0) {
      isXterm = 1;
    }
    if (strlen(opencmd[match]) > 0) {
      isOpencmd = 1;
    }
    if (isXterm) {
      strcat(localResult, "xterm -e \"");
    }
    if (isXterm) {
      escaped = escapeQuotesAndBackslashes(cmd);
      strcat(localResult, escaped);
      free(escaped);
    } else {
      if (isOpencmd) {
        if (strcmp(opencmd[match], "Finder") == 0) {
          strcat(localResult, "open -R ");
        } else {
          strcat(localResult, "open -a ");
          strcat(localResult, "\"");
          strcat(localResult, opencmd[match]);
          strcat(localResult, "\"");
        }
      } else {
        strcat(localResult, cmd);
      }
    }
    if (strcmp(known[match], "netscape") == 0) {
      strcat(localResult, " -remote \"openFile(%s)\"");
    } else {
      strcat(localResult, " ");
      if (isXterm) {
        strcat(localResult, "\\\"");
      } else {
        strcat(localResult, "\"");
      }
      strcat(localResult, "%s");
      if (isXterm) {
        strcat(localResult, "\\\"");
      } else {
        strcat(localResult, "\"");
      }
    }
    if (isXterm) {
      strcat(localResult, "\"");
    }
  } else {
    strcat(localResult, cmd);
    strcat(localResult, " \"%s\"");
  }
  result = strdup(localResult);
  return result;
}
```