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

```asm
<appaserver_link_get_tail_half>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1a8,%rsp
  mov    %rdi,%r13
  mov    %rsi,%r15
  mov    %rcx,%r12
  mov    %r8d,%r14d
  mov    %r9,%rbp
  mov    0x1e0(%rsp),%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x198(%rsp)
  xor    %eax,%eax
  movb   $0x0,0x90(%rsp)
  test   %rdx,%rdx
  je     L56
  cmpb   $0x0,(%rdx)
  jne    L128
L56:
  test   %r12,%r12
  je     L113
  cmpb   $0x0,(%r12)
  jne    L72
L113:
  test   %rbp,%rbp
  je     L32
  cmpb   $0x0,0x0(%rbp)
  jne    L82
L32:
  test   %r14d,%r14d
  jne    L36
  movb   $0x0,0x110(%rsp)
L107:
  movb   $0x0,0x10(%rsp)
  test   %r13,%r13
  je     L19
  lea    0x10(%rsp),%rdi
  lea    D24(%rip),%r8
  mov    %r13,%rcx
  lea    D80(%rip),%rdx
  lea    D22(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
L19:
  test   %rbx,%rbx
  lea    D83(%rip),%rax
  cmove  %rax,%rbx
  lea    0x90(%rsp),%r8
  cmpb   $0x0,0x90(%rsp)
  lea    D37(%rip),%rax
  cmove  %rax,%r8
  lea    0x10(%rsp),%rdx
  sub    $0x8,%rsp
  push   %rbx
  lea    0x120(%rsp),%r9
  mov    %r15,%rcx
  lea    D17(%rip),%rsi
  lea    D101(%rip),%rbx
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <sprintf@plt>
  add    $0x10,%rsp
  mov    0x198(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L27
  mov    %rbx,%rax
  add    $0x1a8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L128:
  lea    0x90(%rsp),%rdi
  lea    D52(%rip),%rsi
  call   <sprintf@plt>
  jmp    L56
L72:
  lea    0x90(%rsp),%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  mov    0x8(%rsp),%rcx
  lea    (%rcx,%rax,1),%rdi
  mov    %r12,%rdx
  lea    D52(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L113
L82:
  lea    0x110(%rsp),%rdi
  mov    %rbp,%rdx
  lea    D52(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L107
L36:
  lea    0x110(%rsp),%rdi
  mov    %r14d,%edx
  lea    D23(%rip),%rsi
  mov    $0x0,%eax
  call   <sprintf@plt>
  jmp    L107
L27:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D24
data_type: string
name: read_data
arguments: tag: D80
data_type: string
name: read_data
arguments: tag: D22
data_type: string
name: read_data
arguments: tag: D83
data_type: string
name: read_data
arguments: tag: D37
data_type: string
name: read_data
arguments: tag: D17
data_type: string
name: read_data
arguments: tag: D52
data_type: string
name: read_data
arguments: tag: D23
data_type: string

tool: D24: data

tool: D80: appaserver

tool: D22: /%s/%s/%s/

tool: D83: null

tool: 

tool: D17: %s%s%s%s.%s

tool: D52: _%s

tool: D23: _%d

assistant: ```c
char *appaserver_link_get_tail_half(char *application_name, char *filename_stem, char *begin_date_string, char *end_date_string, pid_t process_id, char *session, char *extension) {
  static char tail_half[512];
  char application_part[128];
  char date_part[128];
  char key_part[128];
  *date_part = '\0';
  if (begin_date_string && *begin_date_string) {
    sprintf(date_part, "_%s", begin_date_string);
  }
  if (end_date_string && *end_date_string) {
    sprintf(date_part + strlen(date_part), "_%s", end_date_string);
  }
  if (session && *session) {
    sprintf(key_part, "_%s", session);
  } else if (process_id) {
    sprintf(key_part, "_%d", process_id);
  } else {
    *key_part = '\0';
  }
  *application_part = '\0';
  if (application_name) {
    sprintf(application_part, "/%s/%s/%s/", "appaserver", application_name, "data");
  }
  sprintf(tail_half, "%s%s%s%s.%s", application_part, filename_stem, (*date_part) ? date_part : "", key_part, (extension) ? extension : "null");
  return tail_half;
}
```