user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x24(%rbp)
  mov    %rsi,-0x30(%rbp)
  movq   $0x0,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    $0x2f,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x18(%rbp)
  cmpq   $0x0,-0x18(%rbp)
  jne    L111
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    $0x5c,%esi
  mov    %rax,%rdi
  call   <strrchr@plt>
  mov    %rax,-0x18(%rbp)
L111:
  cmpq   $0x0,-0x18(%rbp)
  je     L94
  addq   $0x1,-0x18(%rbp)
L94:
  cmpq   $0x0,-0x18(%rbp)
  jne    L87
  mov    -0x30(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x18(%rbp)
L87:
  cmpq   $0x0,-0x18(%rbp)
  je     L55
  mov    -0x18(%rbp),%rax
  mov    $0x2e,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0x10(%rbp)
L55:
  cmpq   $0x0,-0x18(%rbp)
  je     L32
  cmpq   $0x0,-0x10(%rbp)
  jne    L32
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x10(%rbp)
L32:
  cmpq   $0x0,-0x18(%rbp)
  jne    L33
  lea    D17(%rip),%rax
  mov    %rax,%rdi
  call   <BUF_strdup@plt>
  mov    %rax,-0x8(%rbp)
  jmp    L45
L33:
  mov    -0x10(%rbp),%rax
  sub    -0x18(%rbp),%rax
  add    $0x1,%eax
  mov    %eax,%edi
  call   <OPENSSL_malloc@plt>
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %eax,%edx
  mov    -0x18(%rbp),%rcx
  mov    -0x8(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0x10(%rbp),%rax
  sub    -0x18(%rbp),%rax
  mov    %rax,%rdx
  mov    -0x8(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L45:
  mov    -0x8(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L14
L0:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <islower@plt>
  test   %rax,%rax
  je     L82
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <toupper@plt>
  mov    -0x18(%rbp),%rdx
  mov    %al,(%rdx)
L82:
  addq   $0x1,-0x18(%rbp)
L14:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L0
  mov    -0x8(%rbp),%rax
  lea    D4(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  cmp    -0x18(%rbp),%rax
  jbe    L99
  mov    -0x10(%rbp),%rax
  sub    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x5f,%al
  jne    L99
  subq   $0x1,-0x10(%rbp)
L99:
  mov    -0x10(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x8(%rbp),%rax
  mov    %rax,%rsi
  lea    D26(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <OPENSSL_free@plt>
  mov    $0x0,%eax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D17
data_type: string
name: extract_symbolic_data
arguments: tag: D4
data_type: string
name: extract_symbolic_data
arguments: tag: D26
data_type: string

tool: D17: (unknown)

tool: D4: TEST

tool: D26: No %s support


assistant: ```c
int main(int argc, char *argv[]) {
  char *p, *q = 0, *program;
  p = strrchr(argv[0], '/');
  if (!p)
    p = strrchr(argv[0], '\\');
  if (p)
    p++;
  if (!p)
    p = argv[0];
  if (p)
    q = strchr(p, '.');
  if (p && !q)
    q = p + strlen(p);
  if (!p)
    program = BUF_strdup("(unknown)");
  else {
    program = OPENSSL_malloc((q - p) + 1);
    strncpy(program, p, q - p);
    program[q - p] = '\0';
  }
  for (p = program; *p; p++)
    if (islower((unsigned char)(*p)))
      *p = toupper((unsigned char)(*p));
  q = strstr(program, "TEST");
  if (q > p && q[-1] == '_')
    q--;
  *q = '\0';
  printf("No %s support\n", program);
  OPENSSL_free(program);
  return (0);
}
```