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

```asm
<COM_FixPath>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x8(%rbp)
  movl   $0xffffffff,-0x4(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L115
L130:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x5c,%eax
  je     L148
  cmp    $0x5c,%eax
  jg     L170
  cmp    $0x2e,%eax
  je     L202
  cmp    $0x2f,%eax
  jne    L170
L148:
  cmpl   $0x0,-0x8(%rbp)
  je     L26
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L174
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L65
  cmpl   $0x1,-0x8(%rbp)
  je     L56
  cmpl   $0x1,-0x8(%rbp)
  jle    L65
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L65
L56:
  subl   $0x1,-0x8(%rbp)
  jmp    L7
L65:
  mov    -0x8(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2f,(%rax)
  jmp    L7
L202:
  cmpl   $0x1,-0x8(%rbp)
  jle    L170
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L170
  cmpl   $0x0,-0x4(%rbp)
  jle    L122
  mov    -0x4(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L122
  mov    -0x4(%rbp),%eax
  sub    $0x1,%eax
  mov    %eax,-0xc(%rbp)
  jmp    L264
L32:
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L112
  subl   $0x1,-0xc(%rbp)
L264:
  cmpl   $0x0,-0xc(%rbp)
  jns    L32
  jmp    L228
L112:
  nop
L228:
  mov    -0xc(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  add    $0x1,%eax
  mov    %eax,-0x8(%rbp)
  jmp    L7
L122:
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x2(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  je     L253
L170:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  lea    (%rdx,%rax,1),%rcx
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  movzbl (%rcx),%eax
  mov    %al,(%rdx)
  jmp    L7
L26:
  nop
  jmp    L7
L174:
  nop
  jmp    L7
L253:
  nop
L7:
  addl   $0x1,-0x10(%rbp)
L115:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L130
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  cmpl   $0x0,-0x8(%rbp)
  je     L149
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L149
  mov    -0x8(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L149:
  nop
  pop    %rbp
  ret
```

assistant: ```c
void COM_FixPath(char *path) {
  int i, j, len = 0, lastLash = -1;
  for (i = 0; path[i]; i++) {
    switch (path[i]) {
    case '\\':
    case '/':
      if (!len)
        break;
      if (path[len - 1] == '/')
        break;
      if (path[len - 1] == '.') {
        if (len == 1 || (len >= 2 && path[len - 2] != '.')) {
          len--;
          break;
        }
      }
      lastLash = len;
      path[len++] = '/';
      break;
    case '.':
      if (len >= 2 && path[len - 1] == '.') {
        if (lastLash > 0 && path[lastLash - 1] != '.') {
          for (j = lastLash - 1; j >= 0; j--) {
            if (path[j] == '/')
              break;
          }
          lastLash = j;
          len = lastLash + 1;
          break;
        }
        if (path[len - 2] == '.')
          break;
      }
    default:
      path[len++] = path[i];
      break;
    }
  }
  path[len] = '\0';
  if (len && path[len - 1] == '/')
    path[len - 1] = '\0';
}
```