user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<uMountDrive>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %rsp,%rax
  mov    %rax,%rbx
  lea    D59(%rip),%rax
  mov    %rax,%rsi
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x58(%rbp)
  cmpq   $0x0,-0x58(%rbp)
  jne    L53
  mov    %rbx,%rsp
  jmp    L116
L53:
  lea    D64(%rip),%rax
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x50(%rbp)
  movl   $0x64,-0x5c(%rbp)
  movl   $0x0,-0x60(%rbp)
  mov    -0x5c(%rbp),%eax
  mov    %eax,%edx
  sub    $0x1,%rdx
  mov    %rdx,-0x48(%rbp)
  mov    %eax,%edx
  mov    %rdx,%r14
  mov    $0x0,%r15d
  mov    %eax,%edx
  mov    %rdx,%r12
  mov    $0x0,%r13d
  mov    %eax,%edx
  mov    $0x10,%eax
  sub    $0x1,%rax
  add    %rdx,%rax
  mov    $0x10,%esi
  mov    $0x0,%edx
  div    %rsi
  imul   $0x10,%rax,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffff000,%rcx
  mov    %rsp,%rdx
  sub    %rcx,%rdx
L87:
  cmp    %rdx,%rsp
  je     L111
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L87
L111:
  mov    %rax,%rdx
  and    $0xfff,%edx
  sub    %rdx,%rsp
  mov    %rax,%rdx
  and    $0xfff,%edx
  test   %rdx,%rdx
  je     L47
  and    $0xfff,%eax
  sub    $0x8,%rax
  add    %rsp,%rax
  orq    $0x0,(%rax)
L47:
  mov    %rsp,%rax
  add    $0x0,%rax
  mov    %rax,-0x40(%rbp)
  jmp    L102
L103:
  mov    -0x68(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strstr@plt>
  test   %rax,%rax
  je     L128
  addl   $0x1,-0x60(%rbp)
  jmp    L102
L128:
  cmpl   $0x0,-0x60(%rbp)
  je     L17
  cmpl   $0x9,-0x60(%rbp)
  jne    L79
L17:
  mov    -0x40(%rbp),%rdx
  mov    -0x50(%rbp),%rax
  lea    D12(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  jmp    L102
L79:
  addl   $0x1,-0x60(%rbp)
L102:
  mov    -0x58(%rbp),%rdx
  mov    -0x5c(%rbp),%ecx
  mov    -0x40(%rbp),%rax
  mov    %ecx,%esi
  mov    %rax,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L103
  mov    -0x58(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  lea    D9(%rip),%rax
  mov    %rax,%rdi
  call   <remove@plt>
  lea    D9(%rip),%rax
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <rename@plt>
  mov    %rbx,%rsp
L116:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L60
  call   <__stack_chk_fail@plt>
L60:
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
```

tool_calls: name: parse_data
arguments: label: D59
type: string
name: parse_data
arguments: label: D9
type: string
name: parse_data
arguments: label: D64
type: string
name: parse_data
arguments: label: D2
type: string
name: parse_data
arguments: label: D12
type: string

tool: D59: r

tool: D9: /dtv/usb/log

tool: D64: w

tool: D2: /dtv/usb/log_tmp

tool: D12: %s

assistant: ```c
void uMountDrive(char *mnt) {
  FILE *log = fopen("/dtv/usb/log", "r");
  if (log == NULL)
    return;
  FILE *tmp = fopen("/dtv/usb/log_tmp", "w");
  unsigned int lineL = 100, deleted = 0;
  char line[lineL];
  while (fgets(line, lineL, log) != NULL) {
    if (strstr(line, mnt) != NULL)
      deleted++;
    else if (deleted == 0 || deleted == 9) {
      fprintf(tmp, "%s", line);
    } else
      deleted++;
  }
  fclose(log);
  fclose(tmp);
  remove("/dtv/usb/log");
  rename("/dtv/usb/log_tmp", "/dtv/usb/log");
}
```