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

```asm
<reverseWords>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L50
L117:
  addl   $0x1,-0x10(%rbp)
L50:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L117
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L66
  mov    -0x18(%rbp),%rax
  movb   $0x0,(%rax)
  jmp    L63
L66:
  mov    -0x10(%rbp),%eax
  mov    %eax,-0x4(%rbp)
  jmp    L9
L71:
  addl   $0x1,-0x10(%rbp)
L9:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L73
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L71
L73:
  mov    -0x10(%rbp),%eax
  sub    -0x4(%rbp),%eax
  mov    -0x4(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    %eax,%esi
  mov    %rdx,%rdi
  call   <reverseStr@plt>
  jmp    L57
L120:
  addl   $0x1,-0x10(%rbp)
L57:
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L120
  mov    -0x10(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L66
  mov    -0x10(%rbp),%edx
  mov    -0x18(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <reverseStr@plt>
  nop
  movl   $0x0,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  mov    %eax,-0xc(%rbp)
  jmp    L15
L70:
  addl   $0x1,-0x8(%rbp)
L15:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L70
  jmp    L134
L6:
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  addl   $0x1,-0xc(%rbp)
  addl   $0x1,-0x8(%rbp)
L145:
  mov    -0x8(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jge    L77
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  jne    L6
  jmp    L77
L4:
  addl   $0x1,-0x8(%rbp)
L77:
  mov    -0x8(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jge    L18
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x20,%al
  je     L4
L18:
  mov    -0x8(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  je     L134
  mov    -0xc(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0xc(%rbp)
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
L134:
  mov    -0x8(%rbp),%eax
  cmp    -0x10(%rbp),%eax
  jl     L145
  mov    -0xc(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L63:
  leave
  ret
```

assistant: ```c
void reverseWords(char *s) {
  int p = 0;
  while (s[p] == ' ')
    p++;
  if (s[p] == '\0') {
    *s = '\0';
    return;
  }
  while (1) {
    int pre = p;
    while (s[p] != ' ' && s[p] != '\0')
      p++;
    reverseStr(s + pre, p - pre);
    while (s[p] == ' ')
      p++;
    if (s[p] == '\0') {
      reverseStr(s, p);
      break;
    }
  }
  int i, j;
  i = j = 0;
  while (s[j] == ' ')
    j++;
  while (j < p) {
    while (j < p && s[j] != ' ')
      s[i] = s[j], i++, j++;
    while (j < p && s[j] == ' ')
      j++;
    if (j != p)
      s[i++] = ' ';
  }
  s[i] = '\0';
}
```