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

```asm
<wfile_remove_dots>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r13
  movzbl (%rdi),%edi
  cmp    $0x2e,%dil
  je     L254
  test   %dil,%dil
  je     L20
L192:
  mov    %r13,%rbx
  mov    $0x0,%r15d
  mov    $0xffffffff,%r12d
  mov    $0x0,%ebp
  mov    $0x0,%r14d
  jmp    L33
L254:
  cmpb   $0x0,0x1(%r13)
  jne    L192
L20:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L129:
  movsbl %dil,%edi
  call   <wfile_eitherslash@plt>
  test   %rax,%rax
  je     L135
  cmpb   $0x2e,0x1(%r13,%r14,1)
  je     L241
L135:
  movsbl (%rbx),%edi
  call   <wfile_eitherslash@plt>
  test   %rax,%rax
  jne    L275
L36:
  cmpb   $0x2e,(%rbx)
  mov    $0xffffffff,%eax
  cmovne %eax,%r15d
L151:
  add    $0x1,%ebp
  movslq %ebp,%r14
  lea    0x0(%r13,%r14,1),%rbx
  movzbl (%rbx),%edi
  test   %dil,%dil
  je     L20
L33:
  test   %r12d,%r12d
  js     L174
  test   %r15d,%r15d
  jne    L129
L174:
  test   %r12d,%r12d
  jns    L135
  cmpb   $0x2e,(%rbx)
  je     L41
L268:
  movsbl (%rbx),%edi
  call   <wfile_eitherslash@plt>
  mov    %ebp,%r12d
  test   %rax,%rax
  je     L36
  mov    $0x0,%r15d
  mov    $0xffffffff,%r12d
  jmp    L151
L241:
  cmpb   $0x2e,0x2(%r13,%r14,1)
  jne    L135
  lea    0x3(%r13,%r14,1),%r14
  movsbl (%r14),%edi
  call   <wfile_eitherslash@plt>
  test   %rax,%rax
  jne    L199
  cmpb   $0x0,(%r14)
  jne    L135
L217:
  lea    0x3(%rbp),%ecx
L47:
  movslq %ecx,%rcx
  movzbl 0x0(%r13,%rcx,1),%edx
  lea    0x1(%r12),%eax
  cltq
  movslq %r12d,%rsi
  sub    %rsi,%rcx
  add    %r13,%rcx
  test   %dl,%dl
  je     L236
L223:
  mov    %eax,%r12d
  mov    %dl,-0x1(%r13,%rax,1)
  add    $0x1,%rax
  movzbl -0x1(%rcx,%rax,1),%edx
  test   %dl,%dl
  jne    L223
L236:
  movslq %r12d,%r12
  movb   $0x0,0x0(%r13,%r12,1)
  mov    $0x0,%r15d
  mov    $0xffffffff,%r12d
  mov    $0xffffffff,%ebp
  jmp    L151
L199:
  lea    0x4(%rbp),%ecx
  cmpb   $0x0,(%r14)
  jne    L47
  jmp    L217
L41:
  lea    0x1(%r13,%r14,1),%r12
  movsbl (%r12),%edi
  call   <wfile_eitherslash@plt>
  test   %rax,%rax
  jne    L114
  cmpb   $0x0,(%r12)
  jne    L268
L292:
  lea    0x1(%rbp),%ecx
  jmp    L0
L114:
  lea    0x2(%rbp),%ecx
  cmpb   $0x0,(%r12)
  je     L292
L0:
  movslq %ecx,%rcx
  movzbl 0x0(%r13,%rcx,1),%edx
  lea    0x1(%rbp),%eax
  cltq
  movslq %ebp,%rsi
  sub    %rsi,%rcx
  add    %r13,%rcx
  test   %dl,%dl
  je     L202
L253:
  mov    %eax,%ebp
  mov    %dl,-0x1(%r13,%rax,1)
  add    $0x1,%rax
  movzbl -0x1(%rcx,%rax,1),%edx
  test   %dl,%dl
  jne    L253
L202:
  movslq %ebp,%rbp
  movb   $0x0,0x0(%r13,%rbp,1)
  mov    $0x0,%r15d
  mov    $0xffffffff,%r12d
  mov    $0xffffffff,%ebp
  jmp    L151
L275:
  mov    $0x0,%r15d
  mov    $0xffffffff,%r12d
  jmp    L151
```

assistant: ```c
void wfile_remove_dots(char *s) {
  int i, j, ppos, nondot;
  if (s[0] == '.' && s[1] == '\0')
    return;
  ppos = -1;
  nondot = 0;
  for (i = 0; s[i] != '\0'; i++) {
    if (ppos >= 0 && nondot && wfile_eitherslash(s[i]) && s[i + 1] == '.' && s[i + 2] == '.' && (wfile_eitherslash(s[i + 3]) || s[i + 3] == '\0')) {
      for (j = s[i + 3] == '\0' ? i + 3 : i + 4; s[j] != '\0'; j++)
        s[ppos++] = s[j];
      s[ppos] = '\0';
      ppos = -1;
      nondot = 0;
      i = -1;
      continue;
    }
    if (ppos < 0 && s[i] == '.' && (wfile_eitherslash(s[i + 1]) || s[i + 1] == '\0')) {
      for (ppos = i, j = (s[i + 1] == '\0') ? i + 1 : i + 2; s[j] != '\0'; j++)
        s[ppos++] = s[j];
      s[ppos] = '\0';
      ppos = -1;
      nondot = 0;
      i = -1;
      continue;
    }
    if (wfile_eitherslash(s[i])) {
      ppos = -1;
      nondot = 0;
    } else {
      if (ppos < 0)
        ppos = i;
      if (s[i] != '.')
        nondot = -1;
    }
  }
}
```