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

```asm
<topol_is_connected>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  cmpl   $0x1,-0x1c(%rbp)
  ja     L55
  mov    $0x0,%eax
  jmp    L91
L55:
  mov    -0x18(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L87
  mov    -0x18(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L87
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x18(%rbp),%rax
  mov    0x8(%rax),%rdx
  mov    -0x18(%rbp),%rax
  mov    %rdx,(%rax)
  mov    -0x18(%rbp),%rax
  lea    0x8(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
L87:
  movl   $0x1,-0xc(%rbp)
  jmp    L32
L73:
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L52
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  sub    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rdx
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rcx
  mov    -0x18(%rbp),%rax
  add    %rcx,%rax
  mov    (%rax),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L29
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  mov    -0xc(%rbp),%edx
  add    %edx,%edx
  mov    %edx,%edx
  lea    0x0(,%rdx,8),%rcx
  mov    -0x18(%rbp),%rdx
  add    %rcx,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0xc(%rbp),%eax
  add    %eax,%eax
  add    $0x1,%eax
  mov    %eax,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L89
L29:
  mov    $0x0,%eax
  jmp    L91
L52:
  nop
L89:
  addl   $0x1,-0xc(%rbp)
L32:
  mov    -0xc(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jb     L73
  mov    $0x1,%eax
L91:
  leave
  ret
```

assistant: ```c
int topol_is_connected(char **ids, unsigned int n) {
  unsigned int i;
  char *idtemp;
  if (n <= 1)
    return 0;
  if (strcmp(ids[1], ids[2]) && strcmp(ids[1], ids[3])) {
    idtemp = ids[0];
    ids[0] = ids[1];
    ids[1] = idtemp;
  }
  for (i = 1; i < n; i++) {
    if (strcmp(ids[2 * i], ids[2 * i - 1]) == 0) {
      continue;
    } else if (strcmp(ids[2 * i + 1], ids[2 * i - 1]) == 0) {
      idtemp = ids[2 * i];
      ids[2 * i] = ids[2 * i + 1];
      ids[2 * i + 1] = idtemp;
    } else {
      return 0;
    }
  }
  return 1;
}
```