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

```asm
<format_mount_command>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xa8(%rbp)
  mov    %rsi,-0xb0(%rbp)
  mov    %rdx,-0xb8(%rbp)
  mov    %rcx,-0xc0(%rbp)
  mov    %r8,-0xc8(%rbp)
  mov    %r9,-0xd0(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0xd8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0xd8(%rbp),%rax
  movl   $0x0,(%rax)
  mov    -0xb0(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <escape_filename@plt>
  mov    %rax,-0x80(%rbp)
  mov    -0xa8(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <escape_filename@plt>
  mov    %rax,-0x78(%rbp)
  mov    -0xd0(%rbp),%rax
  mov    %rax,-0x98(%rbp)
  mov    -0x98(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0xc0(%rbp),%rax
  mov    $0x7c,%esi
  mov    %rax,%rdi
  call   <after_first@plt>
  mov    %rax,-0x90(%rbp)
  jmp    L4
L39:
  mov    -0x90(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x25,%al
  jne    L24
  lea    -0x70(%rbp),%rax
  mov    %rax,-0x88(%rbp)
  jmp    L175
L17:
  mov    -0x90(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x88(%rbp),%rax
  mov    %dl,(%rax)
  lea    -0x70(%rbp),%rdx
  mov    -0x88(%rbp),%rax
  sub    %rdx,%rax
  cmp    $0x5f,%rax
  ja     L162
  addq   $0x1,-0x88(%rbp)
L162:
  addq   $0x1,-0x90(%rbp)
L175:
  mov    -0x90(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L160
  mov    -0x90(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L17
L160:
  mov    -0x88(%rbp),%rax
  movb   $0x0,(%rax)
  lea    -0x70(%rbp),%rax
  lea    D42(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L44
  mov    -0xc8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x98(%rbp),%rax
  sub    -0xd0(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%ecx
  mov    -0x80(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <copy_str@plt>
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x98(%rbp)
  jmp    L4
L44:
  lea    -0x70(%rbp),%rax
  lea    D23(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L42
  mov    -0xc8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x98(%rbp),%rax
  sub    -0xd0(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%ecx
  mov    -0xb8(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <copy_str@plt>
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x98(%rbp)
  jmp    L4
L42:
  lea    -0x70(%rbp),%rax
  lea    D12(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L63
  mov    -0xc8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x98(%rbp),%rax
  sub    -0xd0(%rbp),%rax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,%ecx
  mov    -0x78(%rbp),%rdx
  mov    -0x98(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <copy_str@plt>
  mov    -0x98(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cltq
  add    %rax,-0x98(%rbp)
  jmp    L4
L63:
  lea    -0x70(%rbp),%rax
  lea    D21(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  je     L68
  lea    -0x70(%rbp),%rax
  lea    D7(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L4
L68:
  mov    -0xd8(%rbp),%rax
  movl   $0x1,(%rax)
  jmp    L4
L24:
  mov    -0x90(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x98(%rbp),%rax
  mov    %dl,(%rax)
  mov    -0x98(%rbp),%rax
  sub    -0xd0(%rbp),%rax
  mov    %rax,%rdx
  mov    -0xc8(%rbp),%rax
  sub    $0x1,%rax
  cmp    %rax,%rdx
  jae    L127
  addq   $0x1,-0x98(%rbp)
L127:
  addq   $0x1,-0x90(%rbp)
L4:
  mov    -0x90(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L39
  mov    -0x98(%rbp),%rax
  movb   $0x0,(%rax)
  mov    -0x78(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    -0x80(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L100
  call   <__stack_chk_fail@plt>
L100:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D42
type_guessed: string
name: disassemble_data
arguments: data_tag: D23
type_guessed: string
name: disassemble_data
arguments: data_tag: D12
type_guessed: string
name: disassemble_data
arguments: data_tag: D21
type_guessed: string
name: disassemble_data
arguments: data_tag: D7
type_guessed: string

tool: D42: %SOURCE_FILE

tool: D23: %PARAM

tool: D12: %DESTINATION_DIR

tool: D21: %FOREGROUND

tool: D7: %CLEAR

assistant: ```c
void format_mount_command(const char mount_point[], const char file_name[], const char param[], const char format[], size_t buf_size, char buf[], int *foreground) {
  char *buf_pos;
  const char *prog_pos;
  char *escaped_path;
  char *escaped_mount_point;
  *foreground = 0;
  escaped_path = escape_filename(file_name, 0);
  escaped_mount_point = escape_filename(mount_point, 0);
  buf_pos = buf;
  buf_pos[0] = '\0';
  prog_pos = after_first(format, '|');
  while (*prog_pos != '\0') {
    if (*prog_pos == '%') {
      char cmd_buf[96];
      char *cmd_pos;
      cmd_pos = cmd_buf;
      while (*prog_pos != '\0' && *prog_pos != ' ') {
        *cmd_pos = *prog_pos;
        if (cmd_pos - cmd_buf < sizeof(cmd_buf))
          cmd_pos++;
        prog_pos++;
      }
      *cmd_pos = '\0';
      if (!strcmp(cmd_buf, "%SOURCE_FILE")) {
        copy_str(buf_pos, buf_size - (buf_pos - buf), escaped_path);
        buf_pos += strlen(buf_pos);
      } else if (!strcmp(cmd_buf, "%PARAM")) {
        copy_str(buf_pos, buf_size - (buf_pos - buf), param);
        buf_pos += strlen(buf_pos);
      } else if (!strcmp(cmd_buf, "%DESTINATION_DIR")) {
        copy_str(buf_pos, buf_size - (buf_pos - buf), escaped_mount_point);
        buf_pos += strlen(buf_pos);
      } else if (!strcmp(cmd_buf, "%FOREGROUND") || !strcmp(cmd_buf, "%CLEAR")) {
        *foreground = 1;
      }
    } else {
      *buf_pos = *prog_pos;
      if (buf_pos - buf < buf_size - 1)
        buf_pos++;
      prog_pos++;
    }
  }
  *buf_pos = '\0';
  free(escaped_mount_point);
  free(escaped_path);
}
```