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

```asm
<get_dist_conf_name>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x118,%rsp
  mov    %rsi,%r12
  mov    %rdx,%rbp
  mov    %ecx,%r13d
  mov    %fs:0x28,%rax
  mov    %rax,0x108(%rsp)
  xor    %eax,%eax
  test   %rdi,%rdi
  je     L108
  mov    %rdi,%r15
  mov    %rsp,%rbx
  mov    %rdi,%rcx
  lea    D54(%rip),%rdx
  mov    $0x100,%esi
  mov    %rbx,%rdi
  call   <snprintf@plt>
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,%rbx
  lea    D84(%rip),%r14
  jmp    L36
L28:
  movb   $0x0,(%rbx)
  mov    %rsp,%rax
  cmp    %rax,%rbx
  jbe    L52
L36:
  mov    %rsp,%r8
  mov    %r12,%rcx
  mov    %r14,%rdx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %rbp,%rdi
  call   <stat_file@plt>
  test   %rax,%rax
  jne    L93
  mov    %rsp,%rax
  cmp    %rax,%rbx
  jbe    L84
L54:
  cmpb   $0x2d,(%rbx)
  je     L28
  sub    $0x1,%rbx
  cmp    %rax,%rbx
  jne    L54
  mov    %rsp,%rbx
L84:
  movb   $0x0,(%rbx)
L52:
  lea    D87(%rip),%r8
  mov    %r12,%rcx
  lea    D20(%rip),%rdx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %r15,%rcx
  lea    D44(%rip),%rdx
  mov    $0x0,%esi
  mov    $0xffffffff,%edi
  call   <logger@plt>
L62:
  mov    %rbp,%rdi
  call   <stat_file@plt>
  mov    %rax,%rdx
  mov    $0x0,%eax
  test   %rdx,%rdx
  je     L89
L66:
  mov    0x108(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L75
  add    $0x118,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L108:
  lea    D87(%rip),%r8
  mov    %rsi,%rcx
  lea    D20(%rip),%rdx
  mov    %r13d,%esi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %rbp,%rcx
  lea    D50(%rip),%rdx
  mov    $0x0,%esi
  mov    $0xffffffff,%edi
  call   <logger@plt>
  jmp    L62
L89:
  mov    %rbp,%rcx
  lea    D18(%rip),%rdx
  mov    $0x0,%esi
  mov    $0xffffffff,%edi
  call   <logger@plt>
  mov    $0x6b,%eax
  jmp    L66
L93:
  mov    $0x0,%eax
  jmp    L66
L75:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D54
type_infered: string
name: disassemble_data
arguments: data_tag: D84
type_infered: string
name: disassemble_data
arguments: data_tag: D87
type_infered: string
name: disassemble_data
arguments: data_tag: D20
type_infered: string
name: disassemble_data
arguments: data_tag: D44
type_infered: string
name: disassemble_data
arguments: data_tag: D50
type_infered: string
name: disassemble_data
arguments: data_tag: D18
type_infered: string

tool: D54: %s

tool: D84: %s/%s.conf

tool: D87: default

tool: D20: %s/%s

tool: D44: Warning: configuration file for distribution %s not found default used

tool: D50: Warning: distribution not specified default used %s

tool: D18: Distribution configuration not found %s

assistant: ```c
int get_dist_conf_name(char *dist_name, char *dir, char *file, int len) {
  char buf[256];
  char *ep;
  if (dist_name != NULL) {
    snprintf(buf, sizeof(buf), "%s", dist_name);
    ep = buf + strlen(buf);
    do {
      snprintf(file, len, "%s/%s.conf", dir, buf);
      if (stat_file(file))
        return 0;
      while (ep > buf && *ep != '-')
        --ep;
      *ep = 0;
    } while (ep > buf);
    snprintf(file, len, "%s/%s", dir, "default");
    logger(-1, 0,
           "Warning: configuration file"
           " for distribution %s not found default used",
           dist_name);
  } else {
    snprintf(file, len, "%s/%s", dir, "default");
    logger(-1, 0,
           "Warning: distribution not specified"
           " default used %s",
           file);
  }
  if (!stat_file(file)) {
    logger(-1, 0, "Distribution configuration not found %s", file);
    return 107;
  }
  return 0;
}
```